System design interview concepts, explained
Interview-ready explainers of the core system design concepts: caching, load balancing, sharding, CAP, queues, and more.
12 pages
Caching: How It Works, Strategies, and Tradeoffs
Caching explained for system design interviews: write-through vs write-back, cache-aside, eviction policies (LRU/LFU), TTLs, invalidation, and Redis vs Memcached.
Load Balancing: Algorithms, Layers, and Tradeoffs
Load balancing for system design: L4 vs L7, round-robin, least-connections, consistent hashing, health checks, sticky sessions, and tools like NGINX, HAProxy, ELB.
Database Sharding: Horizontal Partitioning Explained
Database sharding for system design: range vs hash vs directory sharding, hot shards, resharding, cross-shard joins, and how Instagram, Vitess, and DynamoDB shard.
Database Replication: Models, Consistency, and Tradeoffs
Database replication for system design: single-leader, multi-leader, leaderless; sync vs async, replication lag, failover, read replicas, and quorum reads/writes.
CAP Theorem: Consistency, Availability, Partition Tolerance
CAP theorem for system design interviews: why you can't have all three, CP vs AP systems, real examples (Cassandra, MongoDB, Spanner), and the PACELC extension.
Message Queues: Async Messaging, Patterns, and Tradeoffs
Message queues for system design: Kafka vs RabbitMQ vs SQS, pub/sub vs queues, delivery guarantees, ordering, backpressure, dead-letter queues, and when to use them.
Consistent Hashing: How It Works and Why It Matters
Consistent hashing for system design: the hash ring, virtual nodes, why modulo hashing fails, minimal key remapping, and use in Cassandra, DynamoDB, and CDNs.
Rate Limiting: Algorithms, Tradeoffs, and Design
Rate limiting for system design: token bucket, leaky bucket, fixed vs sliding window, distributed rate limiting with Redis, and 429 responses. With tradeoffs.
CDN: Content Delivery Networks Explained
CDNs for system design: edge caching, PoPs, anycast, push vs pull, TTL and cache invalidation, static vs dynamic content, and providers like Cloudflare and Akamai.
SQL vs NoSQL: Tradeoffs and When to Use Each
SQL vs NoSQL for system design: ACID vs BASE, schema, scaling, joins, and the four NoSQL types (key-value, document, column, graph). With real examples.
API Design: REST vs gRPC vs GraphQL
API design for system design interviews: REST vs gRPC vs GraphQL, HTTP verbs, idempotency, versioning, protobuf, HTTP/2 streaming, and when to use each.
Microservices vs Monolith: When to Use Each
Microservices vs monolith for system design: independent deploys, scaling, fault isolation, operational complexity, data consistency, and when to start with a monolith.