ProblemWeb apps and media
File sync
Keep a folder the same on every device someone owns, even when they edit it offline.
The brief
Cloud drive · suggested for Senior
Design a file sync service
Design a file sync service: people keep a folder in sync across their laptops, phones and the web, edit offline, share folders with others, and get back old versions and deleted files.
People install the app on their laptop, phone and tablet, and anything they save in the synced folder shows up on their other devices within seconds. They often work offline, on flights and trains, and expect everything to catch up when they reconnect, without ever losing an edit. Files range from tiny notes to 50 GB video projects. People share folders with teammates and family, choose who can view or edit, and sometimes remove people. They can see earlier versions of a file and restore one, and get back files they deleted within 30 days. The service is global and large: hundreds of millions of accounts and a billion file saves a day. Design the service, from a save on one device to the change appearing on the others.
Functional requirements
- CorePeople install the app on several devices, and a file saved in the synced folder appears on their other devices.
- CorePeople can edit files offline; the changes sync when the device reconnects.
- CorePeople can browse, upload and download files on the web.
- CorePeople can see earlier versions of a file and restore one, and restore deleted files, for 30 days.
- CorePeople can share a folder with others as viewers or editors, and remove them.
Non-functional requirements
- ConsistencyNo edit is ever silently lost: if two devices change the same file before either has synced, both versions survive and the person can see that it happened.
- LatencyChanges reach a person's online devices within a few seconds.
- QualityA device that was offline for weeks catches up without downloading everything again.
- QualityA small edit to a big file, or a dropped connection, never sends the whole file again.
- DurabilityOnce a save is confirmed, it is never lost.
- AvailabilityThe service stays available (99.99%), even while a whole region is down.
- SecurityOnly the people a folder is shared with can see it; removing someone stops their new changes at once and their downloads within a minute.
- CostStorage and bandwidth are the biggest costs; keep them in check as storage and the number of people grow.
Scale
- ScaleAbout 500 million accounts; about 100 million people active a day, with about 3 devices each.
- ScaleAbout 1 billion file saves a day, most of them small; files up to 50 GB.
- ScaleAbout an exabyte stored.
- ScaleShared folders with up to millions of files and hundreds of members.
Nice to mention (below the line)
- Below the lineSharing a link to a single file.
- Below the lineSearching file names.
- Below the lineComments on files.
Out of scope
- Out of scopeSeveral people typing in the same document at once (live co-editing).
- Out of scopeFull-text search inside files, previews and thumbnails.
- Out of scopeEnd-to-end encryption.
- Out of scopeSign-up, plans and billing.
The variant
One fully specified brief, with the level it suits best. You can practise it at any level.
- Cloud driveSuggested for Senior
Keep a folder in sync across laptops, phones and the web for hundreds of millions of people, with offline edits, shared folders and 30 days of history.
9 steps · 6 must-pass · about 51 min at Senior
What each level is graded on
Cloud drive, step by step. A result at a level needs its must-pass steps answered, and only the steps you answer count. Going up a level adds steps or holds them to a stricter bar.
| Step | Entry level | Mid-level | Your levelSenior | Staff |
|---|---|---|---|---|
| The numbers that shape the design (optional) | Graded | Graded | Graded | Graded |
| Files, folders, versions and shares | Graded | Graded | Graded | Graded |
| The API for the app and the web | Graded | Graded | Graded | Graded |
| Save on the laptop, open on the phone | Must-pass | Must-pass | Must-pass | Must-pass |
| Every device up to date | Must-pass | Must-pass | Must-pass | Must-pass |
| Two devices, one file | Must-passcan block | Must-passcan block | Must-passcan block | Must-passcan block |
| Undo, restore and delete | — | Must-pass | Must-pass | Must-pass |
| A folder shared with a team | — | Must-pass | Must-pass | Must-pass |
| Huge folders and bursts of tiny files | — | — | Must-pass | Must-pass |
| A region goes down, then comes back | — | — | — | Must-pass |
| At this level | 6 steps 3 must-pass about 32 min | 8 steps 5 must-pass about 44 min | 9 steps 6 must-pass about 51 min | 10 steps 7 must-pass about 59 min |
Entry level6 steps · 3 must-pass · about 32 min
- The numbers that shape the design (optional)Graded
- Files, folders, versions and sharesGraded
- The API for the app and the webGraded
- Save on the laptop, open on the phoneMust-pass
- Every device up to dateMust-pass
- Two devices, one fileMust-passcan block
Mid-level8 steps · 5 must-pass · about 44 min
- The numbers that shape the design (optional)Graded
- Files, folders, versions and sharesGraded
- The API for the app and the webGraded
- Save on the laptop, open on the phoneMust-pass
- Every device up to dateMust-pass
- Two devices, one fileMust-passcan block
- Undo, restore and deleteMust-pass
- A folder shared with a teamMust-pass
SeniorYour level9 steps · 6 must-pass · about 51 min
- The numbers that shape the design (optional)Graded
- Files, folders, versions and sharesGraded
- The API for the app and the webGraded
- Save on the laptop, open on the phoneMust-pass
- Every device up to dateMust-pass
- Two devices, one fileMust-passcan block
- Undo, restore and deleteMust-pass
- A folder shared with a teamMust-pass
- Huge folders and bursts of tiny filesMust-pass
Staff10 steps · 7 must-pass · about 59 min
- The numbers that shape the design (optional)Graded
- Files, folders, versions and sharesGraded
- The API for the app and the webGraded
- Save on the laptop, open on the phoneMust-pass
- Every device up to dateMust-pass
- Two devices, one fileMust-passcan block
- Undo, restore and deleteMust-pass
- A folder shared with a teamMust-pass
- Huge folders and bursts of tiny filesMust-pass
- A region goes down, then comes backMust-pass
- Must-pass
- a result at that level needs this step answered.
- Can block
- a miss there is a Blocking issue at that level.
Going up a level
- Mid-level
- “Save on the laptop, open on the phone” is graded more strictly.Adds “Undo, restore and delete”, must-pass.Adds “A folder shared with a team”, must-pass.
- Senior
- “Undo, restore and delete” is graded more strictly.“A folder shared with a team” is graded more strictly.Adds “Huge folders and bursts of tiny files”, must-pass.
- Staff
- Adds “A region goes down, then comes back”, must-pass.
Skills this problem practises
Your coach tracks readiness per skill across every problem you practise. Each links to the lesson that teaches it.
- Capacity estimation
- API design
- Idempotency and retries
- Data modelling
- Choosing storage
- High-level architecture
- Queues and async messaging
- Networking and protocols
- Traffic surges and backpressure
- Consistency and concurrency
- Replication and durability
- Observability and operations
Worked solution
Try it first: practise a variant, then read the walkthrough and compare it with your own design. Reading it first makes the practice much less useful.
Learn: Design DropboxYour history
Sign in to see your sessions on this problem.