Metric window rollup pages on-call for a minute that never spiked
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 on-call SRE keeps this rollup open during an incident. It buckets raw web.5xx samples into fixed 60-second windows and prints, per window, how many samples landed and their total. When a window's total crosses the alert threshold, the SRE pages the owning team. This morning they noticed the first window reads higher than the metering dashboard shows for the same minute, so they stopped trusting the rollup before it pages anyone by mistake.
window_rollup.py reads the collector feed and prints, for one metric, each 60-second window with its sample count and value sum.
Windows are fixed 60-second buckets aligned to the epoch (12:00:00-12:01:00, 12:01:00-12:02:00, ...) and are half-open: a sample whose timestamp is exactly 12:01:00 belongs to the 12:01:00 window, not the 12:00:00 one.
What this round practices
Fixed-window rollups drive paging, and a window boundary that is off by one sample can wake someone at 3am. The round practices reading timestamps carefully, deciding which window each sample belongs to, and checking your answer against the dashboard's numbers.
Files you will work in
These 4 workspace files open in the in-browser editor when you start the round. Hidden tests also run when you submit.
task.mdsrc/window_rollup.pyfixtures/input.txttests/expected_output.txt
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 45 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
Rate Limiter: Requests Slip Through During an Outage (Python)
The API gateway admits requests during a quota-store outage, while unexpected storage errors disappear from its caller.
Python · 30 min
- 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