Lesson 2 of 16
39. Design File Storage and Sync (Google Drive / Dropbox)

39.1 What do you ask first?

3 min read+10 XP

Step 1: Requirements (5 minutes)

LetterCandidate asksInterviewer answers
Scope"Upload, download, sync across devices? Sharing? Version history? Real-time co-editing like Google Docs? Max file size?""Upload, download, sync, sharing with other users, 30 days of version history. No co-editing. Files up to 50 GB."
Count"How many users, how much data each?""100 million users, about 20 GB each on average."
Access pattern"How much changes a day?""A typical user changes a couple of files a day, around 1 MB each, but some upload big videos."
Latency"How soon must a change appear on other devices?""Within seconds to a minute."
Exactness"Can we ever lose a file or silently overwrite an edit?""Never."

Agreed requirements:

  • Functional (verbs): upload and download files; sync changes to all of a user's devices; share files and folders; keep version history; resume interrupted transfers.
  • Non-functional (adjectives): durable (never lose data; Chapter 11's eleven nines), consistent metadata (no silent overwrites), efficient (upload only what changed, store duplicates once), fast sync (seconds to a minute), scalable to exabytes, secure (access control on every byte).

Interviewer pushback:

  • "Why does 'never silently overwrite' matter so much?" → Two devices editing the same file offline is normal (a laptop on a flight, a phone in a tunnel). The system must detect it and keep both, not let the last upload win quietly (39.8).

Memory code: "Ask about size, sync speed, sharing, history, and what happens when two devices disagree."