Code RoomExactly-once payment processing
HardPrep Room Coding #3392

Exactly-once payment processing

System designDatabases & SQLNetworking & APIsSenior–Staff~55 min

Design an ordered, exactly-once payment-event processor that consumes 'charge', 'refund', and 'capture' events for merchant accounts off a partitioned log. Events for the same merchant+order must be applied in order; a duplicate or out-of-order apply must never double-charge or refund more than was captured. The processor writes to a ledger DB and emits downstream payout events. Producers and consumers can crash and retry at any point. How do you guarantee per-partition ordering and effectively-exactly-once application across crashes?

What a strong answer looks like

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.

Clarify6:00 left
Estimate6:00 planned
Design18:30 planned
Deep dive14:30 planned
Failure10:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.