← Amazon Interview Insights

Amazon·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Jun 2026

Summary

Amazon SWE system design round, one big open-ended problem about distributed sensor infrastructure at massive scale. The question had a lot of moving parts and I kept second-guessing my storage choices.

Questions Asked (1)

Q1

Design a distributed temperature sensor system that collects data from up to 10 million sensors spread across a large geographic region, stores readings at 10-second granularity, and serves a near real-time heat map on a web interface along with historical min/max/current queries.

System DesignTechnical Trade-offsData Modeling
Author's notes

The scale is what gets you.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (read/write patterns, latency, consistency) and estimating scale (10M sensors × 0.1 writes/sec = 1M writes/sec, 864M readings/day). Then propose a high-level architecture: ingestion via a scalable message queue (e.g., Kinesis), stream processing for real-time aggregation, time-series storage for historical data, and a serving layer for heat map and queries. Finally, dive into trade-offs and optimizations for each component.

Pro tip: Emphasize partitioning and pre-aggregation: shard by sensor ID or geohash to distribute load, and pre-compute aggregates (e.g., per-minute min/max) to reduce query latency and storage costs. Also, discuss how to handle late-arriving data and ensure idempotency.

1. Clarify Requirements and Scale

Ask about data retention, query patterns (real-time vs historical), latency SLAs, and consistency needs. Estimate write throughput (1M/sec) and storage (e.g., 864M readings/day × 10 bytes = ~8.6 GB/day).

2. Design Ingestion Pipeline

Use a distributed message queue (e.g., Amazon Kinesis) to handle high write throughput. Partition by sensor ID or geohash for scalability. Consider batching and compression to reduce overhead.

3. Choose Storage and Processing

For real-time heat map, use stream processing (e.g., Kinesis Analytics, Flink) to aggregate data into time windows and update a cache (e.g., Redis) or serving DB. For historical queries, store raw data in a time-series database (e.g., Amazon Timestream) or a columnar store (e.g., Parquet on S3) with pre-aggregated tables for min/max/current.

4. Design Serving Layer

For heat map, serve aggregated data from a low-latency store (e.g., Redis) via an API. For historical queries, query pre-aggregated tables or use a query engine (e.g., Athena) over S3. Ensure APIs are scalable and cacheable.

5. Address Trade-offs and Reliability

Discuss trade-offs: consistency vs availability, cost vs latency, and complexity. Plan for fault tolerance, data durability, and handling late/out-of-order data (e.g., watermarks).

Key Points to Mention

  • Partitioning strategy (e.g., by sensor ID or geohash) to distribute load and enable parallel processing.
  • Use of stream processing for real-time aggregation and windowing (e.g., tumbling windows for heat map).
  • Storage optimization: time-series database for raw data, pre-aggregated tables for min/max/current, and compression.
  • Caching layer (e.g., Redis) for low-latency heat map serving.
  • Handling late-arriving data and ensuring exactly-once semantics or idempotent writes.
  • Cost and scalability considerations: using managed services (Kinesis, Timestream) vs self-managed, and auto-scaling.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.