KatInterview

Arrival-Time Prediction for a Ride-Hailing Platform

Machine LearningModel answer
HardModel answerMachine Learningeta-predictionuncertainty-quantificationfeature-store

Last updated

Design a production ML system that predicts pickup and trip-duration estimates with calibrated uncertainty, covering features, models, serving, leakage control and A/B rollout.

You are building the service that tells riders, at the moment they request a ride, how long until the car arrives and how long until they reach their destination. Design the whole system, from data to rollout.

Cover the following:

  1. Inputs. Which data sources and features would you use? Think about the road network, GPS traces, historical and live speeds, incidents and closures, weather, local events, supply and demand, driver behavior, and device or network conditions.
  2. Models. Compare three options: a map-matching plus time-dependent shortest-path baseline, gradient-boosted trees, and a spatiotemporal deep model (sequence or graph based). Explain how you represent a route and how you handle errors whose spread changes with trip length, weather or congestion.
  3. Uncertainty. Produce a point estimate plus 50% and 90% intervals. Explain how you would obtain and calibrate them (for example quantile regression and conformal prediction).
  4. Architecture. Describe training and serving: feature store, streaming updates, drift detection, refresh cadence, canary releases, and latency and availability targets.
  5. Data integrity. How do you prevent leakage and handle censoring (post-dispatch signals, reroutes, cancellations)? How do you deal with new regions and rare events?
  6. Offline evaluation. Which metrics (MAE, MAPE, P50 and P90 error, 90% interval coverage, CRPS) and which slices (city, time of day, weather, surge)?
  7. Online evaluation. Design the A/B test, including guardrail metrics (cancellation rate, rider wait, driver idle time, interval reliability) and rollout criteria.

Finish with the main trade-offs and name the model you would ship first as an MVP.

Hints

Hint 1

Treat the two targets separately: the pickup estimate depends on which driver is chosen (unknown at request time), while the trip estimate is pickup time plus travel along the planned route.

Hint 2

Use the routing engine's own estimate as a strong feature and have the learned model predict a correction (for example the log of actual over routing estimate) rather than raw duration.

Hint 3

For leakage, ask for every feature: would it be known at request time? Cancellations are censored labels, not missing ones, so decide explicitly how to treat them.

Hint 4

Calibrate intervals per stratum (city, hour bucket, weather) and monitor realized coverage online so you can recalibrate or roll back quickly.