---
title: System Design
description: "Notes on System Design Interview — An Insider's Guide (Volumes 1 and 2): how to scope a problem, size it, and pick the parts that carry the load."
icon: network
---

These notes follow Alex Xu's [System Design Interview — An Insider's Guide](https://bytebytego.com/courses/system-design-interview), [Volumes 1 and 2](https://www.goodreads.com/book/show/54109255-system-design-interview-an-insider-s-guide).

:::note
These notes are a work in progress.
:::

## How an interview runs

1. **Requirements**

    Pin down the functional requirements (what the system does) and the non-functional ones (latency, availability, consistency, scale) before drawing anything.

2. **Estimates**

    Size the traffic, storage and bandwidth with back-of-the-envelope numbers, so later choices have a reason.

3. **API and data model**

    Define the endpoints and the entities they read and write.

4. **High-level design**

    Draw the request path end to end: clients, load balancers, services, caches, stores and queues.

5. **Deep dives**

    Take the hardest part (a hot key, fan-out, a consistency guarantee) and work through its tradeoffs.

## Foundations

**[Scaling](/system-design/scaling)**

From one server to millions of users.

**[Estimation](/system-design/back-of-the-envelope-estimation)**

Back-of-the-envelope QPS and storage.

**[Interview Framework](/system-design/interview-framework)**

The four steps of the interview.

## Core designs

**[Rate Limiter](/system-design/rate-limiter)**

Token and leaking buckets, windows.

**[Consistent Hashing](/system-design/consistent-hashing)**

Hash rings and virtual nodes.

**[Key-Value Store](/system-design/key-value-store)**

Quorums, vector clocks, gossip.

**[Unique ID Generator](/system-design/unique-id-generator)**

Snowflake and its alternatives.

**[URL Shortener](/system-design/url-shortener)**

Base 62 and redirects.

**[Web Crawler](/system-design/web-crawler)**

The URL frontier and politeness.

**[Notification System](/system-design/notification-system)**

Push, SMS and email at scale.

**[News Feed System](/system-design/news-feed-system)**

Fanout on write and on read.

**[Chat System](/system-design/chat-system)**

WebSockets and presence.

**[Search Autocomplete](/system-design/search-autocomplete)**

Tries and top-k prefixes.

**[YouTube](/system-design/youtube)**

Upload, transcode, stream.

**[Google Drive](/system-design/google-drive)**

Block storage and sync.

## Advanced designs

**[Proximity Service](/system-design/proximity-service)**

Geohash, quadtrees, S2.

**[Nearby Friends](/system-design/nearby-friends)**

Live locations over pub/sub.

**[Google Maps](/system-design/google-maps)**

Tiles, routing and ETAs.

**[Distributed Message Queue](/system-design/distributed-message-queue)**

Partitions and consumer groups.

**[Metrics Monitoring](/system-design/metrics-monitoring)**

Time series and alerting.

**[Ad Click Aggregation](/system-design/ad-click-event-aggregation)**

Exactly-once stream counts.

**[Hotel Reservation](/system-design/hotel-reservation-system)**

Inventory without double booking.

**[Email Service](/system-design/distributed-email-service)**

Mail storage and search.

**[S3-like Object Storage](/system-design/s3-object-storage)**

Erasure coding and metadata.

**[Gaming Leaderboard](/system-design/gaming-leaderboard)**

Redis sorted sets.

**[Payment System](/system-design/payment-system)**

Ledgers and reconciliation.

**[Digital Wallet](/system-design/digital-wallet)**

Distributed transactions, event sourcing.

**[Stock Exchange](/system-design/stock-exchange)**

Order books and sequencers.
