Design two backend systems.
Part A: Door access control system
Design a service that manages which people can open which doors. The system must support:
-
Given a person ID, list all doors that person can open.
-
Given a door ID, list all people who can open that door.
-
As an administrator, grant a person access to a door.
Discuss the data model, API design, indexing strategy, authorization rules, and how you would handle auditability and future operations such as revoking access.
Part B: Device heartbeat monitoring system
Design a simple system for 10 million devices, where each device sends a heartbeat once per minute. Build a dashboard that shows device health and online status.
Discuss:
-
Expected write throughput
-
Ingestion architecture
-
Storage design for recent status and historical heartbeats
-
How to determine whether a device is online or offline
-
Dashboard APIs and useful metrics
-
Reliability, scaling, and failure handling