System Design Foundations
A repeatable six-step interview framework and the ten building blocks every large system is made of.
The six-step framework
Clarify requirements
Functional scope (the 3–4 core use cases) and non-functional targets: scale, latency, availability, consistency, durability. Write them down; they drive every later trade-off.
Estimate the envelope
DAU → QPS (avg and peak), read/write ratio, storage per year, bandwidth. Round aggressively; you are looking for orders of magnitude that rule designs in or out.
Define the API & data model
Name the endpoints or events and the core entities with their keys. The access pattern decides the store: key-value, wide-column, relational, search or blob.
Sketch the high-level design
Clients → edge (CDN, LB, gateway) → stateless services → caches, queues, stores. Walk one read and one write end to end.
Deep-dive the hard parts
Pick the 2–3 components that break first at scale: hot keys, fan-out, consistency of money, ordering, exactly-once. Compare two options and choose with reasons.
Harden & evolve
Failure modes, multi-region, observability, back-pressure, security and cost. Say what you would build first and what you would defer.
Building blocks
Load balancer & API gateway
Spread traffic, terminate TLS, authenticate, rate-limit and route.
Watch: L4 vs L7, sticky sessions, health checks.CDN & edge cache
Serve static and cacheable content close to users.
Watch: Cache keys, invalidation, signed URLs.Cache (Redis / Memcached)
Absorb read load and cut latency for hot data.
Watch: Cache-aside vs write-through, stampedes, TTLs, hot keys.Message queue / log (Kafka, SQS)
Decouple producers from consumers, buffer spikes, replay events.
Watch: Ordering per partition, consumer lag, DLQs, at-least-once.Relational database
Transactions and strong invariants (orders, ledgers, inventory).
Watch: Indexes, isolation levels, read replicas, sharding keys.Wide-column / key-value store
Massive write throughput with simple access paths.
Watch: Partition key design, tunable consistency, compaction.Search index (Elasticsearch)
Full-text, faceted and geo queries.
Watch: Indexing lag, shard sizing, relevance tuning.Object storage (S3)
Blobs: media, backups, data-lake files.
Watch: Multipart upload, lifecycle tiers, eventual listing.Stream processor (Flink / Spark)
Windowed aggregation, enrichment and real-time analytics.
Watch: Watermarks, state size, checkpointing.Coordination service (etcd / ZooKeeper)
Leader election, config, locks and membership.
Watch: Keep it small; it is a consensus system, not a database.