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

#TitleWhat You’re BuildingKey ConceptsStatusNotes
1Proximity ServiceYelp / Google Places — find nearby businessesGeohashing, QuadTree, read-heavy cache🟩 CompleteLocation-based foundation
2Nearby FriendsFacebook Nearby Friends — real-time location sharingWebSocket fan-out, Redis pub/sub, location update pipeline🟩 CompleteReal-time location
3Google MapsTurn-by-turn navigation and ETAGraph shortest path (Dijkstra/A*), map tiles, routing service🟩 CompleteMost complex location chapter
4Distributed Message QueueKafka-like durable message queuePartitioning, replication, consumer groups, offset management🟩 CompleteCore infrastructure
5Metrics MonitoringDatadog / Prometheus — collect and alert on metricsTime-series DB, pull vs push, alerting, downsampling🟩 CompleteObservability systems
6Ad Click AggregationReal-time ad click counter for billingStream processing, exactly-once semantics, time windowing🟩 CompleteFinancial-grade counting
7Hotel ReservationBooking.com — hotel inventory and bookingInventory locking, idempotency, overbooking prevention🟩 CompleteTransactional correctness
8Distributed EmailGmail-scale email serviceSMTP, MIME, storage tiers, search indexing🟩 CompleteProtocol-heavy design
9S3 Object StorageAmazon S3 — blob storage at exabyte scaleErasure coding, consistent hashing, metadata service🟩 CompleteStorage deep dive
10Gaming LeaderboardReal-time global game rankingRedis sorted sets, score updates, range queries🟩 CompleteData structure focused
11Payment SystemStripe-like payment processingIdempotency keys, exactly-once payment, PSP integration🟩 CompleteFinancial systems
12Digital WalletPayPal/Venmo wallet with transfersDistributed transactions, CQRS, event sourcing🟩 CompleteConsistency deep dive
13Stock ExchangeNYSE/NASDAQ matching engineOrder book, price-time priority, LMAX Disruptor, sequencer🟩 CompleteHardest chapter — extreme difficulty

Flashcards

ChapterFlashcard FileCard Count
Ch 1: Proximity Servicevol2-ch01-proximity-service.md~25 cards
Ch 2: Nearby Friendsvol2-ch02-nearby-friends.md~25 cards
Ch 3: Google Mapsvol2-ch03-google-maps.md~25 cards
Ch 4: Distributed Message Queuevol2-ch04-message-queue.md~25 cards
Ch 5: Metrics Monitoringvol2-ch05-metrics-monitoring.md~25 cards
Ch 6: Ad Click Aggregationvol2-ch06-ad-click-aggregation.md~25 cards
Ch 7: Hotel Reservationvol2-ch07-hotel-reservation.md~25 cards
Ch 8: Distributed Emailvol2-ch08-distributed-email.md~25 cards
Ch 9: S3 Object Storagevol2-ch09-s3-object-storage.md~25 cards
Ch 10: Gaming Leaderboardvol2-ch10-gaming-leaderboard.md~25 cards
Ch 11: Payment Systemvol2-ch11-payment-system.md~25 cards
Ch 12: Digital Walletvol2-ch12-digital-wallet.md~25 cards
Ch 13: Stock Exchangevol2-ch13-stock-exchange.md25 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

AspectVolume 1Volume 2
Primary focusInterview framework + foundational systemsAdvanced domain-specific systems
System typesGeneral-purpose (chat, URL shortener, CDN)Specialized (exchange, wallet, maps, S3)
DifficultyMedium (most chapters)Hard to Extreme
Latency requirementsMilliseconds to seconds acceptableMicroseconds to milliseconds (Ch 13)
Consistency emphasisBasic (eventual vs strong)Deep (distributed transactions, 2PC, Saga)
Protocol depthREST/HTTP assumedFIX, SMTP, S3 API, custom protocols
Data structuresStandard (queues, caches, DBs)Specialized (order book, QuadTree, sorted sets)
Regulatory constraintsNoneFinancial (Ch 11–13), compliance-driven design
Target engineer levelNew grad to mid-levelMid-level to senior/staff
Best used forBreadth preparationDeep dives into target domains

Study Path Recommendations

Targeting FAANG (General Senior Role)

Priority: Ch 4 → Ch 9 → Ch 5 → Ch 6 → Ch 3

ChapterWhy
Ch 4: Message QueueKafka internals — referenced in almost every system
Ch 9: S3 Object StorageStorage fundamentals + AWS focus
Ch 5: Metrics MonitoringInfra interviews at Google/Meta often cover observability
Ch 6: Ad Click AggregationStream processing with exactly-once semantics
Ch 3: Google MapsRouting + spatial systems, strong for Google

Targeting Fintech / Payment Companies (Stripe, Square, Robinhood, Coinbase)

Priority: Ch 11 → Ch 12 → Ch 13 → Ch 7 → Ch 6

ChapterWhy
Ch 11: Payment SystemCore domain for all payment companies
Ch 12: Digital WalletWallet balance, transfers, ledger design
Ch 13: Stock ExchangeRequired for trading platform roles
Ch 7: Hotel ReservationInventory and booking — analogous to order management
Ch 6: Ad Click AggregationFinancial-grade counting and aggregation

Targeting Location / Mapping Companies (Lyft, Uber, Google Maps, Waze)

Priority: Ch 1 → Ch 2 → Ch 3 → Ch 4 → Ch 5

ChapterWhy
Ch 1: Proximity ServiceFoundational geospatial search
Ch 2: Nearby FriendsReal-time location pipelines
Ch 3: Google MapsFull routing and navigation system
Ch 4: Message QueueLocation update pipelines use Kafka
Ch 5: Metrics MonitoringOperational 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

ChapterWhy
Ch 10: Gaming LeaderboardCore gaming infrastructure
Ch 2: Nearby FriendsReal-time pub/sub patterns
Ch 4: Message QueueGame event streaming
Ch 5: Metrics MonitoringPlayer health and game telemetry
Ch 6: Ad Click AggregationIn-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)
  • 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