← Verkada Inc. Interview Insights
Start by clarifying requirements and scale (10M devices, 1 heartbeat/min = ~167K QPS). Then propose a horizontally scalable ingestion pipeline (e.g., Kafka) and a stateful processing layer (e.g., Flink) that maintains per-device last-seen timestamps and emits health status changes. Finally, discuss storage for real-time counts and trade-offs around windowing, fault tolerance, and cost.
Pro tip: Emphasize that you would avoid per-heartbeat database writes by using an in-memory state store with periodic checkpoints, and that you would shard devices to distribute load evenly. This shows you understand both scalability and operational cost.
Ask about expected latency for health status updates, acceptable false positives/negatives, and whether historical data is needed. Confirm the scale: 10M devices, 1 heartbeat/min = ~167K writes/sec.
Propose a distributed message queue (e.g., Kafka) to absorb the heartbeat stream, with partitioning by device ID to ensure ordered processing per device. Mention the need for backpressure and replication.
Use a stream processor (e.g., Flink) with keyed state to track last heartbeat time per device. Implement a sliding window or timer to detect missed heartbeats (e.g., if no heartbeat in 2 minutes, mark unhealthy). Emit state change events.
Store health status in a fast key-value store (e.g., Redis) for real-time counts, and optionally in a time-series DB for analytics. Use a separate service to aggregate counts and expose an API for near real-time dashboards.
Discuss trade-offs: exactly-once vs at-least-once processing, window size vs detection latency, and cost of state storage. Explain how to handle node failures, rebalancing, and recovery from checkpoints.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.