Part 3 of 7 · 2 min read
Prompts 1-10
Files, links, notes and sync.
| # | Prompt | Level | Ask and estimate | Core idea |
|---|---|---|---|---|
| 1 | Design a paste bin: users paste text and share a link. | E | Pastes a day, size limit, expiry, read to write ratio | Short id plus object storage and a cache. Expiry by a clean-up job. |
| 2 | Design a file sync service for photos from phones. | M | Users, photos a day, photo size, devices per user | Chunking with hashes, dedupe, upload in parts, a change log per device. |
| 3 | Design a note-taking app that works offline. | M | Notes per user, devices, conflicts | Local first, a change log, merge by version or CRDT (page 8). |
| 4 | Design a link preview service (title and image for a URL). | E | Links a day, repeat rate, fetch time | Fetch in a worker queue, cache by normalised URL, limits against abuse. |
| 5 | Design a backup service for company laptops. | M | Laptops, daily change, retention | Block-level dedupe, incremental backups, encryption, restore tests. |
| 6 | Design a calendar with invitations and reminders. | M | Users, events, recurring rules | Event store with recurrence rules, time zones, reminders by scheduler (page 7). |
| 7 | Design a feature flag service. | E | Flags, clients, evaluations a second | Rules pushed to local caches in SDKs, a stream for changes, safe defaults. |
| 8 | Design an image resizing service. | E | Images, sizes, traffic | Generate on first request, cache by key in a CDN (page 5), limit sizes. |
| 9 | Design a document search for a company wiki. | M | Documents, queries, freshness | Inverted index, update by change events, permission filters. |
| 10 | Design a mobile app config and update service. | E | Devices, versions, rollout | Versioned config, staged rollout by percentage, rollback. |
What a good answer adds to the table.
- For prompts 2 and 5 (large data): calculate the data in TB a year and the bandwidth. A photo sync with 10 million users and 5 photos of 3 MB a day is 150 TB a day, so upload must be chunked and resumable.
- For prompts 3 and 6: say how time and conflicts are handled. Store time in UTC with the user's zone.
- For prompts 7 and 10: say what happens when the service is down (a safe default, and the last known config).
Check yourself: 1. In prompt 2, what does the hash of a chunk allow? 2. In prompt 7, what must clients do if the service is down? 3. Work out the data a day for prompt 2 with 4 million users, 3 photos and 4 MB.