Skip to main content
MediumBug fixPython45 min

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.md
  • src/window_rollup.py
  • fixtures/input.txt
  • tests/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.