← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 047 · Distributed systems

Design a File Sync Service

Medium 60 min

Design a Dropbox-style service. A desktop client watches a folder and uploads changes; other devices of the same user download them within seconds. There are 50 million users with 2 billion files, most under 1 MB but some over 10 GB. On a busy weekday clients make about 15,000 metadata requests per second (listing changes, committing new versions) and upload about 1 GB per second of changed data. Large files that change slightly, such as a 2 GB video project, must not be re-uploaded in full. Two devices editing the same file offline must never silently overwrite each other's work.

Functional requirements

  • Upload, download and delete files and folders from any device
  • Notify a user's other devices of changes within seconds
  • Upload only the changed parts of large files and resume interrupted transfers
  • Keep previous versions for 30 days and allow restore
  • Detect conflicting edits and keep both copies

Non-functional requirements

  • Changes reach other online devices within 10 seconds
  • Once a commit is acknowledged, the file is never lost (11 nines of durability)
  • Metadata operations return in under 500 ms at p95
  • Storage cost is reduced by de-duplicating identical content

Constraints and scale

  • 50 million users, 2 billion files, about 5 PB of stored content
  • 15,000 metadata requests per second at peak
  • About 1 GB per second of uploaded changes at peak

You will practise

  • Split files into content-addressed chunks to enable delta sync and de-duplication
  • Separate metadata (versions, folders) from blob storage
  • Push change notifications and resolve concurrent edits with version checks
Show 3 hints
  1. If files are cut into 4 MB chunks named by their hash, what happens when two users upload the same video?
  2. How does a device know which version it last saw, and how does the server reject a stale commit?
  3. Should file bytes flow through your API servers at all?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • Two offline edits to the same fileA user edits a spreadsheet on a laptop during a flight while a colleague edits the shared copy at the office. The laptop reconnects and tries to upload its version.

Run them from the workspace once your design is in place.