Code RoomRoute optimization service
HardPrep Room Coding #3528

Route optimization service

System designDistributed systemsSenior–Staff~55 min

Design a route-optimization service for last-mile delivery: each morning, plan routes for 50k drivers, each carrying ~150 packages, in a single metro, minimizing total drive time while honoring per-package time windows, vehicle capacity, and driver shift limits. The plan must be produced overnight in a few hours but also support intraday re-optimization when packages get added, vehicles break down, or traffic spikes. Describe the problem formulation, why exact optimization is infeasible at this scale, the heuristic/decomposition approach, and how you handle real-time re-optimization vs the batch plan.

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.