Code RoomCross-region saga without 2PC
HardPrep Room Coding #3577

Cross-region saga without 2PC

System designDatabases & SQLDistributed systemsSenior–Staff~50 min

An order-fulfillment flow must atomically reserve funds (payments service, us-east), decrement inventory (inventory service, eu-west), and create a shipment (logistics service, ap-south) — three services, three databases, three regions. The product needs the whole thing to be all-or-nothing from the user's perspective. The team's first instinct is cross-region two-phase commit (2PC) with a coordinator. Explain precisely why 2PC across regions is dangerous here (blocking, coordinator failure, latency, holding locks across an 80–200ms WAN), then design the alternative that gives the user effective atomicity. Address partial-failure compensation, idempotency, and what 'atomic' realistically means here.

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.

Clarify5:30 left
Estimate5:30 planned
Design16:30 planned
Deep dive13:30 planned
Failure9:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.