The interview problem
Keep configuration consistent across a user's phones, tablets and desktop clients. Devices may be offline for a week. Concurrent edits, duplicate notifications and incompatible client versions must not silently corrupt settings.
Candidate-reported topic adaptation: an anonymous Amazon SDE II account labels its interview August 2026 and describes configuration synchronization. The detailed prompt and requirements here are invented for practice; the publication date was not visible. Retrieved and reviewed September 26, 2026.
1. Define what synchronization promises
Ask whether configuration means account preferences, device-local settings, or commands that trigger actions. Assume account preferences converge after reconnection, while brightness and hardware-specific settings stay local. Exclude payments, door unlocks and other one-time actions: replaying state is not the same contract as executing a command exactly once.
Use a server-authoritative revision for each account configuration. Connected devices should learn updates within an illustrative five seconds; offline devices have no real-time guarantee. Spend 5 interview minutes on ownership and conflicts, 10 on data/API design, 10 on reconnects, 10 on failures and 10 on capacity and alternatives.
2. Store intent and observed application separately
Clients send PATCH /accounts/{id}/configuration with an expected revision, an operation ID and typed field changes. Authenticate account membership and validate the schema. In one transaction, deduplicate the operation, compare the revision, apply valid changes, increment the revision and write an outbox event. A stale edit gets a conflict response with a fresh snapshot; it must not silently overwrite intervening edits.
The outbox feeds a notification service partitioned by account ID. Notifications identify a new revision and prompt clients to fetch state; they are hints, not the only durable copy. Keep the current snapshot and a bounded change history in storage. Store each device's last applied revision, software/schema version, last contact and any application error. A successful server write means intent is saved, not that every device has applied it.
Logical flow: client edit → authenticated state transaction → outbox → notifications → device reconciliation → applied-state report. The durable snapshot remains authoritative if the notification layer is unavailable. Use HTTP conditional updates with ETags where appropriate; application-level operation IDs handle a successful write whose response is lost.
3. Make offline conflict behavior visible
Device A changes language at revision 10; device B, still on revision 10, changes a notification preference. A commits revision 11. B receives a conflict and may automatically rebase only if the server can prove its touched fields have not changed since revision 10. Otherwise show the difference and ask for a choice. For the baseline, rejecting the entire stale patch is simpler and safe.
If both devices change language, define an explicit conflict policy rather than trusting device clocks. Server arrival order can choose a winner but may surprise an offline user; field-level merges improve usability only for independent fields. Coupled values, such as a start and end time, need validation together. Deletions need tombstones or a fresh full snapshot, so a long-offline device cannot resurrect removed fields.
On reconnect, subscribe and fetch current state with reconciliation that tolerates overlap. Ignore already-applied revisions; if a delta has a gap or history expired, fetch a snapshot. Apply a validated snapshot atomically on the device, then report its revision. An old client that cannot represent a field should preserve it server-side and report incompatibility rather than wiping it during a full-document upload.
4. Quantify fan-out and recovery bursts
Assume 10 million accounts, four devices each, two configuration updates per account per day and a 2 KB average update payload. Average writes are 20 million / 86,400 ≈ 231 per second. Notifying four devices produces about 926 deliveries per second on average and 160 GB/day of payload if every delivery includes 2 KB. Protocol overhead, retries and replication are additional.
A synchronized ten-minute reconnect wave from 10 million devices creates roughly 16,667 snapshot requests per second. At 10 KB each that is about 167 MB/s of payload. This burst can dominate ordinary updates. Jitter reconnects, enforce per-account/device limits, cache immutable snapshots by revision and permit conditional reads. Protect the state database with admission limits rather than letting reconnect storms consume every connection.
5. Handle stale reports and region outages
Duplicate outbox delivery is harmless when clients reconcile by revision. An acknowledgement for revision 11 arriving after revision 12 must not move the device status backward. If applying revision 12 fails locally, retain revision 11, record the reason and surface degraded convergence. Monitor the age of unapplied desired state, not just message delivery rates.
For a regional partition, choose a single writer for an account and reject or queue edits when its authoritative writer is unavailable. Automatic failover needs a fenced writer generation to prevent both regions accepting conflicting revisions. If global write availability is required, revisit the conflict model instead of pretending a revision counter is globally serialized. Revoked devices must lose read/write access and notification subscriptions; cached offline data cannot be retroactively erased by a server guarantee.
6. Trade-offs and self-review
Polling is easy to operate but wastes reads and delays convergence. Push reduces typical delay but still needs periodic reconciliation. Per-account snapshots simplify correctness; a CRDT may suit a collaborative set but is unnecessary for most typed settings and does not solve authorization or invalid combinations.
Foundation: distinguish saved from applied. Senior: explain concurrent offline edits and a lost write response. Staff: choose availability versus consistency during regional failover. Score 0–2 each for state ownership, concurrency control, reconnect repair, schema evolution and burst handling. Full marks require a mechanism and a stated limitation. Continue with reliable notifications.
Recover a device that skipped revisions
Additional original practice exercise · October 3, 2026. Numbers are illustrative assumptions.
A device has applied revision 20. Notifications for revisions 22 and 21 arrive in that order, then notification 22 arrives again. Treat them as hints to reconcile, not commands to apply blindly. Fetch a current snapshot, validate its schema, apply atomically, and acknowledge only the revision actually installed. If a snapshot fetch returns revision 23, acknowledging 22 would misreport device state.
Suppose revision 23 adds a field unsupported by this client. Preserve server state and report the unsupported configuration rather than uploading a truncated document. Define whether supported fields may apply independently; coupled settings need all-or-nothing validation. A later revision-20 acknowledgment cannot lower the recorded high-water mark.
Practice: reboot between applying the snapshot and sending its acknowledgment. Persist the local applied revision with the configuration so reconciliation can safely report success after restart. A server-side acceptance response remains distinct from evidence of local application.
Related practice: Design a lease service with fencing tokens · Design a tamper-evident audit log
Sources and next steps
- Amazon candidate account: August 2026 SDE II
- AWS IoT: desired/reported state and version conflicts
- RFC 9110: HTTP conditional requests
The scenario, proposed solution, calculations and rubric are original educational material. References support the reported topic or technical concepts, not an employer-approved answer.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.