Code Room
System designHardsd-g269
Subject Exactly once deliveryLevel Senior–Staff~55 minCommon in Databases & SQL · Networking & APIs · Distributed systems interviewsIndustries Technology, Software development

Question

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.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.