Volume 2: System Design Interview — An Insider’s Guide
Authors: Alex Xu & Sahn Lam
Published: 2022
Focus: Advanced real-world systems with deep implementation details
Volume 2 picks up where Volume 1 left off, moving beyond foundational patterns into the kind of complex, domain-specific systems that appear in senior and staff-level interviews at top tech companies. Each chapter targets a real production system (Google Maps, S3, NYSE), dissects it component by component, and focuses on the hard technical trade-offs that separate a good answer from a great one. If Volume 1 is the interview framework, Volume 2 is its most demanding application.
Chapters
| # | Title | What You’re Building | Key Concepts | Status | Notes |
|---|---|---|---|---|---|
| 1 | Proximity Service | Yelp / Google Places — find nearby businesses | Geohashing, QuadTree, read-heavy cache | 🟩 Complete | Location-based foundation |
| 2 | Nearby Friends | Facebook Nearby Friends — real-time location sharing | WebSocket fan-out, Redis pub/sub, location update pipeline | 🟩 Complete | Real-time location |
| 3 | Google Maps | Turn-by-turn navigation and ETA | Graph shortest path (Dijkstra/A*), map tiles, routing service | 🟩 Complete | Most complex location chapter |
| 4 | Distributed Message Queue | Kafka-like durable message queue | Partitioning, replication, consumer groups, offset management | 🟩 Complete | Core infrastructure |
| 5 | Metrics Monitoring | Datadog / Prometheus — collect and alert on metrics | Time-series DB, pull vs push, alerting, downsampling | 🟩 Complete | Observability systems |
| 6 | Ad Click Aggregation | Real-time ad click counter for billing | Stream processing, exactly-once semantics, time windowing | 🟩 Complete | Financial-grade counting |
| 7 | Hotel Reservation | Booking.com — hotel inventory and booking | Inventory locking, idempotency, overbooking prevention | 🟩 Complete | Transactional correctness |
| 8 | Distributed Email | Gmail-scale email service | SMTP, MIME, storage tiers, search indexing | 🟩 Complete | Protocol-heavy design |
| 9 | S3 Object Storage | Amazon S3 — blob storage at exabyte scale | Erasure coding, consistent hashing, metadata service | 🟩 Complete | Storage deep dive |
| 10 | Gaming Leaderboard | Real-time global game ranking | Redis sorted sets, score updates, range queries | 🟩 Complete | Data structure focused |
| 11 | Payment System | Stripe-like payment processing | Idempotency keys, exactly-once payment, PSP integration | 🟩 Complete | Financial systems |
| 12 | Digital Wallet | PayPal/Venmo wallet with transfers | Distributed transactions, CQRS, event sourcing | 🟩 Complete | Consistency deep dive |
| 13 | Stock Exchange | NYSE/NASDAQ matching engine | Order book, price-time priority, LMAX Disruptor, sequencer | 🟩 Complete | Hardest chapter — extreme difficulty |
Flashcards
| Chapter | Flashcard File | Card Count |
|---|---|---|
| Ch 1: Proximity Service | vol2-ch01-proximity-service.md | ~25 cards |
| Ch 2: Nearby Friends | vol2-ch02-nearby-friends.md | ~25 cards |
| Ch 3: Google Maps | vol2-ch03-google-maps.md | ~25 cards |
| Ch 4: Distributed Message Queue | vol2-ch04-message-queue.md | ~25 cards |
| Ch 5: Metrics Monitoring | vol2-ch05-metrics-monitoring.md | ~25 cards |
| Ch 6: Ad Click Aggregation | vol2-ch06-ad-click-aggregation.md | ~25 cards |
| Ch 7: Hotel Reservation | vol2-ch07-hotel-reservation.md | ~25 cards |
| Ch 8: Distributed Email | vol2-ch08-distributed-email.md | ~25 cards |
| Ch 9: S3 Object Storage | vol2-ch09-s3-object-storage.md | ~25 cards |
| Ch 10: Gaming Leaderboard | vol2-ch10-gaming-leaderboard.md | ~25 cards |
| Ch 11: Payment System | vol2-ch11-payment-system.md | ~25 cards |
| Ch 12: Digital Wallet | vol2-ch12-digital-wallet.md | ~25 cards |
| Ch 13: Stock Exchange | vol2-ch13-stock-exchange.md | 25 cards |
Estimated total: ~325 flashcards across all 13 chapters
Key Themes in Volume 2
Location-Based Services (Ch 1–3)
- Geohashing and QuadTree for spatial indexing
- Read-heavy, cache-first architectures
- Real-time location updates via WebSocket
- Graph algorithms for routing (Dijkstra, A*)
- Map tile rendering and caching
Streaming and Real-Time Processing (Ch 4–6)
- Kafka-style distributed log partitioning and replication
- Time-series data storage and downsampling
- Stream processing with windowing (tumbling, sliding)
- Exactly-once delivery semantics
- Consumer group coordination and offset management
Transactional Systems and Correctness (Ch 7, 11–12)
- Idempotency keys to prevent duplicate operations
- Distributed transactions (2PC, Saga pattern)
- Inventory locking and overbooking prevention
- CQRS (Command Query Responsibility Segregation)
- Event sourcing for financial audit trails
Storage Systems (Ch 9)
- Erasure coding vs replication trade-offs
- Consistent hashing for object placement
- Metadata service design for billion-object namespaces
- Multi-tier storage (hot/warm/cold)
- Durability guarantees (11 nines = erasure coding)
Financial Systems (Ch 11–13)
- Payment processing and PSP (Payment Service Provider) integration
- Wallet ledger design and double-entry bookkeeping
- Stock exchange matching engine architecture
- Regulatory compliance via event sourcing
- Pre-trade and post-trade risk management
Sub-Millisecond Latency Systems (Ch 13)
- LMAX Disruptor (lock-free ring buffer)
- Kernel bypass networking (DPDK)
- Memory-mapped files for persistence
- CPU pinning, NUMA awareness
- Sequencer for deterministic ordering
How Volume 2 Differs from Volume 1
| Aspect | Volume 1 | Volume 2 |
|---|---|---|
| Primary focus | Interview framework + foundational systems | Advanced domain-specific systems |
| System types | General-purpose (chat, URL shortener, CDN) | Specialized (exchange, wallet, maps, S3) |
| Difficulty | Medium (most chapters) | Hard to Extreme |
| Latency requirements | Milliseconds to seconds acceptable | Microseconds to milliseconds (Ch 13) |
| Consistency emphasis | Basic (eventual vs strong) | Deep (distributed transactions, 2PC, Saga) |
| Protocol depth | REST/HTTP assumed | FIX, SMTP, S3 API, custom protocols |
| Data structures | Standard (queues, caches, DBs) | Specialized (order book, QuadTree, sorted sets) |
| Regulatory constraints | None | Financial (Ch 11–13), compliance-driven design |
| Target engineer level | New grad to mid-level | Mid-level to senior/staff |
| Best used for | Breadth preparation | Deep dives into target domains |
Study Path Recommendations
Targeting FAANG (General Senior Role)
Priority: Ch 4 → Ch 9 → Ch 5 → Ch 6 → Ch 3
| Chapter | Why |
|---|---|
| Ch 4: Message Queue | Kafka internals — referenced in almost every system |
| Ch 9: S3 Object Storage | Storage fundamentals + AWS focus |
| Ch 5: Metrics Monitoring | Infra interviews at Google/Meta often cover observability |
| Ch 6: Ad Click Aggregation | Stream processing with exactly-once semantics |
| Ch 3: Google Maps | Routing + spatial systems, strong for Google |
Targeting Fintech / Payment Companies (Stripe, Square, Robinhood, Coinbase)
Priority: Ch 11 → Ch 12 → Ch 13 → Ch 7 → Ch 6
| Chapter | Why |
|---|---|
| Ch 11: Payment System | Core domain for all payment companies |
| Ch 12: Digital Wallet | Wallet balance, transfers, ledger design |
| Ch 13: Stock Exchange | Required for trading platform roles |
| Ch 7: Hotel Reservation | Inventory and booking — analogous to order management |
| Ch 6: Ad Click Aggregation | Financial-grade counting and aggregation |
Targeting Location / Mapping Companies (Lyft, Uber, Google Maps, Waze)
Priority: Ch 1 → Ch 2 → Ch 3 → Ch 4 → Ch 5
| Chapter | Why |
|---|---|
| Ch 1: Proximity Service | Foundational geospatial search |
| Ch 2: Nearby Friends | Real-time location pipelines |
| Ch 3: Google Maps | Full routing and navigation system |
| Ch 4: Message Queue | Location update pipelines use Kafka |
| Ch 5: Metrics Monitoring | Operational excellence expected at these companies |
Targeting Real-Time / Gaming Companies (Roblox, Epic, Unity, Discord)
Priority: Ch 10 → Ch 2 → Ch 4 → Ch 5 → Ch 6
| Chapter | Why |
|---|---|
| Ch 10: Gaming Leaderboard | Core gaming infrastructure |
| Ch 2: Nearby Friends | Real-time pub/sub patterns |
| Ch 4: Message Queue | Game event streaming |
| Ch 5: Metrics Monitoring | Player health and game telemetry |
| Ch 6: Ad Click Aggregation | In-game analytics pipeline |
Prerequisites
Before diving into Volume 2, make sure you’re solid on:
From Volume 1 (Must-Know)
- Ch 1: Scaling from single server to multi-region (load balancers, CDN, sharding, replication)
- Ch 3: Interview framework (requirements → high-level → deep dive → wrap-up)
- Ch 4: Rate limiting (token bucket, sliding window — pattern reused in exchanges)
- Ch 5: Consistent hashing (used in Ch 9 S3, Ch 4 message queue)
- Ch 6: Key-value store (LSM tree, SSTable — foundational for storage chapters)
From DDIA (Recommended Background)
- Chapter 5: Replication (leader-follower, quorum, replication lag)
- Chapter 6: Partitioning (range vs hash, hot spots)
- Chapter 7: Transactions (ACID, 2PC, serializable isolation)
- Chapter 11: Stream processing (event sourcing, change data capture)
General Concepts
- TCP vs UDP trade-offs (comes up in Ch 2, 4, 13)
- SQL vs NoSQL decision framework (every chapter)
- CAP theorem and practical consistency models
- Message queue fundamentals (producer, consumer, topic, partition)
Progress Tracking
Use the status indicators from the main README:
- ⬜ Not started
- 🟨 Read, need more practice
- 🟦 Can explain, need to practice drawing
- 🟩 Interview ready
Update chapter file headers as you progress.
Last Updated: 2026-04-13