System Design Interview – An Insider's Guide: Volume 2


System Design Interview – An Insider's Guide: Volume 2
Cover of System Design Interview – A...

It turned out to be much more than just another technical guide. The book is structured around real-world systems and design problems, breaking them down into approachable, well-reasoned solutions. Below, I’ve summarized some of the chapters that stood out to me most, along with key takeaways.

1. Proximity Service

The book kicks off with location-based systems, the kind that power “near me” features on Yelp or Google Maps. The challenge lies in efficiently querying two-dimensional spatial data (latitude and longitude).

Traditional indexes fall short here, so the book explores geospatial indexing methods:

  • Even grids: Divide the map into smaller cells. Simple, but uneven data distribution is a problem.
  • Geohash: Convert coordinates into a one-dimensional string. Elegant but suffers from boundary issues.
  • Quadtree: A recursive structure that subdivides space into quadrants for efficient searching.
  • Google S2: A geometry library that maps the globe onto a Hilbert curve for indexing.

2. Nearby Friends

The “Nearby Friends” feature (think Facebook or Snapchat) highlights how consistent hashing and hash rings can be applied to scale location-aware services.

3. Google Maps

This section explains how Google Maps projects our 3D globe onto a 2D plane. The chosen method, Web Mercator, is a modified Mercator projection that distorts distances near the poles but provides a practical compromise for global mapping.

4. Distributed Message Queues

This chapter does an excellent job contrasting message queues (RabbitMQ, ActiveMQ) with event streaming platforms (Kafka, Pulsar).Key concepts covered:

  • Messaging models: Point-to-point vs. publish-subscribe.
  • Partitions and brokers: How topics are sharded and distributed.
  • ZooKeeper: Why it was historically used for metadata and coordination in Kafka-like systems.

5. Metrics Monitoring & Alerting

Though less detailed, this chapter sets the stage for thinking about observability — monitoring, thresholds, and automated alerts that keep distributed systems healthy.

7. Hotel Reservation System

The double-booking problem is a classic concurrency challenge. The book compares:

  • Pessimistic locking: Lock a record until the transaction completes.
  • Optimistic locking: Rely on version numbers/timestamps to detect conflicts.
  • Database constraints: Enforce uniqueness at the schema level.

8. Distributed Email System

It covers the basics of email protocols (SMTP, POP, IMAP), attachment handling. The chapter also dives into anti-phishing measures:

  • Sender Policy Framework (SPF)
  • Domain Keys Identified Mail (DKIM)
  • Domain-based Message Authentication, Reporting and Conformance (DMARC)

9. S3-like Object Storage

The storage chapter explains the evolution from block storage -> file storage -> object storage. The discussion of erasure coding is a highlight, showing how redundancy and parity enable durability with less overhead than replication, though at the cost of higher computational complexity.

10. Real-Time Gaming Leaderboard

Competitive online games rely heavily on leaderboards that update in real time. The design challenge here is maintaining low latency while handling massive concurrency. Thousands or even millions of players update scores simultaneously. The chapter explores:

  • Efficient data structures (like sorted sets) for ranking players.
  • Sharding by player ID or region to distribute load.
  • Caching strategies (e.g., Redis) to speed up reads while ensuring writes remain consistent.
  • Eventual consistency trade-offs — sometimes users can tolerate a small lag in seeing score updates if it means the system scales reliably.

11. Payment System

Payments introduce the concept of exactly-once execution, which is notoriously hard to achieve in distributed environments. Mathematically, an operation is executed exactly-once if:

  1. It’s executed at-least-once (retry)
  2. At the same time, it’s executed at-most-once (idempotency)

By combining both, systems can ensure that money isn’t lost or duplicated.

  • Idempotency keys to detect duplicate requests.
  • Transaction logs to guarantee persistence and recovery after crashes.
  • Reconciliation processes to detect and correct rare mismatches.

12. Digital Wallet

Building on payments, the digital wallet chapter zooms in on distributed transactions — transferring money between accounts in a fault-tolerant way. The book covers three common patterns:

  • Two-Phase Commit (2PC): A classic approach where a coordinator ensures all participants either commit or roll back.
  • TCC (Try-Confirm/Cancel): A more flexible variation where each step has compensating actions.
  • Saga pattern: Breaks a transaction into a series of steps, each with a compensating transaction in case of failure.

13. Stock Exchange

The final chapter dives into ultra-low-latency systems, where microseconds matter. Stock exchanges are a perfect case study. One standout technique is memory-mapped files (mmap), which map files directly into a process’s memory space:

  • This allows processes to share memory without costly disk I/O.
  • When combined with /dev/shm (shared memory on Linux), it avoids disk access entirely.
  • The result: a high-performance message bus that can support the extreme throughput required in trading systems.

Summary

What I appreciate about System Design Interview: Volume 2 is how it blends fundamentals with practical examples. Each chapter feels like a guided design discussion, the kind you’d have on a whiteboard in a real interview (or at work).

The book isn’t just about “acing interviews”, it’s about learning how large-scale systems actually work. If you’re preparing for system design interviews, or if you simply enjoy understanding how modern software works under the hood, this book is worth your time.