Code RoomBatched delivery dispatch
HardPrep Room Coding #3519

Batched delivery dispatch

System designDistributed systemsSenior–Staff~55 min

Design a batched delivery-dispatch system for an on-demand grocery platform. Orders arrive continuously; couriers are moving around the city. Instead of assigning each order to the nearest courier instantly, you want to batch nearby orders that can share a route and assign each batch to the best courier, re-solving every ~30 seconds over a metro of ~20k live orders and ~5k couriers. Goals: minimize total courier travel and delivery lateness while keeping food fresh. Describe the batching, the assignment formulation, how you keep the solve tractable at this scale, and how you handle orders that keep losing 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.

Clarify6:00 left
Estimate6:00 planned
Design18:30 planned
Deep dive14:30 planned
Failure10:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.