Code Room
System designHardsd-g666
Subject Distributed transaction 2pcLevel Senior–Staff~45 minCommon in Databases & SQL · Concurrency · Distributed systems interviewsIndustries Technology, Software development

Question

Design distributed transactions across three independent services — Inventory, Payments, and Orders — each with its own database, so that placing an order either fully succeeds or fully rolls back at 5k orders/sec. Compare two-phase commit (2PC) and a saga, pick one, and explain how you handle a coordinator crash mid-commit and a partial failure where Payments succeeds but Inventory is sold out.

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.