← Back to High-Level Design

High-Level Design — Quick Summary

Quick revision: every topic, key terms, and mnemonics for High-Level Design.


This is a quick revision doc covering all 45 topics in hld. Open the linked notes if you want depth.

Foundations & Approach

What Is System Design?

What it is. Defining the architecture, components, and data flow of a system to meet requirements. Conversation, not test.

Key terms.

Remember. Interviewers evaluate communication, problem breakdown, trade-off awareness, breadth, and depth — not perfect architecture.

How to Approach System Design

What it is. Repeatable framework for any 45-min interview.

Key terms (5-step framework).

Remember. Common mistakes: jumping to solution, over-engineering for Google-scale, silence, no trade-offs, ignoring interviewer hints.

Requirements Gathering

What it is. Turning vague prompts into concrete scope.

Key terms.

Remember. Always ask: How many users? Read/write ratio? Real-time vs batch? Consistency vs availability? When in conflict, state which one wins.

Back-of-the-Envelope Estimation

What it is. Quick math to feel the scale. Order-of-magnitude only.

Key terms.

Remember. Round aggressively. State assumptions. Don’t spend more than 5 min.

Design Principles and Trade-offs

What it is. Every design choice is a trade-off.

Key terms.

Remember. No “best” architecture, only the right one for the requirements.

Core Building Blocks

DNS and How the Internet Works

What it is. Translates names → IPs. The first step of every web request.

Key terms.

Remember. DNS is not just resolution — it does load distribution (round-robin), geo-routing, and failover.

Load Balancers

What it is. Distributes traffic across servers. Removes SPOF.

Key terms.

Remember. Tools: NGINX, HAProxy, AWS ALB/NLB, Caddy. Always have redundant LBs (LB itself is a SPOF).

Caching

What it is. Storing data in faster location to avoid the slow source.

Key terms.

Remember. Don’t cache: frequently-changing data, low-traffic data, write-heavy workloads, must-be-perfectly-consistent data.

Content Delivery Networks (CDNs)

What it is. Geographically distributed cache servers near users.

Key terms.

Remember. Use CDN for static content (images, JS, CSS, video). Don’t use for dynamic personalised content. Pair with object storage (S3+CloudFront).

Message Queues

What it is. Async buffer between producer and consumer. Decouples services.

Key terms.

Remember. Use queues for: decoupling services, traffic spikes, retries, async heavy work (email, report, video encoding).

Proxies and Reverse Proxies

What it is. Intermediary servers. Forward = hides client. Reverse = hides server.

Key terms.

Remember. “Proxy to access blocked sites” = forward (VPN). “Nginx in front of my app” = reverse. CDN = distributed reverse proxy.

Database Deep Dive

SQL vs NoSQL

What it is. Relational vs non-relational. Pick based on data shape + scale + consistency.

Key terms.

Remember. Real systems use both. PostgreSQL primary + Redis cache + Elasticsearch search is the classic combo.

Database Indexing

What it is. Separate sorted structure for fast lookups. Like book index.

Key terms.

Remember. Indexes speed reads, slow writes, take disk space. Don’t index small tables, low-cardinality columns, write-heavy tables.

Database Replication

What it is. Copies of data on multiple servers. HA + read scaling + DR.

Key terms.

Remember. Replication scales reads, not writes. Always plan for replication lag.

Database Sharding

What it is. Splitting data across multiple servers. Each shard = subset.

Key terms.

Remember. Sharding is a last resort. Try vertical scaling, replicas, caching, query optimization first.

Consistent Hashing

What it is. Hash ring that minimizes data movement when nodes change.

Key terms.

Remember. Used in Memcached, Cassandra, DynamoDB, Akamai CDN. Without it, hash % N reshuffles ~75% of keys when adding one node.

ACID and Transactions

What it is. Four guarantees for reliable transactions. (Same as DBMS — see that.)

Isolation Levels Cheatsheet.

LevelDirtyNon-RepeatablePhantom
Read Uncommittedpossiblepossiblepossible
Read Committed (Postgres default)preventedpossiblepossible
Repeatable Read (MySQL default)preventedpreventedpossible
Serializablepreventedpreventedprevented

Remember. ACID for money/inventory/auth. BASE for feeds/likes/views.

Scalability Patterns

Horizontal vs Vertical Scaling

What it is. Bigger machine vs more machines.

Key terms.

Remember. Start vertical for simplicity. Design stateless so you can go horizontal later. Most large systems use a mix.

Microservices vs Monolith

What it is. One app vs many small apps.

Key terms.

Remember. “Monolith first” (Fowler). Amazon, Netflix, Uber all started monolith. Extract services when pain points appear.

API Gateway

What it is. Single entry point for microservices.

Key terms.

Remember. Without it, every client knows every service URL. With it, one door. Make it HA — it’s a SPOF if not.

Denormalization and Read-Write Separation

What it is. Trade duplication for fast reads. Split reads from writes.

Key terms.

Remember. “Update name” requires updating all denormalized copies — that’s the price.

Blob Storage and Object Storage

What it is. Storage for files. Object = flat key-value blobs over HTTP.

Key terms.

Remember. Object storage + CDN is the gold standard. S3 alone has 11 nines durability.

Reliability & Consistency

CAP Theorem

What it is. During a network partition, choose C or A. Same as DBMS — covered there.

Key terms.

Remember. Trade-off only kicks in during partition. PACELC extends with Else (no partition) → Latency or Consistency.

Cheatsheet — CAP Triad

PickSacrificeExamples
CPAvailability during partitionMongoDB, etcd
APConsistency during partitionCassandra, DynamoDB
CAPartition tolerance (single-node only)Single Postgres

Consistency Models

What it is. Spectrum from strong to eventual.

Key terms.

Remember. Mix and match per use case. Inventory → strong. Likes → eventual. Profile updates → read-your-writes.

Cheatsheet — Consistency Models

ModelStrengthLatencyExample
LinearizableStrongestHighestSpanner
SequentialStrongHighSome DBs
CausalMediumMediumMongoDB causal
Read-your-writesWeak+Low+Sticky sessions
EventualWeakestLowestDynamoDB default

Failover and Redundancy

What it is. Automatic switch from failed component to backup.

Key terms.

Remember. Always have redundant LBs. Going from 99.9% to 99.99% is exponentially harder. Aim for 3 nines on web apps, 4-5 for critical infra.

Circuit Breaker and Bulkhead Patterns

What it is. Prevent cascading failures.

Key terms.

Remember. Three patterns combine: Bulkhead isolates → Circuit breaker fails fast → Retry handles transients. Together they prevent cascading collapse.

Monitoring, Logging, and Alerting

What it is. Three pillars of observability.

Key terms.

Remember. Mention monitoring at end of system design — shows production maturity.

Communication Protocols

REST API Design

What it is. Resource-based architecture over HTTP. Stateless.

Key terms.

Remember. “4xx = client’s fault. 5xx = our fault.” Always use ISO 8601 dates. HTTPS everywhere.

GraphQL

What it is. Client-specified queries to one endpoint. Solves over/under-fetching.

Key terms.

Remember. GraphQL shines when frontend needs lots of related data. REST simpler for CRUD, public APIs, file uploads.

Cheatsheet — REST vs GraphQL vs gRPC vs WebSocket

Use casePick
Public CRUD API, browser-friendlyREST
Frontend with many related entitiesGraphQL
Backend-to-backend, perf criticalgRPC
Bidirectional real-timeWebSocket
Server-only pushSSE

WebSockets

What it is. Persistent bidirectional connection. Both sides send anytime.

Key terms.

Remember. Don’t use for occasional updates (use SSE) or simple CRUD. Each connection consumes server memory — plan for ~100K connections per server.

gRPC and Protocol Buffers

What it is. RPC framework using HTTP/2 + Protobuf binary serialization.

Key terms.

Remember. gRPC inside services, REST outside for public APIs. Trade-off: faster + typed but harder to debug.

Polling, Long Polling, and Server-Sent Events

What it is. Server push without full WebSocket complexity.

Key terms.

Remember. Decision tree: real-time + bidirectional → WebSocket. Server-only push → SSE (underrated). Occasional updates → polling.

Advanced Patterns

Rate Limiting

What it is. Cap on requests per client per time window.

Key terms.

Remember. Fail open if rate limiter is down. Layer global + per-client + per-endpoint. Token Bucket is the safe interview answer.

Advanced Caching Patterns

What it is. Five caching strategies + handling stampedes.

Key terms.

Remember. Always add jitter to TTL. Pick cache-aside for safe default. Write-behind only if data loss is acceptable.

Search and Indexing

What it is. Inverted indexes for fast text search. Elasticsearch.

Key terms.

Remember. Don’t use SQL LIKE %x% for search. ES sits beside DB, not instead. Use it for full-text, autocomplete, faceted filtering, geosearch.

Event Sourcing and CQRS

What it is. Store events not state. Separate read/write models.

Key terms.

Remember. Adds significant complexity. Use for audit trails (finance/healthcare/legal), complex domains, replay needs. Most CRUD apps don’t need it.

Distributed Consensus

What it is. Many nodes agreeing. Leader election. Raft.

Key terms.

Remember. Quorum prevents split-brain mathematically. Raft is the modern, understandable algorithm — Paxos is the OG.

Real System Design Questions

Design a URL Shortener (TinyURL)

Core flow. POST long URL → generate short key → return. GET short key → 302 redirect to long URL.

Key terms.

Architecture. Client → LB → App Server → Redis (hot keys) → DB. Click events → Kafka → analytics workers.

Remember. Read-heavy (100:1) → cache aggressively. Async analytics through Kafka so redirects stay fast.

Design a Rate Limiter

Core flow. Every request → check counter → allow or 429.

Key terms.

Remember. Fail open. Use Token Bucket for bursts. Multi-region: per-region limits are usually good enough.

Design a Chat System (WhatsApp)

Core flow. Persistent WebSocket → message → server routes to recipient (online) or push notification (offline) → persist.

Key terms.

Remember. 5,000+ chat servers for 500M concurrent connections. Pub/sub bridges users on different servers. Push notifications via APNs/FCM for offline.

Design a Social Media Feed (Twitter/X)

Core flow. Tweet posted → fan out to followers’ feed caches (write-side) → user opens feed → fetch from cache + pull from celebrities → rank → return.

Key terms.

Remember. Pre-compute feeds when tweets created (write expense) so reads are cache lookups (read speed). Celebrity problem requires hybrid.

Design a Video Streaming Platform (YouTube)

Core flow. Upload → S3 → Kafka → transcode workers → multiple resolutions + chunks → S3 → CDN. Watch → manifest from CDN → fetch chunks adaptively.

Key terms.

Remember. Upload and stream are completely separate paths. CDN does the heavy lifting. HLS works because each segment is just a regular HTTP file (cacheable).

Design a Ride-Sharing Service (Uber)

Core flow. Driver location every 4s → Redis GEO + Kafka. Rider request → Matching Service queries nearby drivers → ETA-based pick → notify driver → ride lifecycle.

Key terms.

Remember. Location firehose (1M+ writes/sec) is the hardest part. Shard by city. Redis for current locations, Kafka for stream, time-series DB for history.

Design a File Storage Service (Dropbox)

Core flow. Client chunks file → hashes each chunk → uploads only new chunks → server tracks chunks per file. Sync notifications via WebSocket → other devices fetch new chunks.

Key terms.

Remember. Three pillars: chunking (transfer only changes), dedup (store once), sync notifications (push changes to devices). Metadata in PostgreSQL, blocks in S3.

Design an E-Commerce Platform (Amazon)

Core flow. Product catalog (cached heavily) → cart (Redis + DB) → checkout → reserve inventory → charge payment → confirm → fulfill.

Key terms.

Remember. Never oversell. Optimistic locking + reserved stock + version numbers. Sale events: queue-based checkout, pre-warm caches, feature flags to disable non-essentials. Read-heavy (100:1) so cache everything, shard by user_id.