Design Shared To-Do List Synchronization
Synchronize permissioned task changes across concurrent and reconnecting devices without losing accepted edits.
Problem statement
For this exercise, assume an authenticated user creates a shared to-do list and invites members as editors or viewers. Editors can add tasks, change task fields, and complete tasks; all members can observe permitted changes across their devices.
A list supports up to 100 members, 10,000 tasks, and bursts of 500 connected sessions. Accepted changes receive a monotonically increasing server revision and should reach connected clients within one second.
Preserve concurrent edits to different task fields; changes to the same field resolve by one deterministic server order. A device may edit offline for up to 24 hours and later reconnect using its last observed revision plus a client-generated operation ID for every pending change.
Every read, mutation, and synchronization subscription must enforce current membership. Design the data model, APIs, synchronization paths, conflict semantics, and recovery behavior.
What to build
- Let a list owner invite editors or viewers and enforce current membership on list reads, writes, and live subscriptions.
- Let editors add tasks, update task fields, and mark tasks complete using idempotent client operation identities.
- Deliver accepted task changes to connected permitted clients within the target delay and in recoverable server-revision order.
- Let a device reconnect after up to 24 hours, recover missed changes, submit pending operations safely, and converge under the stated field-conflict policy.
At scale
- One list may contain up to 10,000 tasks and 100 members, with bursts of 500 simultaneously connected device sessions.
- A connected client should observe accepted list changes within one second under normal operation.
- Devices may be offline for up to 24 hours and reconnect with a last-seen server revision plus stable client operation IDs.
- Accepted changes are durably ordered by server revision; unrelated field edits survive, while same-field conflicts resolve by that deterministic order.