Code RoomIdempotency key service
HardPrep Room Coding #3743

Idempotency key service

System designNetworking & APIsConcurrencySenior–Staff~40 min

Design an idempotency-key service that makes mutating API calls (e.g. "charge this card", "create this order") safe under client retries, where the SAME key may arrive concurrently from a retry storm. Constraints: a payment must execute its side effect at most once even if 5 duplicate requests land within milliseconds, the client must get a consistent response across all duplicates, and a request that crashed mid-execution must be safely retryable. Describe the key store, how concurrent duplicates are coordinated, and what the second-arriving request sees.

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:30 left
Estimate4:30 planned
Design13:30 planned
Deep dive10:30 planned
Failure7:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.