KatInterview

Real-Time IoT Device Monitoring System

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsreal-timeiot

Last updated

Build a scalable backend to track health status for millions of IoT devices sending periodic check-ins and quickly identify unresponsive units.

Real-Time IoT Device Monitoring System

You need to architect a backend that tracks the operational status of a large fleet of IoT devices. Specifically, your system monitors 1,000,000 devices that each transmit a lightweight status ping containing their unique identifier and a timestamp every 10 seconds. Your platform must provide real-time visibility into which devices are currently unresponsive—defined as those that haven't transmitted any signal within the past 60 seconds.

What You Need to Support

Core Functionality:

  1. Accept and process status pings from the entire device fleet
  2. Provide an API endpoint GET /devices/inactive returning identifiers of all devices silent for 60+ seconds

Performance and Scale:

  1. Support approximately 100,000 incoming status messages per second under normal operation
  2. Inactive device status should reflect reality within a few seconds
  3. Handle sudden traffic surges gracefully (network reconnections, regional outages recovering)

What to Deliver

Describe your approach to:

  • How you'll receive, process, and store the incoming status signals
  • Your strategy for identifying inactive devices efficiently at query time without iterating through millions of records
  • How you'll manage data lifecycle and address potential performance bottlenecks

Hints

Hint 1

Think about whether you need to store every individual status ping or just maintain current state

Hint 2

Consider how devices report to you versus how you detect silence—one is event-driven, the other requires periodic evaluation

Hint 3

Ask yourself if the inactive device list should be computed on-demand for each API request or maintained continuously