Question
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.
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.