DoorDash Just-in-Time Dispatch Lab (Interactive)
Hold the courier until the kitchen is nearly done, then batch routes without breaking SLAs. Coordinate the three-sided marketplace: predict kitchen prep, dispatch couriers at ready-minus-travel, bundle compatible orders along one route, and watch utilization, idle minutes, and delivery promises move.
Just-in-Time Dispatch & Batching Engine
The 3-sided marketplace: hold the courier until the kitchen is almost done, bundle compatible orders along one route, and keep every delivery inside the 35-minute promise.
How It Works Under the Hood
Food delivery is logistics against perishable clocks. Dispatching a courier the moment an order lands strands them at the restaurant for the entire kitchen prep window — the naive-engineering failure DoorDash, Swiggy, and Zomato all hit. The fix is Just-in-Time dispatch: a gradient-boosted Kitchen Prep Time model forecasts packing minute, an H3 geospatial matcher finds a courier six minutes away, and assignment fires at ready-minus-travel so arrival coincides with the bag seal. On top, MILP batch optimizers bundle compatible orders along one route while holding every customer inside the 35-minute promise.
Core Architectural Principles
- JIT trigger: dispatch time equals predicted food-ready time minus courier travel, zeroing restaurant-door idle minutes.
- Batch depth: bundling K orders per run divides courier-minutes by K but adds a detour to each drop beyond the first.
- Capacity math: Little's law — couriers needed equals orders per minute times occupied minutes per run, versus fleet online.
For delivery designs, lead with the three-sided coordination and the naive-dispatch trap, then state the JIT formula out loud: dispatch at KPT minus travel time. Name the batching problem — VRPTW solved heuristically every thirty seconds — and its guardrail: bundle only when both ETAs still fit the promise. Mention the GPS pipeline: MQTT ingest, Redis geospatial buffer, map-matching, WebSocket push with client interpolation.
Aggressive batching and JIT holding maximize courier utilization and margins but push ETAs toward the promise edge whenever kitchens run late.