Design Data Models and Pipelines for a Robotaxi Fleet
System DesignModel answerLast updated
Design the analytics data model for a remote vehicle assistance function and an end-to-end pipeline for measuring autonomous fleet stability.
Background
A fully autonomous ride-hail service operates a fleet of self-driving vehicles. Passengers book trips through an app; the vehicle handles pickup and dropoff without a human driver. A team of remote operators — called mission specialists — monitors the fleet from a central operations hub throughout each shift.
Mission specialists can:
- Track any vehicle's live position on a map.
- Watch a live video feed from vehicle cameras.
- Step in when a vehicle requests help: they may observe, give guidance, take remote control, escalate to field support, or mark the issue resolved.
The operational flow when a vehicle needs help:
- The vehicle sends a help request.
- The request enters a queue.
- A mission specialist is assigned to it.
- The specialist works the issue until it is resolved, handed off, or escalated.
There are always more active vehicles than specialists. A single specialist handles multiple vehicles over the course of a shift.
What to Design
Part 1 — Remote Operations Data Model
Design a data model to measure the efficiency and effectiveness of the remote operations function.
Your answer should cover:
- Core entities and their table grain (what one row represents).
- Relationships between entities.
- The key metrics the model should support, grouped by efficiency and effectiveness.
Part 2 — Fleet Stability Pipeline
Design a data architecture and pipeline to measure vehicle stability across the autonomous fleet.
Your answer should cover:
- Data sources.
- Ingestion approach (streaming and/or batch).
- Storage layers.
- Key transformations.
- Data quality checks.
- Metrics produced.
- Downstream consumers of this data.
What is Expected
This is a design question, not a coding exercise. A strong answer will:
- State assumptions about scale (fleet size, request volume, telemetry rates).
- Scope the problem clearly: this is the analytics and observability layer, not the real-time control plane.
- Define what "efficiency," "effectiveness," and "stability" mean concretely before jumping into schemas.
- Justify design choices and name trade-offs.
- Use specific numbers, latency targets, and technology examples where they add clarity.
Hints
Hint 1
Before drawing any tables, nail down the grain of each fact table. Ask: what does one row represent? The most common mistake here is mixing help-request-level and assignment-level facts into a single table, which makes handoff and escalation metrics impossible to compute correctly.
Hint 2
Don't forget the denominator. Efficiency metrics like utilization and requests-per-hour need a specialist state interval table — something that records when each specialist was available, handling a case, or on break. Without it, you can't divide handling time by anything meaningful.
Hint 3
For the stability pipeline, think in two paths: a low-latency streaming path for real-time alerts (fleet-wide fault spikes, vehicles stuck without an open request) and a higher-fidelity batch path from depot uploads that becomes the source of truth. The batch path reconciles data lost over the cellular connection.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Step 1 — Scope and Working Numbers
Before modeling anything, establish what this system is and is not. This is the analytics and observability layer — the schemas, pipelines, and metrics that let operations managers and engineers understand what is happening. It is not the real-time control plane that streams video or sends steering commands.
Pin down scale assumptions to make design choices defensible:
- Fleet: ~500 vehicles, each active ~16 hours per day.
- Specialists: ~60 per shift, roughly 8 vehicles per specialist.
- Help requests: ~2 per vehicle-hour → ~16,000 per day. Low volume; correctness matters more than throughput.
- Telemetry: pose, speed, and mode at 10 Hz, ~1 KB per message → ~5 MB/s, ~430 GB per day.
- Raw sensor logs: terabytes per vehicle per day, offloaded at the depot; analytics uses only extracted event summaries.
- Latency targets: ops dashboards (queue depth, SLA breaches) need < 1 minute; stability KPIs can be hourly or daily and must be recomputable when late data arrives.
Define terms before building metrics:
- Efficiency: how fast requests are handled with the specialists available.
- Effectiveness: whether issues are truly resolved with minimal passenger impact.
- Stability: how rarely a vehicle needs help or misbehaves, per autonomous mile, normalized for conditions.
Part 1 — Remote Operations Data Model
Use a Kimball-style star schema. Each fact table has a strict, single grain.
Dimensions
These are SCD Type 2 wherever attributes change over time.
dim_vehicle— vehicle_id, hardware revision, depot, commission date. SCD2 because hardware changes.dim_software_release— release_id, version, stack components, rollout date.dim_specialist— specialist_id, team, certification level, hire date. SCD2 because certification changes.dim_request_reason— reason taxonomy (stuck/blocked, perception uncertainty, passenger request, hardware fault) plus a severity tier.dim_geo_zone— H3 cell or operational design domain (ODD) zone, city, road type.dim_date,dim_time,dim_shift(shift_id, start/end, site).
Fact Tables
| Table | Grain | Key columns |
|---|---|---|
fct_help_request | One row per help request (accumulating snapshot) | request_id, vehicle_sk, release_sk, trip_id, reason_sk, zone_sk, severity; timestamps for created / enqueued / first_assigned / first_action / resolved; final_outcome; handoff_count; is_repeat_within_10m |
fct_request_assignment | One row per (request × specialist) assignment | assignment_id, request_id, specialist_sk, assigned_ts, accepted_ts, released_ts, release_reason (resolved / handoff / escalated / timeout) |
fct_specialist_action | One row per action taken | action_id, assignment_id, action_type (observe / advise / remote_control / escalate / resolve), start_ts, end_ts |
fct_specialist_state_interval | One row per contiguous specialist state | specialist_sk, shift_sk, state (available / handling / break / training), start_ts, end_ts, concurrent_requests |
fct_trip | One row per trip | trip_id, vehicle_sk, requested/pickup/dropoff timestamps, planned vs. actual duration, was_aborted, help_request_count |
fct_queue_snapshot | One row per site per minute | queue_depth, oldest_wait_seconds, available_specialists |
The key relationship to call out: a trip has 0..N help requests; a request has 1..N assignments (handoffs create new rows); an assignment has 1..N actions. fct_specialist_state_interval provides the denominator for utilization — the part most candidates forget.
Metrics
Efficiency
- Queue wait (
first_assigned_ts − enqueued_ts) at p50/p95/p99 by severity. Use percentiles, not means. - Time to first action.
- Handle time (sum of assignment durations).
- SLA breach rate (e.g., share of severity-1 requests waiting > 10 seconds).
- Specialist utilization = handling time / (logged-in time − breaks).
- Requests handled per specialist-hour.
- Average concurrency per specialist.
- Staffing ratio by hour from
fct_queue_snapshot, for capacity planning.
Effectiveness
- Remote resolution rate without escalation.
- Repeat-request rate: same vehicle, same zone, within 10 minutes. Best proxy for a bad fix.
- Handoff rate.
- Remote-control share of resolutions (advise is preferred over joystick control).
- Delay minutes attributable to help requests; aborted trip rate; rider satisfaction on affected trips.
Every metric should be sliceable by specialist tenure, reason, zone, software release, and hour of day.
Part 2 — Fleet Stability Pipeline
Data Sources
- Vehicle telemetry stream (cellular, continuous): pose, speed, autonomy mode, heartbeat.
- On-vehicle event logs: autonomy stack events, disengagements, fault codes, process crashes, planner fallbacks, hard-brake/jerk events, localization-loss events.
- Bulk drive logs offloaded at the depot: full-fidelity version of the same events plus odometer data.
- Remote ops event service: help requests from Part 1.
- Trip/dispatch service: trip state transitions.
- Release registry: which software build ran on which vehicle, and when.
- Maintenance/CMMS tickets, weather feeds, map/ODD reference data.
Ingestion
Streaming path: telemetry and critical events publish to Kafka, partitioned by vehicle_id. Every message carries (vehicle_id, boot_id, seq_no, event_ts, ingest_ts). A Flink consumer drives real-time alerting — a vehicle stuck with no open request, or a fleet-wide fault spike shortly after a rollout.
Batch path: depot uploads land in object storage. An indexing job extracts events and mileage into the data lake. This becomes the source of truth that reconciles what the lossy cellular stream dropped.
Storage — Medallion Lakehouse
- Bronze: raw, immutable, partitioned by
event_dateandvehicle_id. - Silver: cleaned, deduplicated, and conformed to canonical schemas.
- Gold: aggregated metrics tables in the warehouse (Snowflake or BigQuery) for BI tools.
- OLAP layer: Druid or Apache Pinot for sub-minute ops dashboards.
Orchestration via Airflow or Dagster; transformations as dbt models.
Key Transformations
- Deduplicate on
(vehicle_id, boot_id, seq_no). Prefer the depot-batch version over the streamed copy. - Clock correction: align to GPS time, flag skew > 1 second.
- Sessionization: build
drive_segmentrecords from mode transitions (autonomous / teleop-assisted / manual / parked). Compute autonomous miles from odometer, falling back to integrated pose. - Software version attribution: as-of join each event to the release active at that timestamp.
- ODD tagging: join to zone dimension using H3 spatial index.
- Derived events: merge cellular and depot streams into a unified
vehicle_eventtable; compute metrics like miles-per-disengagement at the segment level.
Data Quality Checks
- Sequence gap detection: flag missing
seq_noranges per(vehicle_id, boot_id). - Freshness alerts: Flink monitors per-vehicle heartbeat; trigger alert if silent > 60 seconds.
- Schema validation and null checks on mandatory fields at Bronze ingestion.
- Odometer monotonicity check; reject or quarantine rollback events.
- Cross-source reconciliation: daily job compares event counts between cellular and depot streams; high divergence triggers investigation.
Stability Metrics
- Miles per disengagement (MPD): autonomous miles driven divided by disengagement count, by release and ODD zone.
- Fault rate per 100 autonomous miles: normalized per ODD and weather condition.
- Hard-brake rate and jerk rate per autonomous mile.
- Localization-loss rate by zone and time of day.
- Help-request rate per autonomous hour, linked back to Part 1.
- All metrics tracked as 7-day and 28-day rolling windows to smooth variance, with release-over-release delta to catch regressions.
Downstream Consumers
- Ops dashboards: real-time queue and fleet health (OLAP layer).
- Safety and reliability team: MPD and fault trends by release for go/no-go decisions.
- Software engineering: regression detection on new rollouts.
- Capacity planning: utilization trends for staffing models.
- ML/simulation teams: event extracts as training and evaluation data.
Common Mistakes to Avoid
- Conflating the control plane with the analytics layer. Keep them separate.
- Single-table help-request models that can't represent handoffs (the assignment table is essential).
- Omitting the specialist state interval table, which makes utilization uncomputable.
- Relying solely on the cellular stream as source of truth, ignoring packet loss.
- Reporting mean latency instead of p95/p99 for anything SLA-related.
- Missing the software version attribution join, which is what makes stability metrics actionable for engineers.