#ποΈ System Design Interview Preparation β Senior / Lead Engineer
Purpose: A comprehensive, structured repository for mastering system design interviews at FAANG+ companies.
Target Level: Senior Engineer (L5/E5) β Lead/Staff Engineer (L6/E6)
Approach: Each topic gets its own deep-dive document. You give a one-liner β we produce a full end-to-end design doc.
#π Table of Contents
- How This Repository Works
- Interview Framework β The FAANG Method
- What Interviewers Actually Evaluate
- The 45-Minute Blueprint
- Question Framing β How FAANG Asks Questions
- Answering Strategy β The Candidate's Playbook
- Core Building Blocks Cheatsheet
- Design Document Template
- Cross-Cutting Notes & Concept Map
- Topic Index β Design Deep-Dives
#π How This Repository Works
You bring a one-liner (e.g. "Design YouTube")
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Interactive Clarification Round β
β (scope, constraints, priorities) β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Full Design Document Generated β
β βββ Requirements & Estimation β
β βββ HLD (Architecture + Diagrams) β
β βββ Deep-Dive on Core Components β
β βββ LLD (Data Models + APIs) β
β βββ Trade-offs & Decisions β
β βββ Cross-references to other docs β
βββββββββββββββββββββββββββββββββββββββEvery document follows the same structure so your brain builds muscle memory for the interview format.
#Folder Structure
system-design/
βββ README.md β You are here (master guide)
βββ server.js β Web UI Server
βββ notes/
β βββ concept-map.md β Central hub for all concepts
β βββ *.md β High-level architectural theory
βββ topics/
β βββ *.md β End-to-end design problems
βββ building-blocks/
βββ *.md β Deep dives into specific technologies#π οΈ Contributor Guidelines
STRICT RULE: Every design topic added MUST follow these guidelines to maintain repo integrity.
#1. File Structure
All design documents in topics/ must use the Design Document Template.
#2. Deep Linking Protocol
- Concepts: Any mention of a major architectural pattern (e.g., Sharding, CQRS) must link to its respective file in
notes/. - Technologies: Any mention of a specific technology (e.g., Redis, Kafka) must link to its file in
building-blocks/. - Concept Map: After completing a design, update
notes/concept-map.mdwith new cross-references.
#3. UI Friendliness
- Use standard markdown.
- For diagrams, use
mermaidblocks or clear ASCII art. - Ensure tables are used for comparisons and trade-offs.
#4. Evolution-First Design
Always include a Scale Evolution section in the High-Level Design (HLD) to show how the system grows from MVP to FAANG-scale.
---
## π― Interview Framework β The FAANG Method
### What Makes Senior/Lead Different from Mid-Level?
| Dimension | Mid-Level (L4) | Senior (L5) | Lead/Staff (L6+) |
|-----------|----------------|-------------|-------------------|
| **Scope** | Solves the stated problem | Identifies unstated requirements | Redefines the problem if needed |
| **Depth** | Picks reasonable components | Justifies every choice with trade-offs | Proposes alternatives and explains when each is better |
| **Breadth** | Designs the happy path | Handles edge cases and failure modes | Thinks about operational excellence, cost, and org impact |
| **Communication** | Answers questions | Drives the conversation | Treats interviewer as a collaborator, asks *them* questions |
| **Trade-offs** | Mentions trade-offs if asked | Proactively surfaces them | Frames decisions as "given constraint X, I chose Y because Z" |
### The Senior/Lead Mindset
> **You are not solving a puzzle. You are leading a design review.**
The interviewer is your peer engineer. Your job is to:
1. **Own the whiteboard** β Drive the discussion, don't wait for prompts
2. **Think out loud** β Your reasoning process IS the evaluation
3. **Be opinionated with humility** β "I'd choose X because... but if our constraint changes to Y, we'd pivot to Z"
4. **Prioritize ruthlessly** β You can't design everything in 45 min. Show you know what matters most.
---
## π What Interviewers Actually Evaluate
### The Scorecard (What's in the Interviewer's Rubric)
| Signal | Strong Hire Indicators | Red Flags |
|--------|----------------------|-----------|
| **Problem Exploration** | Asks clarifying questions that change the design; identifies hidden constraints | Jumps to solution immediately; accepts problem at face value |
| **High-Level Design** | Clean separation of concerns; identifies 3-5 core components; explains data flow | Monolithic blob; no clear boundaries; can't explain how components interact |
| **API Design** | RESTful / event-driven where appropriate; clear contracts; versioning awareness | Vague "API calls between services"; no concrete endpoints |
| **Data Model** | Schema matches access patterns; explains indexing; considers denormalization | Generic "put it in a database"; no thought about query patterns |
| **Scalability** | Calculates back-of-envelope numbers; scales specific bottlenecks, not everything | "Just add more servers"; premature optimization everywhere |
| **Trade-offs** | Every decision comes with "I chose X over Y because..."; revisits choices when scope changes | One-size-fits-all answers; "this is the best way" |
| **Operational Maturity** | Monitoring, alerting, deployment strategy, graceful degradation | Ignores failure modes; no mention of observability |
---
## β±οΈ The 45-Minute Blueprint
This is your time budget. Practice until this becomes instinctive.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 00:00 - 05:00 β REQUIREMENTS & CLARIFICATION β
β β β’ Functional requirements (3-5 core features) β
β β β’ Non-functional requirements (latency, CAP) β
β β β’ Scale estimation (users, QPS, storage) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 05:00 - 10:00 β BACK-OF-ENVELOPE ESTIMATION β
β β β’ DAU β QPS β Peak QPS β
β β β’ Storage per record β Total storage (5 yr) β
β β β’ Bandwidth, cache size estimates β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 10:00 - 15:00 β HIGH-LEVEL DESIGN β
β β β’ Core components on whiteboard β
β β β’ Data flow for primary use case β
β β β’ API contracts for key operations β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 15:00 - 35:00 β DEEP DIVE (The Make-or-Break Phase) β
β β β’ Database schema + access patterns β
β β β’ Scaling the bottleneck components β
β β β’ Caching strategy β
β β β’ Consistency vs Availability decisions β
β β β’ Failure handling and edge cases β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 35:00 - 42:00 β OPERATIONAL EXCELLENCE β
β β β’ Monitoring & alerting β
β β β’ Deployment strategy β
β β β’ Security considerations β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 42:00 - 45:00 β WRAP-UP & EXTENSIONS β
β β β’ Summarize key decisions β
β β β’ Mention what you'd add with more time β
β β β’ Open for interviewer's questions β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
---
## β Question Framing β How FAANG Asks Questions
### The 4 Categories of System Design Questions
#### 1. Product Design Systems
> *"Design X"* β where X is a user-facing product
> **Examples:** Design Twitter, Design Netflix, Design Google Docs
> **What they test:** End-to-end thinking, product sense + engineering
#### 2. Infrastructure Systems
> *"Design a system that does X"* β lower-level infra
> **Examples:** Design a Rate Limiter, Design a URL Shortener, Design a Task Scheduler
> **What they test:** Algorithmic depth, distributed systems knowledge
#### 3. Data-Intensive Systems
> *"Design X that handles Y scale"* β focus on data pipeline
> **Examples:** Design a Search Autocomplete, Design a News Feed, Design Analytics Platform
> **What they test:** Data modeling, indexing, pipeline architecture
#### 4. Real-Time / Streaming Systems
> *"Design X with real-time requirements"*
> **Examples:** Design a Chat System, Design Live Comments, Design a Collaborative Editor
> **What they test:** WebSocket/SSE, event-driven architecture, consistency models
### How the Question Evolves During the Interview
Interviewer's Hidden Agenda:
βββββββββββββββ ββββββββββββββββββ βββββββββββββββββββββ
β Start Simple β βββΆ β Add Constraints β βββΆ β Break Your Design β
β "Design X" β β "What if 10x β β "What happens when β
β β β traffic?" β β this node fails?" β
βββββββββββββββ ββββββββββββββββββ βββββββββββββββββββββ
**Pro Tip:** Anticipate the follow-ups. When you make a design choice, preemptively say:
*"This works at our current scale. If we 10x, I'd change this to..."*
---
## π£οΈ Answering Strategy β The Candidate's Playbook
### The RESHADE Framework (For Every Design Decision)
| Step | What You Say | Example |
|------|-------------|---------|
| **R**equirement | "The requirement here is..." | "We need sub-100ms read latency for the feed" |
| **E**valuate Options | "We could use A, B, or C..." | "Options: Fan-out-on-write, fan-out-on-read, hybrid" |
| **S**elect | "I'll go with B because..." | "Fan-out-on-write gives us O(1) reads at the cost of write amplification" |
| **H**ighlight Trade-off | "The trade-off is..." | "Celebrity users will cause write storms; we'll handle that separately" |
| **A**ddress Edge Cases | "Edge case: what if..." | "If a user has 10M followers, we switch to fan-out-on-read for them" |
| **D**efine Metrics | "We'd measure success by..." | "P99 feed load time < 200ms, fanout lag < 5s" |
| **E**xtend | "With more time, I'd also..." | "Add ML-based feed ranking, A/B testing framework" |
### Phrases That Signal Senior-Level Thinking
β
"It depends on..." β Shows nuance
β
"At our scale, this works because..." β Shows awareness of constraints
β
"The trade-off here is X for Y..." β Shows engineering maturity
β
"In production, we'd also need..." β Shows operational thinking
β
"I've seen this pattern at..." β Shows experience (use sparingly)
β
"Let me reconsider..." β Shows intellectual honesty
β "This is the best approach" β No approach is universally best
β "We'll just use Redis/Kafka" β Name-dropping without justification
β "I'm not sure, but..." β State your best reasoning confidently
### How to Handle "I Don't Know"
> **Never say "I don't know" and stop.** Instead:
> 1. State what you **do** know about the adjacent concept
> 2. Reason from first principles
> 3. Say: *"I haven't worked with X directly, but based on Y principle, I'd approach it as..."*
---
## π§± Core Building Blocks Cheatsheet
> These are the Lego pieces you'll assemble in every design. Know when and why to use each.
### Compute & Networking
| Component | When to Use | Key Consideration |
|-----------|-------------|-------------------|
| **Load Balancer** | Multiple server instances | L4 vs L7; round-robin vs least-connections vs consistent hashing |
| **API Gateway** | Microservices architecture | Rate limiting, auth, request routing, protocol translation |
| **CDN** | Static content, global users | Push vs Pull; cache invalidation; edge compute |
| **Reverse Proxy** | SSL termination, caching | Nginx vs HAProxy; connection pooling |
### Data Storage
| Component | When to Use | Key Consideration |
|-----------|-------------|-------------------|
| **SQL (PostgreSQL/MySQL)** | Structured data, ACID needed | Sharding strategy; read replicas; connection pooling |
| **NoSQL - Document (MongoDB)** | Flexible schema, hierarchical data | Denormalization strategy; eventual consistency |
| **NoSQL - Wide Column (Cassandra)** | High write throughput, time-series | Partition key design; compaction strategy |
| **NoSQL - Key-Value (Redis/DynamoDB)** | Simple lookups, caching, sessions | Eviction policy; persistence; cluster mode |
| **Search Engine (Elasticsearch)** | Full-text search, analytics | Index design; shard allocation; relevance tuning |
| **Graph DB (Neo4j)** | Relationship-heavy queries | Traversal patterns; vs SQL with recursive CTEs |
| **Object Storage (S3)** | Blobs, media files, backups | Lifecycle policies; multipart upload; pre-signed URLs |
### Messaging & Streaming
| Component | When to Use | Key Consideration |
|-----------|-------------|-------------------|
| **Message Queue (SQS/RabbitMQ)** | Async task processing, decoupling | At-least-once vs exactly-once; DLQ; ordering |
| **Event Streaming (Kafka)** | Event sourcing, high-throughput streams | Partition strategy; consumer groups; retention |
| **Pub/Sub (SNS/Google Pub/Sub)** | Fan-out notifications | Filtering; push vs pull subscriptions |
### Caching
| Strategy | Pattern | When to Use |
|----------|---------|-------------|
| **Cache-Aside** | App reads cache β miss β read DB β populate cache | General purpose; most common |
| **Write-Through** | App writes cache + DB together | Strong consistency needed |
| **Write-Behind** | App writes cache β async write DB | High write throughput; acceptable lag |
| **Read-Through** | Cache itself fetches from DB on miss | Simplifies app code; cache acts as proxy |
### Consistency & Coordination
| Concept | What It Solves | Options |
|---------|---------------|---------|
| **CAP Theorem** | Can't have all 3: Consistency, Availability, Partition Tolerance | CP (banking) vs AP (social media) |
| **Consensus** | Leader election, distributed locks | Raft, Paxos, ZooKeeper |
| **Idempotency** | Duplicate request handling | Idempotency keys, deduplication |
| **Distributed Transactions** | Cross-service data consistency | Saga pattern, 2PC (avoid if possible) |
---
## π Design Document Template
> Every topic document in `topics/` follows this exact structure.
```markdown
# Design [System Name]
## 1. Problem Statement & Clarifications
### Functional Requirements (What the system does)
### Non-Functional Requirements (How well it does it)
### Out of Scope (What we're NOT designing)
### Assumptions
## 2. Back-of-Envelope Estimation
### Traffic Estimates
### Storage Estimates
### Bandwidth Estimates
### Cache / Memory Estimates
## 3. API Design
### Core Endpoints / Interfaces
### Request/Response Contracts
## 4. Data Model
### Schema Design (SQL / NoSQL)
### Access Patterns
### Indexing Strategy
## 5. High-Level Design (HLD)
### Architecture Diagram
### Component Breakdown
### Data Flow (Write Path / Read Path)
## 6. Deep Dive β Core Components
### [Component 1] β Detailed Design
### [Component 2] β Detailed Design
### Scaling Strategy
### Caching Strategy
### Consistency Model
## 7. Low-Level Design (LLD) β Core Functionality
### Key Algorithms
### Design Patterns Used
### Class/Module Structure (Brief)
## 8. Failure Handling & Edge Cases
### What Happens When X Fails?
### Graceful Degradation
### Data Recovery
## 9. Monitoring & Observability
### Key Metrics
### Alerting Strategy
### SLAs / SLOs
## 10. Trade-off Summary
| Decision | Chose | Over | Because |
|----------|-------|------|---------|
## 11. Extensions & Follow-ups
### What Would You Add With More Time?
### How Would This Change at 100x Scale?
## 12. Cross-References
### Related Topics in This Repo
### Building Blocks Used#πΊοΈ Cross-Cutting Notes & Concept Map
As we build topics, concepts will link to each other. This section grows over time.
#Concept Dependency Graph
βββββββββββββββ
β CAP Theorem β
ββββββββ¬βββββββ
β
ββββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
ββββββββββββ ββββββββββββ ββββββββββββββββ
βConsistencyβ βAvailabil.β β Partition β
β Models β β Patterns β β Tolerance β
βββββββ¬βββββ ββββββ¬ββββββ ββββββββ¬ββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββ ββββββββββββ ββββββββββββββββ
β Strong β β Circuit β β Replication β
β vs β β Breaker β β Strategies β
β Eventualβ β Pattern β β β
ββββββββββββ ββββββββββββ ββββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Database Sharding & Partitioning β
ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Consistent Hashing (used by many) β
ββββββββββββββββββββββββββββββββββββββββ#Recurring Patterns Across Designs
| Pattern | Where It Appears | Key Insight |
|---|---|---|
| Fan-out-on-write vs read | News Feed, Twitter, Notifications | Write amplification vs read latency trade-off |
| Consistent Hashing | Cache clusters, DB sharding, Load balancing | Minimizes redistribution on node add/remove |
| Event Sourcing | Chat, Collab Editor, Payment systems | Append-only log as source of truth |
| CQRS | E-commerce, Analytics, Search | Separate read/write models for optimization |
| Saga Pattern | E-commerce, Booking systems | Distributed transactions without 2PC |
| Bloom Filter | URL shortener, Web crawler, Dedup | Probabilistic "definitely not in set" check |
| Write-Ahead Log | Databases, Message queues, Any durable system | Crash recovery before committing |
| Lease-based Locks | Distributed coordination, Leader election | Time-bounded ownership to prevent deadlocks |
#π Topic Index β Design Deep-Dives
Topics are added as we work through them. Each links to its own detailed document.
#π’ Fundamentals (Start Here)
| # | Topic | Document | Status |
|---|---|---|---|
| 1 | Design a URL Shortener | topics/01-url-shortener.md |
β¬ Not Started |
| 2 | Design a Rate Limiter | topics/02-rate-limiter.md |
β¬ Not Started |
| 3 | Design a Key-Value Store | topics/03-key-value-store.md |
β¬ Not Started |
| 4 | Design a Unique ID Generator | topics/04-unique-id-generator.md |
β¬ Not Started |
#π‘ Product Systems
| # | Topic | Document | Status |
|---|---|---|---|
| 5 | Design Twitter / News Feed | topics/05-twitter-newsfeed.md |
β¬ Not Started |
| 6 | Design Instagram | topics/06-instagram.md |
β¬ Not Started |
| 7 | Design YouTube / Netflix | topics/07-video-streaming.md |
β¬ Not Started |
| 8 | Design WhatsApp / Chat System | topics/08-chat-system.md |
β¬ Not Started |
| 9 | Design Google Drive / Dropbox | topics/09-file-storage.md |
β¬ Not Started |
| 10 | Design Uber / Lyft | topics/10-ride-sharing.md |
β¬ Not Started |
| 11 | Design Amazon / E-Commerce | topics/11-ecommerce.md |
β Done |
#π΄ Advanced / Infrastructure
| # | Topic | Document | Status |
|---|---|---|---|
| 12 | Design a Web Crawler | topics/12-web-crawler.md |
β¬ Not Started |
| 13 | Design a Notification System | topics/13-notification-system.md |
β¬ Not Started |
| 14 | Design Search Autocomplete | topics/14-search-autocomplete.md |
β¬ Not Started |
| 15 | Design a Distributed Cache | topics/15-distributed-cache.md |
β¬ Not Started |
| 16 | Design a Task Scheduler | topics/16-task-scheduler.md |
β¬ Not Started |
| 17 | Design Google Maps | topics/17-maps-navigation.md |
β¬ Not Started |
| 18 | Design a Payment System | topics/18-payment-system.md |
β¬ Not Started |
#β« Expert-Level / Differentiators
| # | Topic | Document | Status |
|---|---|---|---|
| 19 | Design Google Docs (Collab Editor) | topics/19-collaborative-editor.md |
β¬ Not Started |
| 20 | Design a Distributed Message Queue | topics/20-message-queue.md |
β¬ Not Started |
| 21 | Design a Metrics/Monitoring System | topics/21-monitoring-system.md |
β¬ Not Started |
| 22 | Design a Distributed Consensus System | topics/22-consensus-system.md |
β¬ Not Started |
#π How to Use This Repo for Prep
#Daily Routine (Recommended)
1. Pick one topic from the index
2. Set a 45-minute timer
3. Attempt the design on paper/whiteboard FIRST
4. Then read the deep-dive document
5. Note gaps in your approach
6. Review the cross-references to reinforce connected concepts#Week Before the Interview
1. Review the Trade-off Summary tables across all topics
2. Practice the RESHADE framework on 2-3 random topics
3. Do a mock with a friend using the 45-Minute Blueprint
4. Review the Building Blocks Cheatsheet for quick recall#π Quick Reference Links
| Resource | Purpose |
|---|---|
| Building Blocks Reference | Component deep-dives |
| Concept Map | Cross-cutting concept connections |
| topics/ | All design documents |
Ready? Give me a one-liner and I'll generate the full design document. π