Skip to main content
HardBug fixPython50 min

Alert-incident rollup hides a monitor's second page in an interleaved feed

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 engineer reads this rollup at the start of a shift to see how many separate times each monitor paged. This morning they noticed one monitor's count reads lower than the metering dashboard shows for the same window, so a second page that really did fire is missing from the rollup. They stopped trusting the count before it hides another incident.

alert_dedup.py reads the collector feed and prints, per monitor, how many distinct alert incidents fired.

An incident is a contiguous run of ALERT transitions for one monitor. Consecutive ALERT transitions for the same monitor with no OK transition between them are the SAME incident and are counted once. A monitor pages again (a new incident) only after it has returned to OK and then goes back to ALERT.

Each line is one monitor state transition. The collector writes transitions to the single shared feed in the order it received them, so the feed is in nondecreasing timestamp order but transitions from different monitors are interleaved. The rollup processes the transitions in that feed order.

What this round practices

Alert deduplication decides whether on-call sees one incident or two. The feed interleaves several monitors, and the round practices finding the single monitor whose count disagrees with the dashboard and tracing its alerts through the rollup by hand.

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/alert_dedup.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 50 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.