--- 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 Pin down the functional requirements (what the system does) and the non-functional ones (latency, availability, consistency, scale) before drawing anything. Size the traffic, storage and bandwidth with back-of-the-envelope numbers, so later choices have a reason. Define the endpoints and the entities they read and write. Draw the request path end to end: clients, load balancers, services, caches, stores and queues. Take the hardest part (a hot key, fan-out, a consistency guarantee) and work through its tradeoffs. ## Foundations From one server to millions of users. Back-of-the-envelope QPS and storage. The four steps of the interview. ## Core designs Token and leaking buckets, windows. Hash rings and virtual nodes. Quorums, vector clocks, gossip. Snowflake and its alternatives. Base 62 and redirects. The URL frontier and politeness. Push, SMS and email at scale. Fanout on write and on read. WebSockets and presence. Tries and top-k prefixes. Upload, transcode, stream. Block storage and sync. ## Advanced designs Geohash, quadtrees, S2. Live locations over pub/sub. Tiles, routing and ETAs. Partitions and consumer groups. Time series and alerting. Exactly-once stream counts. Inventory without double booking. Mail storage and search. Erasure coding and metadata. Redis sorted sets. Ledgers and reconciliation. Distributed transactions, event sourcing. Order books and sequencers.