Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Design Real-Time Location Tracking

HardSystem Design00:00
Practice interviewer
In session
5 left
00:00

Your question is Design Real-Time Location Tracking. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Product Context

RideWave is a consumer mobile app that lets users share live trips with friends, estimate arrival times, and receive safety alerts when a tracked device deviates from its expected route. The ML system must turn noisy mobile GPS pings into accurate real-time location state and short-horizon movement predictions.

Scale

SignalValue
DAU35M
Concurrent tracked devices at peak4.5M
Peak ingest QPS (location pings)220K events/sec
Average ping frequencyevery 3-8 seconds while active
Geofence / route candidates per request100-5,000 depending on density
p99 latency budget for live update150ms end-to-end

Task

Design an end-to-end ML system for real-time location tracking in the mobile app. Your design should address:

  1. How you would define the prediction tasks and success metrics for live tracking, map matching, and short-term ETA / route deviation detection
  2. The full architecture from mobile event ingestion to online inference, including any multi-stage pipeline such as candidate road-segment retrieval, ranking, and re-ranking / smoothing
  3. What features and labels you would use, and how you would build batch + streaming pipelines without introducing training-serving skew
  4. How models are trained, deployed, refreshed, and evaluated offline and online
  5. How you would monitor the system and handle major failure modes at scale

Constraints

  • Mobile GPS is noisy, sparse indoors, and can be delayed or arrive out of order
  • Battery cost matters: the app cannot increase GPS sampling aggressively for all users
  • The system must support regional data residency requirements and minimize retention of precise raw coordinates
  • Freshness matters: route deviation alerts should trigger within seconds, but false positives are costly
  • Cost target: online inference and feature serving should remain efficient enough to support sustained 220K events/sec at peak