ETA Prediction

Design an ETA prediction service that returns arrival-time estimates for millions of trips per second.

00

Practice checkpoints

The requirements are open as a taste. From the numbers onward, the full guide opens in the app.

  1. 01
    Clarify scope
  2. 02
    Requirements + scale
  3. 03
    API + data modelUnlocks in the app
  4. 04
    Draw architectureUnlocks in the app
  5. 05
    Deep diveUnlocks in the app
  6. 06
    Trade-off decisionUnlocks in the app
01

Requirements that shape the design

Do not only state requirements. Ask for them. Each card pairs the design constraint with a clarification question you can say out loud before drawing the architecture.

Functional requirements

01What exactly are we predicting — pickup ETA, drop-off ETA, or both?

Both, from one service: the pickup ETA (driver to rider) shown before the match, and the drop-off ETA shown at request time and re-predicted throughout the live trip.

02Is there already a routing engine, or do we build routing too?

A routing engine exists and stays: it computes the graph-search base ETA from map topology and segment speeds — this system predicts the correction on top of it, never the time from scratch.

03Who calls this — one screen, or every surface in the app?

Every surface: search results, fare estimates, matching, and live tracking all hit the same API, including batch calls where one page needs an ETA for hundreds of candidates.

04Does the ETA update after the trip starts?

Yes — a live trip re-predicts on a cadence and on route deviation, because an estimate made at pickup goes stale the moment traffic changes.

05Is arriving five minutes early as bad as five minutes late?

No: late costs far more than early (missed plans, cold food, cancellations), so training and calibration penalize under-prediction harder than over-prediction.

06Do other systems consume the ETA, or only the rider’s screen?

Pricing, matching, and driver positioning all consume it — an ETA error misprices rides and mismatches drivers, so accuracy is a marketplace contract, not a display detail.

Out of scopeDriver–rider matching and dispatch optimization (that system consumes our ETA; it is its own question) · Building the map and routing graph itself (road ingestion, map-matching, turn restrictions) · Pricing algorithm design (we feed it ETAs; we do not set prices)

Non-functional requirements

01How fast must one prediction be?

Low single-digit milliseconds at p99 per prediction — the ETA sits inside hot paths (search, matching) that cannot wait on a heavyweight model.

02How many predictions per second are we sizing for?

Hundreds of thousands of predictions per second at peak once search fan-out and live-trip re-prediction are counted — per-prediction compute must be sparse lookups, not dense math.

03How fresh do the traffic signals have to be?

Traffic features reflect the road within about 3 minutes: segment speeds aggregate in short windows and stream in, because stale traffic makes ETAs wrong exactly when users check them most.

04The model or feature store goes down — what does the rider see?

Graceful degradation: if the model or feature store fails, the routing-engine base ETA ships alone — a slightly worse estimate always beats no estimate, and the baseline is always warm.

05How do we know accuracy is holding — one number?

Accuracy is judged per slice — city × time-of-day × weather × trip type — with every completed trip logged as prediction vs actual, because a healthy global average can hide a broken airport.

Keep asking — the interview is a conversation

Real interviews probe far more than a tidy list. These are the scope questions that separate candidates who interrogate the problem from those who recite it.

  • Which ETA matters most here — pickup, drop-off, or delivery — and at which stage: search page, confirmed trip, or live tracking?
  • Is there an existing routing engine to build on, or am I designing routing too?
  • What are the latency and throughput targets — is this called once per trip, or hundreds of times per search page?
  • What does an error cost — is five minutes late worse than five minutes early for this product, and by how much?
  • Who else consumes the ETA — pricing, matching, driver positioning — and can my errors feed back into their decisions?
01

Unlock the full playbook for ETA Prediction

Numbers, architecture diagram, API and data model, deep dives, expected topics, self-check, whiteboard starter, and common mistakes unlock inside the app.

02

Numbers that force architecture decisions

Locked in the app

03

Architecture path

Locked in the app

04

API and data model

Locked in the app

05

Deep dive directions

Locked in the app

+Series

Practice the related series