Design a Dropbox-like file storage and sync service
MetaSoftware Engineer · OnsiteLast updated
Design a Dropbox-like file storage and sync service evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Question
Design a cloud file storage and synchronization service like Dropbox / Google Drive. The system should let users store files and folders, keep them in sync across multiple devices, share them, and recover previous versions — at internet scale (hundreds of millions of users).
Work through the following:
- Core sync — Upload/download files and folders; client-side folder monitoring (inotify/FSEvents/ReadDirectoryChangesW); propagate changes across all of a user's devices.
- Large-file handling — Chunked, resumable uploads/downloads; delta sync so an edit only transfers the changed bytes; deduplication and compression.
- Versioning & restore — Per-file version history, tombstones for deletes, and the ability to restore or undelete.
- Conflict resolution — Detect and resolve concurrent edits from multiple devices (including offline edits replayed on reconnect).
- Offline support — Offline-first client with a local index and a write-ahead journal of pending operations.
- Sharing & permissions — Share folders/files with specific users or groups, and via capability/share links with scope and expiry; ACLs with inheritance.
- Change notification — Push change events to devices in near real time (APNs/FCM/WebPush) with long-poll/WebSocket fallback.
- Encryption — In transit and at rest; discuss server-side encryption (SSE) vs. client-side / end-to-end encryption (CSE) and the dedup trade-offs of each.
- Mobile constraints — Battery-, network-, and background-execution-aware scheduling; selective / on-demand sync.
- Quota & billing — Logical vs. billed (post-dedup/compression) bytes, enforcement, and usage accounting.
- Architecture & data model — Clients and sync engine, metadata service, blob/object storage and CDN; model files, chunks, versions, ACLs, tombstones, and a change journal.
- Consistency model — What guarantees do readers and writers get within and across devices?
- Scale & operations — Sharding/partitioning, hotspots, observability, disaster recovery, and online migrations/backfills (e.g., changing chunk size or rotating crypto keys).
Out of scope: real-time collaborative editing (Google Docs / OT/CRDT co-editing).
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.