Code Room
System designMedium
Question
Design the inbound-webhook receiver that consumes payment lifecycle events from an external processor (charge.succeeded, charge.refunded, charge.disputed). The processor guarantees at-least-once delivery, retries on any non-2xx, and does NOT guarantee order — you can receive 'refunded' before 'succeeded'. ~10,000 webhooks/sec at peak. You must apply each event to your own payment state exactly once and reach the correct final state regardless of arrival order. How do you build the receiver?
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.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.