Design Power-Grid Device Monitoring over Unreliable Networks: Dedup and Late Events
OpenAISoftware Engineer · OnsiteLast updated
Design a monitoring platform for power-grid devices that report readings and upload logs over unreliable public networks. Ingestion must be idempotent, deduplicate retransmissions, handle out-of-order and late events and accept batched uploads. It tests IoT ingestion, event-time processing and resilience to reconnect storms.
Design a monitoring platform for devices deployed across a power grid, such as meters and sensors at substations and along lines. Each device periodically reports measurements (for example power consumption and voltage) and uploads its logs. Devices reach the platform over the public internet on unreliable networks: connections drop, messages are retried, and devices can be offline for hours before reconnecting.
The design must make ingestion idempotent, deduplicate repeated data, handle out-of-order events correctly, and support batched log uploads from devices, while giving operators dashboards and alerts about device and grid health.
Clarifying Questions
- How many devices, how often do they report, and how large are their logs?
- How fresh must alerts be, for example for a device reporting a dangerous voltage?
- How much can devices store locally while offline, and can their firmware be updated?
- Are device clocks synchronized, and how far can they drift?
- What are the security requirements: device identity, and protection against spoofed readings?
- How long must raw readings and logs be retained?
Hints
Hint 1
Let the device name its data: Consider what identifier a device can attach to every reading so that the server can recognize a retransmission no matter how many times, or how late, it arrives.
Hint 2
Two clocks: Every event has the time it was measured and the time it arrived, and on this network they can be hours apart; decide which one each computation and alert should use.
Follow-up questions
- After a regional outage, a million devices reconnect within the same minute. What happens, and how do you prevent it from overwhelming the platform?
- A device's clock jumps by a year. How do you detect it and limit the damage?
- How would you push configuration or firmware updates to devices safely over the same unreliable network?
- Operators need an alert within 30 seconds when a substation's readings exceed a threshold. How does that path differ from the bulk ingestion path?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.