AI Delivery ETA Prediction System

Predicting When Food Arrives, Stage by Stage, and Updating It Live

Design the system that predicts when a food order will reach the customer, as a range, by modeling kitchen time, courier travel and handoff separately, and re-estimates the time at every event until the door.

Overview

A delivery ETA is the time the app tells a customer their food will arrive. It is shown on the store list before they order, promised at checkout, and updated on the tracking screen until the courier knocks. A wrong ETA hurts in both directions: too long and customers order elsewhere or cancel; too short and they wait past the promise, while couriers wait at kitchens that are not ready.

The time is not one quantity. The kitchen prepares the food while a courier is assigned and drives to the store; the courier can leave only when both are there; then comes the drive to the customer and the handoff at the door (parking, stairs, an apartment lobby). Each stage has its own data and its own uncertainty, so a strong design predicts each stage and combines them.

Uber described this shape publicly in 2017: its Uber Eats estimated time of delivery covered restaurant processing, meal preparation, courier dispatch, travel to the restaurant, food pickup and the drive to the customer, predicted end to end with gradient-boosted decision tree regression using features such as the restaurant's average meal prep time over the last seven days and over the last hour.

Questions to ask first

  • Where is the ETA shown? — Store list, checkout, and live tracking
  • One number or a range? — A range: p10 to p90, with p50 as the headline
  • What does accurate mean? — About 80% of deliveries land inside the range; few land after the late end
  • Do we control the courier? — Assignment exists; its timing is an input, not our design
  • Do kitchens report ready times? — Some do (tablet or POS button); most signals are the courier's arrival and pickup
  • How fresh must updates be? — A new ETA within a few seconds of each order event

What you will be able to do

  • Break a delivery into stages and combine them with the right arithmetic (a max, not a sum).
  • Explain why kitchen prep labels are censored and how to fit a model to them without bias.
  • Predict travel time as a routing-engine estimate plus a learned correction.
  • Produce an honest p10 to p90 range and re-estimate it as the order moves.
  • Measure accuracy with coverage and lateness, and serve store-list ETAs at 21,000 a second.

Key concepts

  • Stage decomposition
  • Critical path (max of kitchen and courier)
  • Prep time model
  • Censored labels
  • Routing ETA plus residual
  • Quantile forecasts
  • Re-estimation on events
  • Near-real-time features
  • Coverage and lateness

Functional requirements

  • Show an ETA range for every store on the store list
  • Promise an ETA range at checkout, before a courier is assigned
  • Predict kitchen prep time per order from the items and the kitchen's current load
  • Predict courier travel to the store and to the customer
  • Re-estimate on each event: accepted, courier assigned, ready, picked up, near the door
  • Push updated ETAs to the tracking screen
  • Flag orders likely to be late for customer support
  • Log every prediction with the actual outcome for training and monitoring

Non-functional requirements

  • Checkout ETA in under 100 ms at p99 (a target we chose)
  • Store-list ETAs for 30 stores in one batched call under 150 ms (a target we chose)
  • Updated ETA on the tracking screen within 5 seconds of an event
  • About 80% of deliveries inside the p10 to p90 range, measured weekly per city
  • If a model is down, fall back to per-store historical medians, never to no ETA

Interview questions

  • How do you structure the ETA prediction?
  • How do you predict prep time when kitchens do not report ready times?
  • How do you predict travel time?
  • How do you give the customer a range, and how do you know it is honest?
  • How does the ETA update after the order is placed?
  • How do you serve ETAs for every store on the store list?
  • What do you do when the courier batches two orders?

Sign up free to read the full topic

More System Design topics

Start free on Cariara · Coding problems · System design studio