Question
Design the chargeback/dispute handling system for a payment processor. Card networks send dispute events (chargeback initiated, evidence-due, representment outcome, second presentment, arbitration) via async files/webhooks with strict deadlines. When a chargeback hits, funds must be debited from the merchant immediately (or from their reserve), evidence collected, and the outcome posted back to the ledger — possibly reversing the debit if the merchant wins. ~50K disputes/day. Describe the state machine, the money movement, and how you keep ledger and dispute state consistent.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.