Katkat

Design Sensor Data Processing With AI-Assisted Implementation

Applied IntuitionSoftware Engineer · Technical Screen

Last updated

Design an end-to-end ingestion, validation, and storage pipeline for high-frequency sensor telemetry from autonomous vehicle fleets. The focus is on handling raw versus derived data, schema modeling, fast time-range queries, and robust validation.

Scenario

Autonomous vehicles and robotic fleets record massive volumes of multi-modal sensor telemetry during test runs and live operations, including high-frequency IMU readings, GPS coordinates, wheel tick counts, and perception metadata. Engineers and downstream simulation engines need to ingest this data reliably, run data quality validations, compute derived aggregations, and query arbitrary time slices for root-cause analysis.

Design an ingestion and processing platform that accepts incoming sensor logs, validates integrity, stores raw and processed streams, and serves low-latency range queries.

Requirements

Functional Requirements

  • Ingestion & Validation: Ingest continuous sensor payloads (both streaming and batch bag/mcap uploads). Validate schema correctness, clock skew, missing timestamps, and out-of-order samples.
  • Tiered Storage: Support raw sensor capture for compliance/re-simulation, as well as normalized, indexed, downsampled views for analysis.
  • Query & Retrieval: Provide APIs to query specific vehicle channels across arbitrary time ranges [t_start, t_end] at full fidelity or downsampled resolutions (e.g., 100 Hz IMU aggregated to 1 Hz averages).
  • Derived Feature Computation: Compute moving window statistics (e.g., acceleration spikes, sudden stops, trajectory drift) near real-time.

Non-Functional Requirements & Scale

  • Fleet Scale: 2,000 active test vehicles, each generating ~10 MB/sec of telemetry (excluding high-res raw video/point-clouds) = 20 GB/sec (~160 Gbps) aggregate ingestion peak.
  • Latency: Validation errors and alertable events must be flagged within 5 seconds; point-in-time range queries for a 1-hour window should return in under 2 seconds.
  • Durability: Zero data loss for raw telemetry logs.

What to Cover

  1. High-Level Architecture: Edge-to-cloud upload boundary, message streaming layer, validation microservice, and downstream sinks.
  2. Data Model & Storage Strategy: Distinguish storage engines for raw uncompressed files, hot time-series data, and analytical rollups (e.g., Object Store vs. Time-Series DB vs. Columnar Parquet).
  3. Validation & Quality Framework: Rules for detecting dropped packets, time sync drift (PTP/GPS), and strategies for handling malformed records without blocking pipelines.
  4. Query & Aggregation API: Schema and index design for fast slice-and-dice queries by vehicle_id, topic, and timestamp.
  5. AI-Assisted Code Productionizing: How you would validate, test, and harden AI-generated parser or aggregation code before deploying it to production telemetry workers.

Hints

Hint 1

Separate the ingestion path into an immutable raw append-only blob store and a parallel streaming pipeline for parsing and validation.

Hint 2

Use partition keys structured by vehicle ID, topic, and coarse time buckets (e.g., YYYY-MM-DD-HH) to avoid hotspotting time-series databases.

Hint 3

For downsampled queries across large ranges, precompute multi-resolution rollups (e.g., 1s, 10s, 1m) rather than aggregating raw data at read time.

Follow-up questions

  • How would you handle clock drift if a vehicle's onboard clock drifts backward or jumps forward by several seconds during recording?
  • If raw uploads arrive as compressed ROS bags or MCAP files, how do you parallelize parsing without loading entire gigabyte-sized files into memory?
  • What guardrails, property-based tests, and runtime checks would you establish around AI-generated parsing rules to prevent silent data corruption?