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

Score yourself

3 min read+10 XP

Score yourself

Give yourself 0, 1 or 2 points per row.

Area0 points1 point2 points
RequirementsStarted drawingUpload and downloadSync, sharing, history, big files and conflicts agreed
EstimatesNoneNumbers, not used laterExabytes → object storage, rows → sharded metadata, bandwidth → direct uploads
API and dataSkippedUpload API onlyCheck-missing, presigned upload, commit with base version, changes cursor
High-level designFiles through app serversStorage + DB, no syncUpload, commit, notify and sync walked
Deep diveHand-wavedOne topicChunking with CDC, dedupe, conflicts or metadata sharding done properly
Trade-offsNone namedNamed when askedRaised unprompted (fixed vs CDC, cross-user dedupe privacy, conflict copies)
CommunicationLong silencesMostly clearThought out loud, checked in, managed time

12 to 14: strong hire signal. 8 to 11: solid, polish the weak rows. Under 8: redo the round in a week, timer on.

The bar: fresher vs SDE-2

FresherSDE-2
StorageFiles in S3, paths in a DBContent-addressed blocks, file = list of hashes, versions for free
TransferUpload the whole fileUpload only missing blocks, resumable, presigned and multipart
SyncPoll for changesJournal + cursor per device, long-poll notifications
ConflictsLast write winsCompare-and-set on base version, conflicted copies
ScaleOne databaseSharded by namespace, hot folders, GC of unreferenced blocks

Common mistakes

  • Streaming file bytes through the app servers.
  • Re-uploading whole files for small edits.
  • Last write wins, silently losing an offline edit.
  • Polling every device every few seconds instead of notifications plus a cursor.
  • Deleting blocks still referenced by older versions or other files.

Quick check

Five questions on this chapter. Pick an answer, then check it.

quiz