System Design Fundamentals: Complete Guide

What Is System Design and Why Does It Matter?
System design is the process of defining the architecture, components, modules, interfaces, and data flow of a system to satisfy specified requirements. In interviews at companies like Google, Meta, and Amazon, system design rounds carry equal or greater weight than coding rounds for candidates at the senior level (L5+). According to interviewing.io data from 2025, candidates who scored "strong hire" on system design had a 73% overall offer rate, versus 41% for those with only strong coding scores.
AissenceAI provides real-time architecture suggestions during live system design interviews, generating component diagrams and trade-off analysis in 116ms.
The 8 Core Building Blocks of System Design
- Load Balancers — Distribute incoming traffic across servers. Round-robin, least-connections, and consistent hashing are the three approaches you must know. See our complete load balancing guide
- Web Servers & Application Servers — Handle HTTP requests and business logic respectively
- Databases — SQL (PostgreSQL, MySQL) vs NoSQL (MongoDB, Cassandra, DynamoDB). Read our SQL vs NoSQL comparison
- Caching Layers — Redis, Memcached for sub-millisecond reads. Details in our caching strategies guide
- Message Queues — Kafka, RabbitMQ, SQS for async processing. See message queue architecture
- CDNs — CloudFront, Cloudflare for static asset delivery and edge caching
- API Gateway — Rate limiting, auth, routing. Explore API design best practices
- Monitoring & Observability — Prometheus, Grafana, Datadog for system health
The 5-Step System Design Interview Framework
- Requirements Clarification (5 min) — Ask: What are the functional requirements? Non-functional? Expected scale?
- Back-of-Envelope Estimation (3 min) — Calculate: QPS, storage, bandwidth. Example: 100M DAU × 10 requests/day = ~12K QPS
- High-Level Design (10 min) — Draw the architecture: clients → LB → servers → cache → DB → message queue
- Detailed Design (15 min) — Deep-dive into 2-3 critical components. Discuss sharding strategies, replication, consistency models
- Bottlenecks & Trade-offs (7 min) — Identify single points of failure, discuss CAP theorem trade-offs, propose monitoring
Top 10 System Design Interview Questions
| Question | Key Components | Difficulty |
|---|---|---|
| Design a URL Shortener | Hashing, KV store, analytics | Easy |
| Design Twitter/X Feed | Fan-out, timeline service, caching | Medium |
| Design a Chat System | WebSocket, message queue, presence | Medium |
| Design YouTube | Video encoding, CDN, recommendation | Hard |
| Design Google Search | Crawling, indexing, ranking, PageRank | Hard |
| Design a Rate Limiter | Token bucket, sliding window, Redis | Medium |
| Design Uber | Location service, matching, ETA | Hard |
| Design a Key-Value Store | Consistent hashing, replication, Raft | Hard |
| Design a Notification System | Push, SMS, email, priority queue | Medium |
| Design a Web Crawler | BFS, politeness, dedup, DNS resolver | Medium |
Common Mistakes That Cost Offers
- Jumping into components without clarifying requirements — 60% of failed candidates skip this step
- Not discussing trade-offs — saying "use Redis" without explaining why is insufficient
- Ignoring non-functional requirements (latency targets, availability SLAs, data consistency)
- Overcomplicating the initial design instead of starting simple and iterating
Practice system design with AissenceAI mock interviews that simulate real FAANG system design rounds with AI-generated follow-up questions.
The 15 Core System Design Patterns You Must Know
System design interviews reward pattern recognition over memorization. The same 15 patterns surface in 90% of prompts — master them and you can decompose almost any question. For each, know the trigger (when to reach for it), the trade-off (what you give up), and a real-world example.
- Load Balancing — Distribute traffic across servers. Trigger: any system with more than one server. Trade-off: adds a failure point and session-routing complexity. See load balancing techniques.
- Caching (Cache-Aside / Write-Through / Write-Behind) — Sub-millisecond reads for hot data. Trigger: read-heavy workloads. Trade-off: consistency vs latency (eventual vs strong). See caching strategies.
- Database Sharding — Split data across nodes by shard key. Trigger: single-DB write throughput ceiling. Trade-off: cross-shard queries, resharding pain. See database sharding guide.
- Read Replicas — Route reads to replicas, writes to primary. Trigger: read:write ratio > 10:1. Trade-off: replication lag, eventual consistency.
- Message Queues — Decouple producers from consumers (Kafka, SQS, RabbitMQ). Trigger: async work, peak shaving, fan-out. Trade-off: ordering, delivery semantics (at-least-once vs exactly-once). See message queue architecture.
- Pub/Sub Event-Driven — Notify many subscribers of state changes. Trigger: fan-out notifications, activity feeds. Trade-off: debugging complexity, event schema evolution.
- CDN / Edge Caching — Serve static and cacheable dynamic content from edge POPs. Trigger: global user base, large static assets. Trade-off: cache invalidation, cost at scale.
- API Gateway — Single entry: routing, auth, rate limiting, transformations. Trigger: many backend services. Trade-off: a new bottleneck and ops surface. See API design best practices.
- Service Discovery — Locate service instances dynamically (Consul, Eureka, K8s DNS). Trigger: microservices with autoscaling. Trade-off: dependency on a registry.
- Circuit Breaker — Stop cascading failures when a downstream is unhealthy. Trigger: dependent service with SLA. Trade-off: false trips under temporary spikes.
- Saga / Distributed Transactions — Coordinate multi-service writes without 2PC. Trigger: microservices needing transactional consistency. Trade-off: compensating actions, complexity. Pairs with microservices.
- CQRS — Separate read and write models. Trigger: read/write workloads that scale differently. Trade-off: eventual consistency, storage duplication.
- Event Sourcing — Store state as an immutable event log; derive current state by replay. Trigger: audit, time-travel, rebuildable state. Trade-off: event schema evolution, storage growth.
- Rate Limiting — Token bucket / sliding window / leaky bucket. Trigger: protect APIs from abuse and noisy neighbors. Trade-off: strictness vs user experience. See rate limiting design.
- Consistent Hashing — Distribute keys with minimal redistribution on membership change. Trigger: distributed caches and databases. Trade-off: hotspots with non-uniform keys; use virtual nodes.
When an interviewer asks "design X," map the prompt to 4–7 of these patterns and you'll have a complete architecture within 10 minutes.
SQL vs NoSQL: A Decision Framework
The SQL-vs-NoSQL question appears in nearly every senior system design round. The answer is never "it depends" without a framework — interviewers want a reasoned choice backed by data characteristics and consistency requirements. Use this matrix:
| Dimension | SQL (PostgreSQL, MySQL) | NoSQL (MongoDB, DynamoDB, Cassandra) |
|---|---|---|
| Data model | Structured, relational, schema-on-write | Flexible/document/KV/graph, schema-on-read |
| Consistency | Strong (ACID) | Eventual (BASE), tunable on some |
| Joins | First-class, efficient | Limited or none; denormalize |
| Scale model | Vertical + read replicas; sharding is manual | Horizontal, auto-sharding built in |
| Transactions | Multi-row ACID | Single-partition often; distributed via Saga |
| Schema evolution | Migrations required | Additive fields trivial |
| Best for | Orders, payments, ERP, complex joins | User profiles, IoT, logs, feeds, metadata |
| Reference scale | TBs with replicas; PBs with sharding | PBs natively (Cassandra, DynamoDB) |
Rule of thumb for interviews: default to PostgreSQL, switch to NoSQL when you cite a concrete reason (unbounded write throughput, schemaless user-generated content, or a globally-distributed low-latency read path). Always justify the switch with the dimension that broke SQL. See NoSQL vs SQL for the deep dive.
Caching Strategies in Depth
Caching is the single highest-leverage performance move and appears in nearly every system design answer. Name the strategy, justify the placement, and state the invalidation approach — that's what interviewers want.
- Cache-Aside (lazy loading): App checks cache, misses → loads from DB → writes cache. Most common; eventually consistent. Risk: cache stampede on cold keys — mitigate with request coalescing or single-flight.
- Write-Through: Writes go to cache and DB synchronously. Strong consistency at the cost of write latency. Best for read-heavy data where staleness is unacceptable.
- Write-Behind (write-back): Writes hit the cache and asynchronously flush to DB. Lowest write latency, highest throughput — but data loss risk on cache failure. Best for telemetry, counters, and non-critical state.
- TTL-based: Entries expire after a fixed lifetime. Trivial and safe; staleness bounded by TTL. Best for data tolerating short staleness (leaderboards, recommendations).
- Multi-layer (browser → CDN → app → Redis → DB): Each layer filters requests; only ~1% reach the DB. State the freshness contract at each layer.
Redis vs Memcached: Redis wins in interviews due to data structures, persistence, pub/sub, and Lua scripting — at the cost of single-threaded throughput that Memcached handles via multi-threading. For pure KV caching at extreme QPS, Memcached still holds up. See caching strategies explained.
Load Balancing in Depth
Place load balancers at three layers — client⇄web, web⇄app, app⇄DB — and name the algorithm at each. Algorithms interviewers expect:
- Round Robin — Sequential; assumes homogeneous servers.
- Weighted Round Robin — More traffic to stronger nodes; heterogeneous fleets.
- Least Connections — Routes to the node with the fewest in-flight requests; great for long-lived connections.
- IP Hash — Same client → same server; enables session affinity without sticky sessions at the app layer.
- Consistent Hashing — Minimizes key redistribution when nodes join/leave; the right answer for caching and sharding layers.
- Least Response Time / EWMA — Routes by exponentially-weighted moving average of latency; adapts to degraded nodes.
Layer 4 (TCP) is fast and opaque; Layer 7 (HTTP) enables content routing, A/B testing, and SSL termination. Always mention health checks, graceful draining during deploys, and connection pooling. See load balancing techniques.
Message Queues: When and How
Queues decouple producers from consumers, absorb traffic spikes, and enable fan-out — but they introduce ordering, delivery semantics, and exactly-once vs at-least-once trade-offs:
| System | Ordering | Throughput | Best For |
|---|---|---|---|
| Kafka | Per-partition order | Millions/sec | Event streaming, log pipelines |
| RabbitMQ | FIFO per queue | Tens of thousands/sec | Task distribution, RPC |
| Amazon SQS | Best-effort (FIFO option) | Thousands/sec | Managed async tasks |
| Amazon Kinesis | Per-shard order | High | Real-time analytics |
State the delivery semantics explicitly: most systems are at-least-once, meaning consumers must be idempotent (dedupe by message ID). Exactly-once is rare and expensive — Kafka transactions and AWS's exactly-once S3 sinks are the practical cases. See message queue architecture.
CDN and Edge Strategies
A CDN is the right answer whenever you have a global audience and cacheable content. Trade-offs matter more than the default "add a CDN":
- Push vs Pull origin: Push (CloudFront) pre-warms edges; Pull fetches on first request. Pull is simpler; Push wins for predictable hot content.
- TTL strategy: Long TTLs maximize hit rate but risk staleness. For dynamic content, use short TTLs (e.g., 60s) with origin validation.
- Cache invalidation: Purge-on-publish vs versioned URLs (appending ?v=hash). Versioned URLs sidestep invalidation entirely — preferred for JS/CSS.
- Origin shield: A single intermediate cache origin protects your origin from thundering herds across edges.
- Dynamic content at the edge: Cloudflare Workers / Lambda@Edge run logic at POPs — mention only if the prompt calls for personalized low-latency responses.
For static assets, a CDN with versioned URLs and long TTLs typically offloads 95%+ of origin traffic. Pair with the API design guide when designing the dynamic edge.
Comparison of System Design Building Blocks
When the interviewer asks "what would you choose for X?", this cheat matrix keeps your answer crisp:
| Need | Default Choice | Alternative / Trade-off |
|---|---|---|
| Relational data + transactions | PostgreSQL | MySQL (read-heavy), Aurora (managed) |
| Flexible schema, huge writes | MongoDB | Cassandra (linear scale), DynamoDB (managed) |
| Sub-ms reads (cache) | Redis | Memcached (pure KV, multithreaded) |
| Async work / decoupling | Kafka | RabbitMQ (task queues), SQS (managed) |
| Global static delivery | CloudFront / Cloudflare | Akamai (enterprise), Fastly (instant purge) |
| Search | Elasticsearch | OpenSearch, Algolia (managed search) |
| Object storage | S3 | GCS, Azure Blob; with CDN for reads |
| Time-series metrics | Prometheus + Grafana | InfluxDB, TimescaleDB |
| Globally-distributed low-latency KV | DynamoDB Global Tables | CockroachDB (SQL+geo), Spanner |
Common System Design Interview Mistakes
Most failed system design rounds lose the offer on process, not on knowledge. Avoid these:
- Skipping requirements clarification. ~60% of failed candidates dive straight into components. Spend 5 minutes asking about functional/non-functional requirements, scale, and SLAs — interviewers explicitly score this.
- No back-of-envelope estimation. Without QPS, storage, and bandwidth numbers you can't choose DBs, caches, or partition counts. A 10M DAU system is a completely different design from a 100M DAU one.
- Over-engineering early. Starting with Kafka + 12 microservices for a URL shortener signals you can't right-size. Start simple, then introduce complexity only when the requirement demands it.
- No trade-offs. "I'll use Redis" without stating what you gave up (consistency, cost, memory pressure) is a top-3 ding. Every choice has a cost — name it.
- Ignoring bottlenecks and single points of failure. The last 7 minutes exist for this. Identify the SPOFs, missing replicas, and the failure-mode behaviors (What if the cache dies? What if a shard is lost?).
- Not thinking out loud. Interviewers can only score what they hear. Silence reads as "stuck" even when you're reasoning well. Narrate constantly.
- Memorizing architectures instead of patterns. A memorized "Twitter design" fails the moment the prompt becomes "Instagram feed." Patterns transfer; snapshots don't.
- Neglecting data consistency. Pick a consistency model per component (strong for orders, eventual for feeds) and state why. "We'll be consistent" is not an answer.
- Forgetting observability. Metrics, logs, traces, alerting — mention them in the wrap-up. Production systems run on observability; its absence reads as junior.
A Worked Example: Design a News Feed
Apply the framework end-to-end on a classic prompt to see how the pieces fit:
- Requirements (5m): Post, view, follow, like. 200M DAU, ~10 posts/user/day feed, p99 read latency < 200ms, availability 99.95%.
- Estimation (3m): Reads ≈ 200M × 100 views = 20B feed reads/day ≈ 230K QPS peak. Writes ≈ 200M × 10 = 2B posts/day ≈ 23K QPS. Storage ≈ post size × posts; indexable by user.
- High-level (10m): Clients → API Gateway → Feed Service → (fan-out on write vs fan-out on read). Choose hybrid: fan-out on write for non-celebrity users, fan-out on read for celebrities (avoid write amplification).
- Deep-dive (15m): Posts in PostgreSQL with read replicas; feed timelines in Redis sorted sets; Kafka for fan-out workers; CDN for media; Cassandra for activity log if scale grows.
- Bottlenecks (7m): Redis timeline fan-out is the SPOF — add replicas + consistent hashing; celebrity cold-start — pre-compute top-K; cache stampede — single-flight on cold keys.
Frequently Asked Questions
How much system design knowledge is enough for L4 vs L5 vs L6?
L4: one solid architecture with named components and basic trade-offs. L5: quantified scale, multi-component deep-dive, and bottleneck analysis. L6+: capacity planning, failure-mode reasoning, cross-region design, and ops/observability.
Should I draw ASCII or use a whiteboard tool?
Whatever the interviewer provides. Virtual loops usually mean a shared doc/draw tool — practice in one before the interview. Diagram clarity is scored.
How do I handle a prompt I've never seen?
Map it to the 15 patterns. Clarify aggressively, estimate, then assemble components bottom-up. The pattern toolkit is what gets you through novel prompts.
Is CAP theorem still asked?
Yes, but applied — "for this component, which two of {C, A, P} did you choose and why?" Have a per-component answer, not a textbook quote.