KatInterview

Streaming ETA System with GPS Signal Processing

Machine LearningModel answer
HardModel answerMachine Learningml-system-designstreaminggps

Last updated

Build a low-latency pipeline that continuously updates driver ETAs using only GPS pings and trip events, handling noisy location data and grid transitions.

You're building a system that maintains up-to-date estimated time of arrival (ETA) for active drivers, organized by spatial grid cells covering a city. The system must process streaming location data and predict how much time remains until each driver reaches their next destination.

Available data sources:

  • GPS location pings from driver devices (latitude, longitude, timestamp, accuracy, optional speed and heading)
  • Trip lifecycle events (trip accepted, passenger picked up, passenger dropped off, trip cancelled)

Requirements: Your design must address:

  1. Data ingestion: How do you ingest, partition, and join the two data streams efficiently?
  2. Signal quality: GPS data contains measurement errors, drift, and outliers. How do you clean and correct location data to accurately place drivers in grid cells?
  3. ETA computation: How do you calculate and continuously refresh the remaining travel time for each active driver?
  4. Model design: What modeling approach fits the latency and throughput constraints? How do you train it?
  5. Feature engineering: All features must derive strictly from the provided streams. What features do you compute, and how?
  6. Performance: The system must handle tens of thousands of concurrent drivers with sub-second update latency. How do you achieve this?
  7. Operations: How do you monitor model quality, detect degradation, and safely deploy updates?
  8. Evaluation: How do you validate the system works correctly, both offline and after launch?

Provide concrete technical choices: algorithms for location correction, data schemas, state management strategy, update frequency, and your approach to handling failures.

Constraint: You may not use external data sources (traffic APIs, weather, road segment features). Every signal must be derived from the GPS pings and trip events you receive.

Hints

Hint 1

Start by clarifying scale assumptions and latency targets—numbers drive architectural decisions.

Hint 2

GPS measurements are noisy; you'll need filtering (like Kalman) and a method to snap corrected positions to valid locations using patterns learned from historical data.

Hint 3

Think about stateful stream processing keyed by driver—this lets you maintain context (position history, current trip phase, feature windows) without expensive joins.