← Verkada Interview InsightsSoftware Engineer

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

SeniorPrefer not to say
May 2026

Summary

Verkada system design round, one meaty question that took up the whole session. The scope was bigger than I expected and I don't think I covered everything cleanly.

Questions Asked (1)

Q1

Design a system that handles 1 million devices each sending a heartbeat every minute, where each heartbeat carries one of 10 possible status values. The system needs to compute per-status device counts in real time for the previous minute window. Walk through ingestion, time bucketing, sharding, the aggregation pipeline, state storage with TTL, fault tolerance, and how you handle late or duplicate events, plus how you serve the counts with low latency.

System DesignTechnical Trade-offsData Modeling
Author's notes

This one sprawled.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (1M devices/min ≈ 16.7K events/sec, 10 statuses, 1-minute window). Then walk through a streaming pipeline: ingestion via a scalable message queue, time-bucketing with event-time windows, sharding by device ID for parallelism, aggregation using a distributed stream processor, state storage with TTL, and serving counts from a low-latency store. Address fault tolerance, late/duplicate events, and trade-offs (e.g., exactly-once vs at-least-once, push vs pull).

Pro tip: Emphasize that the system should be designed for horizontal scalability and that you'd validate assumptions with back-of-the-envelope calculations; also mention that you'd start with a simple solution and iterate, showing pragmatism.

1. Clarify Requirements and Scale

Ask questions to confirm: 1M devices, 1 heartbeat/min, 10 statuses, real-time counts for previous minute. Calculate QPS (~16.7K/s) and data volume to inform design.

2. Design Ingestion and Sharding

Use a scalable message queue (e.g., Kafka) partitioned by device ID to distribute load. Ensure ingestion can handle bursts and is fault-tolerant with replication.

3. Implement Time Bucketing and Aggregation

Use a stream processor (e.g., Flink, Spark Streaming) to window events into 1-minute buckets based on event time. Aggregate counts per status using incremental updates.

4. Manage State, TTL, and Fault Tolerance

Store windowed counts in a distributed store (e.g., Redis, Cassandra) with TTL to expire old windows. Use checkpointing and idempotent updates to handle failures and duplicates.

5. Serve Counts with Low Latency

Expose an API that reads the latest counts from the store. Use caching and pre-computation to ensure sub-second response times.

Key Points to Mention

  • Event-time vs processing-time windows and handling late events with watermarks or allowed lateness.
  • Idempotent processing and deduplication using unique event IDs or device ID + timestamp.
  • Sharding strategy: partition by device ID to ensure even load and scalability.
  • State storage with TTL: use Redis with expiry or a time-series database to automatically purge old data.
  • Fault tolerance: replication, checkpointing, and exactly-once semantics in stream processing.
  • Low-latency serving: pre-aggregate counts and use in-memory stores; consider push-based updates to clients.

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