Swiggy Delivery Time Prediction

Swiggy Delivery Time Prediction

How cooking time, rider supply and traffic combine into one promise made before the restaurant has even accepted the order.

3 LegsDecomposed Estimate
Pre-AcceptancePrediction Point
PaddedPromise Strategy
LiveSupply Signal
← Back to Case Studies

Overview

Before you have paid, the app promises a delivery time. At that moment the restaurant has not accepted the order, no rider has been assigned, and nobody has started cooking. The number is a forecast about a chain of events that has not begun.

It is a harder problem than route ETA, because road travel is only one of three components. A dish that takes twenty-five minutes to prepare dominates a six-minute ride, and kitchen speed varies with how busy the restaurant already is.

There is also a business asymmetry that shapes the whole design. Arriving early is a pleasant surprise; arriving late is a complaint, a refund and sometimes a lost customer. The system is not trying to be accurate — it is trying to be reliably not-late.

Think of it like this: it is like promising when a dinner party will be served, before you have checked whether the oven is free, whether anyone is available to fetch the ingredients, or how bad the traffic is on the way back.

The Core Challenge

The estimate has to survive several sources of variability that compound on one another:

Kitchen Variability

The same dish takes wildly different times depending on how many orders the restaurant is already handling.

Rider Supply

During peak hours no rider may be free, adding a wait before the journey even begins.

Batching

One rider often carries several orders, so your food may wait while another customer is served first.

Compounding Uncertainty

Three uncertain legs in sequence produce far more spread than any single one of them.

Asymmetric Cost

Being ten minutes early costs almost nothing. Being ten minutes late costs a refund and trust.

High-Level Architecture

Rather than predicting one number, the system predicts each leg of the journey separately and composes them, because each leg has entirely different drivers and its own data.

01

Kitchen Model

Predicts food preparation time from the specific dishes ordered, the restaurant's historical speed and how many orders it currently has in progress.

In shortWorks out how long the cooking will take, given how busy the kitchen already is.

02

Supply State

Tracks how many riders are free, busy or approaching availability in the area around the restaurant right now.

In shortKeeps a live count of who is available to carry your order.

03

Assignment Predictor

Estimates how long until a rider will actually be assigned and reach the restaurant, which during peak hours can exceed the cooking time.

In shortGuesses how long before someone is free to come and collect it.

04

Travel Model

Predicts rider travel time for both the leg to the restaurant and the leg to the customer, using road conditions and two-wheeler routing.

In shortEstimates the riding time, there and then onward to you.

05

Batching Engine

Decides whether to group nearby orders onto one rider, which improves efficiency but adds detour time to some deliveries.

In shortDecides whether your order shares a rider with someone else's.

06

Promise Layer

Converts the internal prediction into the number shown to the customer, adding buffer calibrated to how confident the model is.

In shortTurns the honest guess into a safer promise before showing it to you.

From Tap to Doorstep

1

Estimate at Browse Time

Even before an order exists, a rough estimate is shown per restaurant using its typical preparation time and current area conditions.

In shortThe time on the listing page is already a prediction, made before you have chosen anything.

2

Refine at Checkout

Once the basket is known, the specific dishes and their preparation profiles sharpen the kitchen estimate.

In shortOnce it knows what you ordered, the guess gets more specific.

3

Predict Each Leg

Kitchen time, rider assignment delay, travel to restaurant and travel to customer are each predicted independently.

In shortEvery stage of the journey gets its own estimate.

4

Apply Buffer

The legs are combined and a buffer is added, sized according to the uncertainty of this particular order and area.

In shortThe parts are added up and a safety margin is put on top.

5

Assign and Update

When a rider is actually assigned, the assignment uncertainty collapses into a known value and the estimate is revised.

In shortOnce a real rider takes the job, one of the guesses becomes a fact.

6

Track and Correct

Pickup confirmation and live rider location progressively replace prediction with observation until delivery.

In shortAs it actually happens, guessing gives way to watching.

Breaking the Estimate Apart

A single model predicting total delivery time performs poorly, because the legs are driven by unrelated factors and fail in different ways.

Preparation Time

Driven by dish complexity, restaurant throughput and current kitchen load. A busy kitchen does not cook one dish slower — it queues, so the marginal order waits behind everything already in progress.

In shortCooking time depends less on the dish and more on how long the queue in front of it is.

Assignment Delay

Depends entirely on rider supply relative to demand in that area, and is close to zero off-peak while becoming the dominant term during a dinner rush.

In shortAt quiet times a rider is instant; at peak times waiting for one can be the longest part.

First-Mile Travel

The rider's journey to the restaurant, which can overlap with cooking if assignment happens early enough — good dispatch hides this leg entirely.

In shortThe ride to the restaurant, which ideally happens while the food is still cooking.

Last-Mile Travel

Restaurant to customer, plus the frequently underestimated final stretch: parking, finding the building, lifts and gates.

In shortThe ride to you, including the surprisingly slow business of actually reaching your door.

Predicting the Total

The intuitive method is to add the restaurant's average preparation time to the travel time. It produces an estimate that is right on average and wrong exactly when it matters:

Naive Approach
  • Average preparation time plus route travel time
  • Ignores current kitchen load entirely
  • Assumes a rider is always immediately available
  • Takes no account of batching detours
  • Right at 3pm, badly wrong at 8pm
VS
Production Approach
  • Separate models per leg, composed into a total
  • Kitchen model conditioned on live restaurant load
  • Assignment delay modelled from real-time rider supply
  • Batching probability factored into the estimate
  • Buffer sized by predicted uncertainty, not a fixed number

In short: the system does not predict a single number, it predicts a distribution and then deliberately quotes a pessimistic point within it. It would rather be six minutes early most of the time than be accurate on average and late half the time.

Batching & Supply

Assigning one order per rider is simplest and least efficient. Batching improves economics but directly trades against individual delivery time.

Why Batch

Two orders on similar routes can share a rider, roughly halving the delivery cost per order and easing supply pressure during peaks.

In shortOne rider carrying two orders costs about half as much per order.

The Detour Cost

The second order in a batch waits while the first is delivered, so its delivery time increases even though the system as a whole is more efficient.

In shortIf yours is the second drop, you wait longer so that the fleet works better overall.

Batch Eligibility

Orders are only batched when pickup points and drop-offs are genuinely close and the added delay stays within an acceptable bound.

In shortIt only pairs orders when the detour is small enough not to hurt.

Predicting the Batch

Because batching happens after the promise is made, the estimate must account for the probability of being batched, not just the current plan.

In shortThe promise has to allow for the chance that your order ends up sharing a ride.

Scalability & Reliability

Estimates are requested constantly — every listing page shows dozens — so the cost per prediction has to be very low:

  • Precomputed area state — rider supply and average conditions per zone are computed continuously and shared across all requests in that zone.
  • Cached restaurant profiles — per-restaurant preparation characteristics are updated periodically rather than recomputed per request.
  • Tiered fidelity — listing pages use a fast approximate estimate, while checkout runs the full per-leg prediction for one restaurant only.
  • Graceful fallback — if live supply data is unavailable the system falls back to historical averages plus a wider buffer, rather than failing to show a time.
  • Zone-level isolation — cities and zones are processed independently, so a surge in one area does not degrade predictions elsewhere.

Typical Tech Stack

LayerCommon Choices
Order EventsStreaming pipeline for order, acceptance, pickup and delivery events
Supply TrackingReal-time rider state store keyed by geographic zone
Kitchen ModelsPer-restaurant gradient-boosted models conditioned on live load
Travel EstimationTwo-wheeler routing with live traffic, similar to map ETA services
Dispatch & BatchingOptimisation service assigning riders and grouping compatible orders
Feature StoreShared online features so training and serving stay consistent
ServingCached zone state with low-latency model inference at checkout

Trade-offs & Lessons

  • Decompose before you model — three small models for three legs consistently beat one large model for the total, because each leg has genuinely different drivers and data.
  • Predict the distribution, promise the tail — the useful output is not the expected time but a confidence level the business is willing to commit to.
  • Padding is a product decision — how much buffer to add is a trade-off between conversion and complaints, and belongs to the business rather than to the model.
  • The last hundred metres are underestimated — parking, gates, lifts and finding the right door are a meaningful share of perceived delivery time and are routinely missing from models.

Delivery prediction is a lesson in composing uncertain estimates and then converting them into a commitment. Any business that promises a customer a completion time — a repair, a dispatch, a service call — faces the same structure: several uncertain stages, an asymmetric cost of being late, and a decision about how much of that uncertainty to absorb rather than pass on.

Jargon, Decoded

A quick, no-nonsense translation of the technical terms used above.

Preparation Time

How long the restaurant takes to cook and pack an order, heavily dependent on current load.

Assignment Delay

The wait between an order being placed and a rider being allocated to it.

First Mile

The rider's journey to the restaurant to collect the order.

Last Mile

The journey from restaurant to customer, including the final walk to the door.

Batching

Assigning several orders to one rider to improve efficiency, at the cost of some delivery time.

Buffer / Padding

Extra time deliberately added to the promise to reduce the chance of being late.

Supply

The number of riders available in an area relative to the orders needing delivery.

Prediction Interval

The range a value is likely to fall within, rather than a single expected number.

← Back to all Case Studies

Contact Us




Send us a message