Rate Limiter: Requests Slip Through During an Outage (Python)
A practice debugging interview round in Python. Reproduce the failure in an unfamiliar codebase, narrow down the cause, ship a minimal fix, and explain your reasoning to an AI interviewer.
The incident
The API gateway uses a shared quota store to reserve requests within a rolling window. During a storage incident, requests were admitted without a confirmed reservation. An unrelated invalid store response also never reached the caller's error reporter.
Required behavior
- Return true only after a reservation succeeds; reaching the quota normally returns false.
- A StoreUnavailableError from cleanup, counting, or reservation must deny the current request by returning false. This gateway prioritizes enforcing the quota during an outage.
- Every other exception must propagate unchanged to the caller, which owns error reporting.
- Attempt each store operation at most once per request. A write timeout may occur after the reservation committed; the store has no idempotency key or rollback API.
- A subsequent request should work normally when storage recovers.
- Preserve per-client quotas, expiry, inclusive window boundaries, and both exported function signatures.
Read README.md and the visible tests, reproduce the incident with Run Tests, and change only src/rate_limiter.py.
What this round practices
The Python version of the rate limiter outage round, with the same gateway and the same incident. Pick it if your interviews run in Python; the questions about failing open versus failing closed, and about which errors reach the caller, are identical.
Files you will work in
These 5 workspace files open in the in-browser editor when you start the round. Hidden tests also run when you submit.
task.mdREADME.mdsrc/window_store.pysrc/rate_limiter.pytests/test_rate_limiter.py
What you are assessed on
The scored report evaluates both your investigation steps and what you explain during the conversation, not only whether the final test run passes.
- Reproduction
- File navigation
- Evidence gathering
- Hypothesis
- Root-cause understanding
- Regression prevention
- Patch scope
- Verification
- Edit control
- Communication clarity
How the round works
You get 30 minutes in a Python workspace that runs in your browser, with no setup. Talk through your plan with the AI interviewer by voice or text, run the tests as often as you like, and submit when the visible checks pass. Hidden tests run on submit, and the scored report covers what you did and what you explained.
Ready to debug this codebase?
Open the workspace, run the failing check first, and walk the AI interviewer through your findings.
Related rounds
View all debugging rounds- MediumBug fix
Cache cleanup: reconcile the overnight report
The overnight cache report disagrees with the morning metrics in both directions. Trace a small Python service, reconcile the counts, and verify its replay checks before operations plans capacity.
Python · 45 min
- MediumBug fix
Editor Comments: Sidebar Over-Counts Unresolved Threads
A collaborative editor's comment sidebar sometimes reports one more unresolved thread than the document actually has, and a reviewer held a doc open believing a comment was still unresolved.
Python · 40 min
- MediumBug fix
Analytics: One Account's Event Counts Are Inflated
A customer analytics report shows one account with far more delivery events than its raw log supports, after the ingestion queue moved to at-least-once delivery.
Python · 45 min