Billing: Duplicate Credits and Surprise Downgrades After Replays
A practice debugging interview round in JavaScript. 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
A billing worker turns subscription webhooks from the payment provider into account entitlement changes (plan, status, monthly credits). The provider delivers each event at least once and does not guarantee order.
Incident Report
A webhook replay double-granted monthly credits to paid accounts, and a delayed older event downgraded an account that had already been upgraded. Non-subscription events and events for other accounts also flow through the same worker.
Read the codebase files, run the tests, and make the smallest fix so entitlement changes are correct under replays and out-of-order delivery. Keep the public function signature.
What this round practices
Payment providers deliver webhooks at least once and in no guaranteed order, and billing code has to stay correct anyway. This is one of the longer rounds, with two symptoms that look unrelated, so it rewards separating them, fixing one at a time, and saying which tests cover which.
Files you will work in
These 5 workspace files open in the in-browser editor when you start the round. Hidden tests also run when you submit.
task.mdREADME.mdsrc/account-store.jssrc/entitlements.jstests/billing-webhooks.test.js
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 55 minutes in a JavaScript 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- HardBug fix
Rate Limiter: Bursts Slip Past the Plan Limit
The API gateway lets a traffic spike reserve more requests than a customer's plan allows, and two accounts blew past their quota during this week's spikes.
JavaScript · 50 min
- HardBug fix
Maze Library: Paths Fail After Directional Cells and Doors
A maze viewer loses its endpoint labels and rejects routes through its newer corridor types.
JavaScript · 60 min
- HardBug fix
Alert-incident rollup hides a monitor's second page in an interleaved feed
The per-monitor alert-incident rollup an on-call engineer reads reports one monitor firing fewer times than the metering dashboard, hiding a real second incident that already paged.
Python · 50 min