Skip to main content
HardBug fixPython50 min

Nightly payout run under-schedules one merchant's settlement

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 runs the settlement job every night to decide how much money leaves the platform for each merchant. The job reads the pending-payout feed, groups the payouts it can release into per-currency batches, and prints the total amount it scheduled for each merchant. That number is what the payout rail actually moves. This morning a merchant, atlas_supply, opened a ticket: the amount the report scheduled for them is lower than the pending payouts in their own ledger, and their release is on hold until the two numbers line up.

settle.py reads the payout feed and prints, per merchant, the total amount that got scheduled into a batch tonight.

Payouts are processed in the order they appear in the file. A payout is scheduled when its currency is one this account pays out, its status is ready to release, and its id has not already been scheduled from an earlier delivery. Payouts that clear those checks are packed into per-currency batches (at most a few payouts per batch, a limit of the downstream rail) and every scheduled payout lands in exactly one batch; a merchant's reported total is the sum of their scheduled payouts across all batches.

What this round practices

A settlement job groups releasable payouts into per-currency batches, and one merchant is scheduled less than they are owed. One of the harder reconciliation rounds: it practices following one merchant's rows through the grouping code and checking the scheduled total at each step.

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/settle.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.