61. Design a Collaborative Editor like Google Docs
A hundred people typing in one document, every copy converging, nothing acknowledged lost: one owner per document, an op log with snapshots, and fenced failover.
Pick a system. Work through the problem. Compare your approach.
Company tags are community-reported. Counts on cards show how many people reported that design.
A hundred people typing in one document, every copy converging, nothing acknowledged lost: one owner per document, an op log with snapshots, and fenced failover.
Sell 10,000 units to a million people at noon with a lottery waiting room, a Redis gate before an Aurora ledger and holds that expire.
Every goal on 25 million open apps within two seconds: SSE or WebSockets, pub/sub to the right server, resume by seq, hot topics, reconnect storms and push.
Design for contention through a limited sneaker drop: row locks, conditional writes, expiring holds, fencing tokens, sagas and one writer per item.
An order checkout across payment, inventory and shipping, run as a saga.
Serve a product page a million times a second: a cheap query, replicas, Redis and the edge, with hot keys, stampedes and invalidation handled.
A live TV vote at a million writes a second: spread by key, buffer in Kafka, aggregate the hot counter in two stages, shed what can wait.
Files up to 50 GB up and down without a byte through the API: presigned URLs, resumable multipart, S3 events, scanning and CloudFront.
Accept in milliseconds, work in the background: leases and heartbeats, retries and dead letters, progress by SSE and webhooks, fairness across tenants.
An in-memory data store like Redis, from one event loop to Redis Cluster to a durable platform.
Search a billion documents in 200 ms: inverted indexes, analysers, Lucene segments, shards and replicas, query then fetch with BM25, fed by CDC.
A partitioned, replicated append-only log: a million messages a second, order per key, nothing acknowledged ever lost, a week of replayable history.
Workflows as code that survive any crash: event histories and replay, activities retried under timeouts, durable timers, sharded history.
A leaderless wide-column store: a token ring with virtual nodes, consistency tuned per query, an LSM write path and repair that keeps replicas converged.
A key-value store like DynamoDB, from one durable node to Paxos-replicated partitions to global tables run for thousands of tenants.
A relational database like PostgreSQL: WAL and MVCC on one server, quorum replication and failover, then a sharded fleet.
A stateful stream processor: dataflow graphs, keyed state in RocksDB, event time and watermarks, windows, barrier checkpoints, exactly-once into Kafka.
A coordination service like ZooKeeper: znodes, sessions and watches, a ZAB quorum of five with observers, and the recipes for elections and locks.
An S3-inspired object store: bytes before metadata, a partitioned namespace with cache coherence, then repair, heat, lifecycle and safe change. Three interview boards with explicit assumptions and AWS source boundaries.
Build a queue around visibility leases and explicit acknowledgement, then add replicated partitions, FIFO groups, tenant fairness and bounded redrive: three self-contained interview boards.
Radius, k-nearest and map-box search over places that rarely move and drivers that ping every few seconds: R-trees, geohash, H3 and S2 cells, Redis GEO and OpenSearch. One-hour boards for junior, senior and staff, with the theory.
Unique visitors, top pages, seen URLs and p99 latency over 10 B events a day with HyperLogLog, Count-Min, Bloom filters and t-digests.
Nearest-neighbour search over a billion embeddings: HNSW, IVF-PQ and disk graphs, filters, segments, sharding, and hybrid search with re-ranking.
The database under a metrics platform: a WAL and head block, compressed chunks, a label index, rollups, compaction and blocks in S3.
Every committed change in Aurora and DynamoDB, read from the log and delivered in order per row to search, caches, Redshift and an S3 lake.
Deny requests by caller address, range or URL at a global edge, with lists from governments, threat feeds and detection reaching 300 proxies in seconds.
Nights as counted inventory, holds that never double-book, search that knows availability, and payments that reconcile.
Dish reviews only from customers who ordered them, votes counted from a change stream, reviews ranked by the Wilson bound, payouts made exactly once.
Ten charities, three days, $100 M: charge through a third-party processor exactly once, queue the broadcast spikes, keep live totals on sharded counters. One-hour boards for junior, senior and staff, with the theory behind them.
Buy the cheapest offer under a maximum price from 1,000 sellers: cached offers, coalesced quotes, a hold-order-capture saga, open requests.