Design a Bus Tracking & Route Optimization System

Medium45 min
1 / 30
understanding9 min read

Problem Statement: Public Bus Tracking Platform

Problem Statement: Public Bus Tracking Platform — bus tracking interview depth

Problem Statement: Public Bus Tracking Platform

Design city-scale bus tracking and route optimization: GPS ingest every 5–15s, map-matched progress along GTFS shapes, fused ETAs at stops, operator reroutes, and planner analytics. This section covers problem statement: public bus tracking platform in the understanding phase.

Operational detail

Quantify before naming SKUs: assume 8,000 buses, 5M daily riders, 10s GPS interval → ~800 ingest events/s average, 3× peak near commute. Store 7-day hot telemetry in Timescale, 90-day cold in object storage. CAP split: AP for live vehicle state (brief staleness OK), CP for schedule versions and alert publications.

Failure and edge cases

  • GPS dropout in urban canyons → fall back to schedule with STALE badge
  • Ghost vehicle after depot return → trip_id mismatch detector
  • Detour without GTFS-RT Alert → riders see impossible ETAs
  • Kafka lag spike → widen ETA window; never show negative countdown

Interview checkpoints

javaOne Dark Pro
1public final class GtfsTripKey { public final String tripId; public final String serviceDate; }
pythonOne Dark Pro
1def partition_key(agency_id: str, day: str) -> str:
2 return f"{agency_id}:{day}"
typescriptOne Dark Pro
1export function isStalePing(tsMs: number, nowMs: number, maxAgeMs = 30000): boolean {
2 return nowMs - tsMs > maxAgeMs;
3}

Numbers to say aloud

  • Ingest: 800/s avg, ~2.4k/s peak (8k buses / 10s).
  • Arrival reads: 50k RPS peak if 5M riders poll every 60s at rush (use push to cut this).
  • ETA target: p95 error < 60s when live; widen to schedule band when ping age > 45s.

Why interviewers care

a Bus Tracking & Route Optimization System interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement: Public Bus Tracking Platform that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • problem focus for sec-01
  • State CAP split: AP live, CP schedule/alerts
  • Quantify ingest before storage choices
Interview tip
Lead Problem Statement: Public Bus Tracking Platform with rider-visible ETA error, not microservice count.
Avoid
Treating bus tracking like Uber dispatch—routes are fixed; optimize headway and stop ETAs.

Section Rescue Kit

Buzzwords to use:

GTFS-RTMap Matching

Safe statements:

  • "For Problem Statement: Public Bus Tracking Platform, I'll separate static GTFS topology from AP live vehicle state."
  • "I'll quantify GPS ingest before picking between Redis and PostGIS."
Design a Bus Tracking & Route Optimization System - System Design | WinJob | WinJob