#πŸ—οΈ 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

  1. How This Repository Works
  2. Interview Framework β€” The FAANG Method
  3. What Interviewers Actually Evaluate
  4. The 45-Minute Blueprint
  5. Question Framing β€” How FAANG Asks Questions
  6. Answering Strategy β€” The Candidate's Playbook
  7. Core Building Blocks Cheatsheet
  8. Design Document Template
  9. Cross-Cutting Notes & Concept Map
  10. 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

#3. UI Friendliness

#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

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

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. πŸš€