Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Offline-Capable IoT Log Platform

Design reliable offline device log collection, targeted capture requests, reconnect-storm ingestion, and late-corrected metrics.

Problem statement

For this exercise, assume a multi-tenant platform serves a large fleet of intermittently connected devices.

Each device records typed success or failure log records while online or offline, assigns every record a stable identity and monotonic device sequence, and retries immutable batches until the platform returns a durable per-record outcome. Replayed records must not change stored results or metrics twice.

An authorized operator can issue an expiring capture request to an immutable set of devices, naming the log type to record. Each request has a stable request ID; devices may receive it while connected or after reconnect, report their request state, and attach the request ID to resulting records.

Delivery alone is not proof that a device activated the request.

The platform stores accepted logs, reports success and failure counts by log type and event-time window, exposes provisional results within five minutes, accepts records up to twenty-four hours late, and assigns a monotonically increasing revision whenever late data changes a window.

Assume ten million registered devices, one million normally connected devices, a peak of 200,000 records per second, and a reconnect surge of one million records per second for fifteen minutes. Raw logs remain in hot storage for seven days and archive storage for ninety days.

Every device, operator, request, and query is authenticated and isolated to one tenant. Design the offline upload, capture-request delivery, reliable storage, aggregation, query, overload, and recovery paths.

Device firmware, power control, arbitrary full-text log search, alerting, and remote execution of general commands are outside scope.

What to build

  1. A device can upload an immutable batch of locally buffered logs and receive durable accepted, duplicate, invalid, too-late, or retryable outcomes for every record.
  2. An authorized operator can issue and inspect an expiring capture request for an immutable device set, while devices retrieve, deduplicate, acknowledge, and correlate resulting logs to that request.
  3. An authorized operator can query revisioned success and failure counts by log type and event-time window with explicit freshness and late-data status.
  4. Operators can inspect batch progress, request progress, processing lag, rejected data, and reconnect-storm throttling without a delivery or gateway acknowledgement being misreported as device activation.

At scale

  • For this exercise, assume ten million registered devices, one million normally connected devices, and a normal peak of 200,000 accepted log records per second.
  • For this exercise, absorb a reconnect surge of one million records per second for fifteen minutes with explicit admission control and without losing a durably accepted record.
  • For this exercise, expose provisional event-time metrics within five minutes, accept records up to twenty-four hours late, and publish a new revision when late data changes a window.
  • For this exercise, keep raw logs in hot storage for seven days and archive storage for ninety days, while preserving tenant isolation and idempotency identity for the full retention period.