Skip to content
We areTOP 1%

Design a distributed file storage service like Dropbox or Google Drive

HardConceptMedia & Commerce
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Requirements: users upload and download files of any size, changes sync automatically across devices, files are versioned and shareable, and data is never lost.

  • Chunking: the client splits each file into blocks of a few megabytes and hashes them; only new or changed blocks are uploaded, which enables resumable uploads and deduplication.
  • Block storage: blocks are kept in durable object storage, addressed by their hash.
  • Metadata service: a strongly consistent database records files, folders, versions and the ordered list of block hashes for each version.
  • Sync: a notification service informs other devices of changes over long polling or WebSockets; they fetch the new metadata and any missing blocks. Concurrent edits produce a conflicted copy.
  • Trade-off: smaller blocks improve deduplication and delta sync but increase metadata size and request count.

More in Media & Commerce

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account