Katkat

Design real-time delivery tracking system

MotiveSoftware Engineer · Onsite

Last updated

An open-ended Motive system-design interview question: design a real-time courier delivery-tracking platform covering mobile GPS publishing, streaming ingestion and map matching, route/ETA computation and multi-stop optimization, the order/assignment lifecycle, live and historical map rendering, scale, privacy, and failure recovery. Includes a combined reference solution and evaluation rubric.

Question

Design a real-time delivery / courier-tracking platform that gives dispatchers, operations, and customers live visibility into each courier's route, position, and ETA. Address the full system end-to-end: mobile GPS publishing, ingestion and streaming, route and ETA computation, the order/assignment lifecycle, live and historical map rendering, scale, privacy, and resilience.

Cover the following sub-parts:

  1. Service architecture. Lay out the overall architecture (clients, edge/gateway, core services, event bus, datastores) and justify a streaming / event-driven (and, where appropriate, CQRS) approach.
  2. Mobile GPS publishing. How courier mobile apps collect and publish GPS updates: sampling strategy, batching, compression, sequence numbering, and authentication/anti-spoofing.
  3. Ingestion & stream processing. How the backend ingests location data, validates and deduplicates it, performs map matching and smoothing, runs geofencing, and fans out updates.
  4. Route & ETA computation. How routes and ETAs are computed and updated incrementally for the live leg and future legs, including multi-stop route optimization (VRP / TSP with time windows) for dispatch planning.
  5. Order & assignment lifecycle. APIs and data model for creating orders, assigning/unassigning couriers (avoiding double-assignment), and transitioning order state.
  6. Map rendering & live updates. How live and historical routes are delivered to dispatcher consoles and customer tracking pages (WebSocket/SSE, vector tiles, polyline simplification, zoom-aware throttling).
  7. Data storage. Hot last-known state, time-series traces, and cold archival for historical playback.
  8. APIs. Expose endpoints such as POST /orders, POST /orders/{id}/assign, POST /couriers/{id}/locations, GET /couriers/{id}/trace, GET /orders/{id}/eta, GET /orders/{id}/live, plus streaming subscriptions.
  9. Scale & capacity. Estimate throughput, storage, and connection counts. Handle scale from tens of thousands of concurrent couriers up to millions of deliveries per day.
  10. Latency vs. consistency trade-offs, including strong consistency for order/assignment vs. eventual consistency for the live map.
  11. Offline mode & battery constraints on the mobile client.
  12. Privacy and access control (data minimization, RBAC/ABAC, ephemeral tracking links, location blurring/redaction, retention).
  13. Failure handling, disaster recovery, and monitoring/alerting (SLOs, golden signals, synthetic probes).