Webhook receiver with out-of-order events
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.
Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.