Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Design Real-Time IoT Sensor Pipeline

HardPipelines00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to your interview.

The question is on your right: Design Real-Time IoT Sensor Pipeline. Take a moment with it first.

Talk your thinking through with me if you like - when you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes). Discussion and graded submissions share your five interviewer interactions, so spend them well.

You need to log in / sign up to chat or submit.

Problem

Context

NorthGrid operates industrial HVAC and power-monitoring equipment across commercial buildings. The current pipeline uploads CSV files from edge gateways every 15 minutes into S3, then runs hourly Spark batch jobs; this delay is too high for anomaly detection, operational dashboards, and alerting.

You need to design a scalable real-time data pipeline for sensor telemetry from thousands of endpoints while preserving raw data for replay and supporting downstream analytics.

Scale Requirements

  • Endpoints: 75,000 active sensors across 6,000 sites
  • Throughput: 180K events/sec peak, 45K avg
  • Event size: 0.8-1.5 KB JSON or Protobuf payloads
  • Latency target: P95 < 10 seconds from device emission to queryable curated store
  • Retention: Raw immutable data for 180 days; curated aggregates for 3 years
  • Availability: 99.9% ingestion uptime
  • Data quality: < 0.5% duplicate rate, < 0.1% malformed events after validation

Requirements

  1. Ingest telemetry from MQTT/HTTPS edge gateways with backpressure handling and horizontal scalability.
  2. Validate schema, deduplicate by event_id, and quarantine malformed or late events.
  3. Enrich records with device metadata, site information, and standardized timestamps.
  4. Support both real-time operational queries and downstream warehouse analytics.
  5. Guarantee idempotent writes and replay capability for backfills or processor failures.
  6. Provide monitoring for lag, latency, data quality, and cost.
  7. Explain partitioning, checkpointing, and schema evolution strategy.

Constraints

  • AWS is the required cloud; existing footprint includes S3, IAM, and CloudWatch.
  • Team size is 5 engineers, so operational complexity should be controlled.
  • Incremental infrastructure budget is $35K/month.
  • Some sites have intermittent connectivity; the design must tolerate bursts after reconnect.
  • Compliance requires auditability and deletion of site-level data within 7 days of request.