Skip to main content
EasyBug fixPython45 min

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.md
  • src/main.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.