System Design
A beginner to advanced system design library: fundamentals, High-Level Design (HLD), Low-Level Design (LLD), 30+ worked case studies, AI and frontend system design, flowcharts, and a question bank.
Start here for system design prep. The section is split the way interviews are split: HLD (architecture, scale, data, trade-offs) and LLD (classes, interfaces, patterns, machine coding). Every page has flowcharts, worked examples, and interview questions. Facts that changed recently (Kafka 4.0, Redis licensing and Valkey, LLM serving, the 2025 AWS and Cloudflare outages, UUIDv7) are folded into the pages where they matter.
Contents
- 01Fundamentals
System design foundations: the interview framework, requirements, back-of-envelope estimation, latency numbers, scaling stages, availability math, percentiles, CAP and PACELC, and consistency models.
- 02High-Level Design (HLD)
Architecture-level system design: building blocks, distributed systems theory, classic and large-scale case studies, AI system design, frontend system design, and reliability.
7 pages- 01Building Blocks
The components every HLD answer is made of: DNS, CDN, load balancers, API gateways, caches, SQL and NoSQL databases, replication, sharding, consistent hashing, queues and streams, object storage, search, and real-time protocols.
- 02Distributed Systems
Advanced HLD theory: unreliable networks and clocks, replication and quorums, consensus (Raft), distributed locks, isolation levels, 2PC, sagas, outbox, idempotency, resilience patterns, event-driven design, multi-region, and blast-radius control.
Table of Contents1. Why Distributed Systems Are Hard2. Time and Ordering3. Replication in Depth4. Consensus and Raft5. Locks, Leases and Fencing6. Isolation Levels and Anomalies7. Distributed Transactions8. Idempotency and Exactly-Once9. Rate Limiting Algorithms10. Resilience Patterns11. Event-Driven Architecture+4 more - 03Classic Designs
Eight classic HLD case studies with requirements, estimates, APIs, data models, flowcharts and trade-offs: URL shortener, rate limiter, unique ID generator, key-value store, notification system, web crawler, typeahead, and distributed cache.
- 04Large-Scale Designs
Twelve senior-level HLD case studies with estimates, flowcharts and deep dives: news feed, chat, video streaming, ride hailing, file sync, ticket booking, payments, ad click aggregation, job scheduler, leaderboard, collaborative editing, and a monitoring system.
- 05AI System Design
System design for LLM products: token economics, LLM inference serving (continuous batching, PagedAttention, prefix caching), a ChatGPT-style assistant, RAG with hybrid search and reranking, agents and MCP, AI gateways, evaluation, reliability and cost.
Table of Contents1. What Is Different About AI Systems2. LLM Concepts a System Designer Needs3. LLM Inference Serving4. Design: A ChatGPT-Style Assistant5. Design: RAG Over Private Documents6. Design: Agents and Tool Use7. AI Gateway and Semantic Caching8. Evaluation and Observability9. Reliability and Cost10. Practice Prompts11. Questions and Answers+1 more - 06Frontend System Design
Frontend and full-stack system design: the RADIO framework, rendering strategies (CSR, SSR, SSG, ISR, streaming, RSC), Core Web Vitals, data fetching and state, real-time and offline, micro-frontends, security, and worked UI designs.
Table of Contents1. The RADIO Framework2. Rendering Strategies3. Performance and Core Web Vitals4. Data Fetching and State5. Real-Time and Offline6. Component and Application Architecture7. Micro-Frontends8. Security9. Accessibility and Internationalization10. Observability and Release11. Design: News Feed UI+4 more - 07Reliability and Operations
Senior-level system design operations: SLOs and error budgets, observability with OpenTelemetry, deployment strategies, disaster recovery, security architecture, incident response, and lessons from the October 2025 AWS and November 2025 Cloudflare outages.
Table of Contents1. SLIs, SLOs and Error Budgets2. Observability3. Deployment Strategies4. Backups and Disaster Recovery5. Capacity, Load Testing and Cost6. Security Architecture7. Incident Response8. Case Study: AWS US-EAST-1, October 20259. Case Study: Cloudflare, November 202510. Lessons You Can Reuse11. Production Readiness Checklist+2 more
- 03Low-Level Design (LLD)
Object-oriented low-level design and machine coding: an approach, UML in Mermaid, design patterns, twelve worked problems with runnable Java, and concurrency in LLD.
5 pages- 01LLD Fundamentals
How to approach low-level design and machine coding: an 8-step method, requirements to classes, UML class, sequence and state diagrams in Mermaid, SOLID and design principles in practice, code quality checklist, and a 60-minute plan.
- 02Design Patterns
A practical design pattern catalog for LLD interviews: when to use each pattern, a chooser flowchart, and runnable Java for Builder, State, Command, Chain of Responsibility, Template Method, Adapter, Facade, Proxy, Composite and Mediator, plus TypeScript versions.
- 03Machine Coding 1
Six machine coding problems with requirements, class diagrams and complete runnable Java: Parking Lot, LRU Cache, Elevator, Vending Machine, Tic-Tac-Toe, and a Logger framework.
- 04Machine Coding 2
Six more machine coding problems with complete runnable Java: Movie Ticket Booking with seat holds, Splitwise with debt simplification, an in-memory Pub/Sub broker, pluggable Rate Limiter, ATM with State and Chain of Responsibility, and an in-memory File System.
- 05Concurrency in LLD
Thread safety for low-level design: race conditions, the Java concurrency toolbox, lock granularity, deadlock and lock ordering, producer-consumer, bounded buffers, thread-safe singletons, optimistic CAS, testing concurrent code, and async races in JavaScript. All Java runs.
Table of Contents1. The Three Problems2. The Java Toolbox3. Lost Updates and Atomic Counters4. Check-Then-Act and Lock Granularity5. Deadlock6. Producer-Consumer7. Thread-Safe Singletons and Safe Publication8. Optimistic Concurrency9. Design Strategies10. Testing Concurrent Code11. JavaScript: Async Races+2 more
- 04Interview Playbook
System design interview strategy: level-by-level rubric, 45-minute timelines for HLD and LLD, communication phrases, common mistakes, a 60-question bank from beginner to advanced with pointers, a design prompt index, and 4-week and 7-day study plans.
Reading Path
Pick Your Level
| You are | Read in this order |
|---|---|
| Complete beginner | Fundamentals, Building Blocks, Classic Designs |
| Preparing for a mid-level loop | Add Large-Scale Designs, LLD Fundamentals, both machine coding pages |
| Preparing for senior or staff | Add Distributed Systems, Reliability and Operations, AI System Design |
| Frontend or full-stack engineer | Frontend System Design, then Server-Driven UI |
| One week left | Interview Playbook study plan, then the case studies it points at |
Related Sections
- OOPS has the four pillars, SOLID, UML and five core patterns that LLD builds on.
- Java has the concurrency and collections notes used by the LLD solutions.
- Frontend System Design is the full frontend design library: rendering, performance, state, real-time, architecture, and 16 UI and app designs.
- Server-Driven UI is a real frontend architecture case study.
- DSA covers the algorithms that appear inside designs (heaps, tries, intervals, graphs).
- Backend covers the service layer: APIs, auth, caching, queues, testing and deployment.
- Databases covers the data layer: SQL, indexing, transactions, replication and NoSQL.
Sources
The notes are original write-ups, cross-checked against primary sources where a fact is time sensitive. Recurring references:
- Designing Data-Intensive Applications by Martin Kleppmann (the best single book for the HLD theory).
- Google SRE Book and Amazon Builders' Library.
- System Design Primer.
- The Raft paper and visualization, Jepsen for consistency analyses.
- Apache Kafka 4.0 release notes, vLLM: Anatomy of a High-Throughput LLM Inference System, AWS DynamoDB disruption summary (Oct 2025), Cloudflare outage on November 18, 2025.