System Design Basics
System design for backend interviews and real systems: a step-by-step framework, estimation, scalability and availability, load balancing, caching and CDNs, SQL vs NoSQL, replication and sharding, CAP and consistency, queues, rate limiting, API design, and worked designs of a URL shortener and a notification system.
How to Approach System Design
What system design interviews test, a repeatable step-by-step framework — requirements, estimates, API, data model, high-level design, deep dives and trade-offs — functional vs non-functional requirements, and common mistakes.
Back-of-the-Envelope Estimation
Powers of two and data sizes, latency numbers every developer should know, converting daily users into requests per second, estimating storage, bandwidth, cache size and servers, and a worked example.
Scalability, Availability & Reliability
Vertical vs horizontal scaling, stateless services, scaling a web app step by step from one server to many, latency vs throughput, availability and nines, redundancy and failover, single points of failure, and multi-region designs.
Load Balancing
What a load balancer does, Layer 4 vs Layer 7, balancing algorithms from round robin to least connections and consistent hashing, health checks, sticky sessions, TLS termination, global load balancing with DNS and anycast, and avoiding the load balancer as a single point of failure.
Caching & CDNs
Where caches live, cache-aside, read-through, write-through and write-behind, TTLs and invalidation, eviction policies, cache stampedes and hot keys, Redis vs local caches, Spring @Cacheable, and content delivery networks.
Choosing a Database — SQL vs NoSQL
Relational databases and ACID, the four NoSQL families — key-value, document, wide-column and graph — search engines, time-series and object storage, how to choose by access pattern, polyglot persistence, and common misconceptions.
Database Replication, Partitioning & Sharding
Leader–follower replication, read replicas and replication lag, synchronous vs asynchronous replication, multi-leader and leaderless designs, failover, vertical and horizontal partitioning, sharding strategies, consistent hashing, hot spots and resharding.
CAP Theorem & Consistency Models
The CAP theorem stated correctly, CP vs AP systems with examples, PACELC and the latency trade-off, strong, eventual and causal consistency, ACID vs BASE, and how to choose consistency per feature.
Message Queues & Asynchronous Processing
Why move work off the request path, queues vs event streams, point-to-point and publish–subscribe, back-pressure and load levelling, delivery guarantees, ordering, idempotency, dead-letter queues, and choosing Kafka, RabbitMQ or SQS.
Rate Limiting
Why rate limits matter, where to enforce them, the token bucket, leaky bucket, fixed window, sliding window log and sliding window counter algorithms with their trade-offs, distributed rate limiting with Redis, HTTP 429 and headers, and designing a rate limiter.
API Design & Communication Protocols
REST resource design, HTTP methods and status codes, idempotency and idempotency keys, pagination, filtering and versioning, error formats, REST vs GraphQL vs gRPC, WebSockets, server-sent events, polling and webhooks.
Design: URL Shortener
A complete worked design of a TinyURL / bit.ly-style service — requirements, estimates, API, data model, short-code generation with Base62, counters and hashing, 301 vs 302 redirects, caching, scaling, analytics, expiry, abuse prevention and trade-offs.
Design: Notification System
A complete worked design of a system that sends push, SMS, email and in-app notifications at scale — requirements, estimates, API, architecture with queues per channel, templates and preferences, retries and provider failover, deduplication, rate limits, scheduling, tracking and trade-offs.
System Design Cheat Sheet & Practice
The interview framework on one page, the building blocks and when to use each, key numbers, common trade-offs, a checklist of non-functional concerns, and practice problems with hints.