Code RoomCross-service order transaction
HardPrep Room Coding #3168

Cross-service order transaction

System designDatabases & SQLDistributed systemsSenior–Staff~50 min

Design the transaction model for an order-and-payment flow that spans three independently-deployed services with separate databases: Inventory (reserve stock), Payment (charge card), and Shipping (create shipment). The flow must be atomic in effect — never charge a card without reserving stock, never ship without a successful charge — at 5k orders/sec, with services that can fail or be slow independently, and no shared database. Choose a coordination model (2PC vs saga vs outbox), justify it, describe failure handling, and the central trade-off.

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.