Overlapping settlement batches over-credit one account'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 treasury on-call runs this posting job every night to compute each account's balance (charges minus refunds) in cents, which feeds that account's payout. This morning they flagged one account: its balance in the report is higher than the ledger of record, and the payout for that account is held until the two numbers reconcile.
post_ledger.py reads the day's settlement feed and prints each account's balance in cents.
Transactions are delivered in settlement batches. A settlement can re-send an overlapping window of a previous batch, so the SAME transaction (identified by its txn_id) can appear in more than one batch. Those re-sends are the same transaction and must be applied only once. An account can also legitimately have two separate transactions that happen to share an amount (for example two customers paying the same price), and those are two distinct transactions.
What this round practices
Posting jobs turn a day's settlement feed into balances that drive payouts, so a high balance means money leaves too early. The round practices tracing one account's transactions across batches and reconciling the report with the ledger of record.
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/post_ledger.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- MediumBug fix
Rate Limiter: Requests Slip Through During an Outage (Python)
The API gateway admits requests during a quota-store outage, while unexpected storage errors disappear from its caller.
Python · 30 min
- MediumBug fix
Cache cleanup: reconcile the overnight report
The overnight cache report disagrees with the morning metrics in both directions. Trace a small Python service, reconcile the counts, and verify its replay checks before operations plans capacity.
Python · 45 min
- MediumBug fix
Editor Comments: Sidebar Over-Counts Unresolved Threads
A collaborative editor's comment sidebar sometimes reports one more unresolved thread than the document actually has, and a reviewer held a doc open believing a comment was still unresolved.
Python · 40 min