KatInterview

Telemetry Pipeline Design for High-Frequency Robotics Fleet Data

System DesignModel answer
HardModel answerSystem Designstreamingtime-seriesdata-pipeline

Last updated

Design an end-to-end pipeline to ingest, validate, store, and query multi-modal sensor streams from a large fleet of autonomous robots at 20 GB/s aggregate throughput.

Scenario

A company operates a large fleet of autonomous robots in the field. During every mission, each robot continuously records telemetry from several onboard sensors: an inertial measurement unit (IMU) running at high frequency, GPS fixes, motor encoder counts, and perception metadata. Both real-time operations teams and offline simulation engineers depend on this data — to detect anomalies as they happen, replay missions for debugging, and compute derived behavioral statistics.

You are asked to design the platform that handles this data end-to-end: from the moment a robot generates a sensor reading to the moment an engineer queries a specific time window weeks later.

Requirements

Functional

  • Ingestion: Accept both live streaming telemetry from active robots and bulk log file uploads when robots return to base. Both paths land in the same downstream storage.
  • Validation: Detect and handle schema violations, clock synchronization drift, missing timestamps, dropped measurement sequences, and out-of-order samples — without halting the overall pipeline.
  • Storage: Retain raw, unmodified logs indefinitely for compliance and replay purposes. Also maintain a normalized, indexed representation for fast analytical queries. Support pre-computed rollups at multiple time resolutions.
  • Querying: Expose an API that returns all samples for a given robot and sensor channel within an arbitrary time range [t_start, t_end], at either full fidelity or a specified downsampled resolution (for example, 100 Hz IMU reduced to 1 Hz averages).
  • Derived Metrics: Continuously compute windowed statistics — acceleration spikes, abrupt decelerations, positional drift — with results available in near real-time.

Non-Functional

  • Scale: 2,000 active robots, each producing roughly 10 MB/s of telemetry (video and point cloud excluded), for a peak aggregate of approximately 20 GB/s.
  • Alert latency: Validation failures and safety-relevant events must be flagged within 5 seconds of the sensor reading.
  • Query latency: A range query spanning one hour of a single channel must return in under 2 seconds.
  • Durability: No raw telemetry may be permanently lost once recorded on the robot.

What Your Answer Should Cover

  1. Architecture overview — the edge-to-cloud boundary, the streaming backbone, validation workers, and the downstream storage sinks.
  2. Storage strategy — which engine is appropriate for raw files, hot time-series data, and long-retention analytical rollups, and why they are separate.
  3. Validation design — specific checks, how malformed records are handled without blocking good data, and how the 5-second alert budget is met.
  4. Query and API design — how the data model enables fast time-range queries, how resolution routing works, and how write hotspots are avoided.
  5. Productionizing AI-generated code — how you would safely integrate, test, and deploy parser or aggregation logic that was initially drafted by an AI coding assistant.

There is no single correct topology. Justify your choices and call out the trade-offs.

Hints

Hint 1

Start by sizing the system before drawing any boxes. 2,000 robots × 10 MB/s drives every subsequent decision — Kafka partition count, storage tier sizes, and query index granularity all follow from that number.

Hint 2

Raw bytes and parsed records should flow through separate, independent paths. If your parser has a bug, you need to be able to replay from the original bytes without any data loss. Ask yourself: what is the true zero-loss anchor in this system?

Hint 3

For time-range queries to meet the 2-second SLA, you need to think about key design carefully. If your primary sort key starts with timestamp, all current writes land on the same node. What prefix prevents that hotspot while still enabling efficient range scans?