Code RoomActive-active order consistency
HardPrep Room Coding #3566

Active-active order consistency

System designDistributed systemsSenior–Staff~50 min

Design an active-active multi-region order system for a food-delivery marketplace where both the diner and the restaurant for a given order are pinned to one metro (so a given order's writes naturally belong to one region), but a small fraction of entities are cross-metro (a chain restaurant operating in two metros, a corporate account spanning regions). Both regions accept writes. The requirement: an order's lifecycle (placed → accepted → preparing → en route → delivered) must be strongly consistent and never see two regions concurrently advancing the same order, while the system stays fully available in each region if the inter-region link drops. Define the write-ownership model, how a write that lands in the 'wrong' region is handled, and what happens to the cross-metro entities during a partition.

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.