Build an ETA Prediction Model for Zomato
Problem Build a model that predicts ETA (estimated time of arrival) for a food-delivery order — from order placement through to hand-off at the customer's door.
Functional requirements
- Return an ETA at checkout, before the order is placed.
- Update the ETA as the order progresses through prep, pickup, and transit.
- Decompose the estimate into prep time, rider assignment/wait, and travel time.
- Handle cold-start: new restaurants, new delivery areas, and riders with little history.
Non-functional requirements
- ~5-10k prediction requests/sec at peak meal hours; tens of millions of orders/day.
- p99 inference latency under ~50ms — the ETA blocks the checkout screen.
- Retraining daily to weekly; traffic and demand patterns shift seasonally and around events.
- Every feature must be available in real time at request time, with a defined fallback when one is stale or missing.
Key components
- Data collection: historical order timelines with per-stage timestamps (placed, accepted, prepped, picked up, delivered) as ground-truth labels.
- Feature engineering: haversine and road-network distance, historical durations on the same route, time of day, day of week, weather, live traffic/congestion, restaurant prep-time history and current kitchen backlog, rider availability and load in the area.
- Model: gradient-boosted trees as a strong baseline, or a hybrid that starts from a physical distance/speed prior and learns an ML correction on top; per-stage models summed vs. one end-to-end regressor.
- Feature store serving batch aggregates and real-time signals consistently between training and inference.
- Monitoring: predicted vs. actual drift, per-city and per-restaurant error breakdown, alerting on systematic bias.
Deep dives / trade-offs
- Loss and calibration: MAE/RMSE hide the asymmetry — being 10 minutes late costs far more than being 10 minutes early. Quantile regression to deliberately over-predict, and choosing the quantile as a product decision.
- Feedback loop: the ETA shown to the customer changes their behaviour and the rider's, so logged actuals are not a clean sample of the counterfactual.
- Cold-start hierarchy: backing off from restaurant-level to cuisine/area-level to city-level priors when history is thin.
- Train/serve skew: batch features computed over full history vs. what is genuinely knowable at request time, and leakage from post-hoc fields.
asked …