Webhook replay under-credits one merchant's balance
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 payments on-call replays the webhook event log every night to compute each merchant's net balance (charges minus refunds) in cents, which feeds their payout. This morning a merchant opened a ticket: their balance in the report is lower than their own ledger, and payouts are held for that merchant until the number reconciles.
main.py reads the webhook event log and prints each merchant's net balance in cents.
Events are delivered on an at-least-once bus, so the SAME event (identified by its event_id) can be delivered more than once, including a redelivery seconds later. Those redeliveries are the same event and must be applied only once. A merchant can also legitimately have two separate events that happen to share an amount (for example two customers buying the same item), and those are two distinct events.
What this round practices
An easy payments round: replay a webhook log into per-merchant balances. One merchant reads lower than their own ledger, so the work is to list that merchant's events by hand, compute the balance yourself, and find where the report parts ways with you.
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/main.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- EasyBug fix
Peak latency report overstates one endpoint
The per-endpoint peak latency report shows one endpoint far slower than its own traces support, and a latency regression review is stuck on the discrepancy.
Python · 40 min
- EasyBug fix
Monitor board reads OK for a series whose exporter went silent
The monitor status board on-call watches during an incident reports OK for a series that sent no samples all window, so a blind monitor is indistinguishable from a healthy one and on-call stopped trusting the board.
Python · 40 min
- EasyBug fix
Reliability rollup over-reports one service's ERROR count
The nightly per-service ERROR-line rollup reports more errors for one service than the metering dashboard, so the on-call engineer cannot trust it.
Python · 30 min