๐ŸŒ System Design ยท subject

System Design Fundamentals of System Design Syllabus

The Fundamentals of System Design syllabus for System Design in full: 5 chapters and 19 topics, every one listed below, plus 50 Fundamentals of System Design flashcards with answers.

5Chapters
19Topics
50Flashcards

Fundamentals of System Design syllabus: all 5 chapters

Expand any chapter to see its topics and sub-topics.

  1. Performance Metrics and Non-Functional Requirements

    4 topics
    • Latency vs Throughput
    • Availability and the Nines
    • Reliability and Fault Tolerance
    • Scalability, Maintainability, and Durability
  2. Scaling Strategies

    4 topics
    • Vertical Scaling (Scale Up)
    • Horizontal Scaling (Scale Out)
    • Stateless vs Stateful Services
    • Capacity Estimation and Back-of-the-Envelope Calculation
  3. The CAP and PACELC Theorems

    3 topics
    • Consistency, Availability, Partition Tolerance
    • Trade-offs in Distributed Systems
    • PACELC Extension
  4. Consistency Models

    4 topics
    • Strong Consistency
    • Eventual Consistency
    • Causal and Read-Your-Writes Consistency
    • Quorum-Based Consistency
  5. Networking Foundations

    4 topics
    • TCP/IP and UDP
    • HTTP/HTTPS and HTTP/2, HTTP/3
    • DNS and Domain Resolution
    • TLS and Public Key Infrastructure

System Design Fundamentals of System Design flashcards โ€” 50 questions with answers

  1. Define latency and throughput, and explain how they differ.

    Latency is the time to complete a single operation (e.g., request-to-response), measured in units of time such as $ms$. Throughput is the number of operations completed per unit time (e.g., requests/second). Latency measures delay; throughput measures capacity. They are related but not inverses โ€” a system can have high latency and high throughput simultaneously (e.g., a long pipeline with high concurrency).

  2. Why are percentiles (like p99) preferred over averages when measuring latency?

    Averages hide tail behavior; a few very slow requests can be masked by many fast ones. Percentiles describe the distribution: $p50$ (median) is typical experience, while $p99$ means 99% of requests are faster than this value, capturing the slow-tail experience real users hit. Tail latencies matter because a single user request often fans out to many backend calls, so the slowest component dominates.

  3. What does 'availability' mean and how is it quantified?

    Availability is the proportion of time a system is operational and able to serve requests. It is quantified as $$A = \frac{\text{Uptime}}{\text{Uptime} + \text{Downtime}}$$ usually expressed as a percentage or in 'nines' (e.g., 99.9%).

  4. What is 'the nines' of availability, and how much downtime per year does each level allow?

    'Nines' count the leading 9s in an availability percentage. Approximate annual downtime: two nines ($99\%$) $\approx 3.65$ days; three nines ($99.9\%$) $\approx 8.77$ hours; four nines ($99.99\%$) $\approx 52.6$ minutes; five nines ($99.999\%$) $\approx 5.26$ minutes per year.

  5. How do you compute allowed annual downtime from an availability percentage?

    Multiply the fraction of unavailability by the time in a year. With $525{,}600$ minutes per year: $$\text{Downtime} = (1 - A) \times 525{,}600 \text{ min}$$ For example, $A = 99.99\%$ gives $(1 - 0.9999) \times 525{,}600 \approx 52.6$ minutes.

  6. How does availability combine for components in series versus in parallel (redundant)?

    For $n$ components in series (all must work), total availability is the product: $A_{series} = \prod_{i=1}^{n} A_i$. For redundant components in parallel (at least one must work), unavailabilities multiply: $A_{parallel} = 1 - \prod_{i=1}^{n}(1 - A_i)$. Series lowers availability; parallel redundancy raises it.

  7. Define reliability and distinguish it from availability.

    Reliability is the probability that a system performs correctly without failure over a given period. Availability is the fraction of time it is up. A system can be available but unreliable (up, but returning wrong results), or reliable yet have low availability if repairs take long. Reliability emphasizes correctness over time; availability emphasizes accessibility.

  8. What is fault tolerance, and what is the difference between a fault, an error, and a failure?

    Fault tolerance is a system's ability to continue operating correctly despite faults in some components. A fault is a defect or deviation in a component; an error is an incorrect internal state caused by a fault; a failure is when the system deviates from its specified behavior visibly to users. Fault tolerance stops faults/errors from becoming failures, often via redundancy.

  9. Define MTBF, MTTR, and how they relate to availability.

    MTBF (Mean Time Between Failures) is average operational time between failures; MTTR (Mean Time To Repair) is average time to recover. Availability is $$A = \frac{\text{MTBF}}{\text{MTBF} + \text{MTTR}}$$ Higher MTBF and lower MTTR both increase availability.

  10. What is durability in the context of storage systems?

    Durability is the guarantee that once data is committed/written, it will not be lost โ€” surviving crashes, power loss, and hardware failures. It is often expressed in nines (e.g., '11 nines', $99.999999999\%$, meaning an extremely low probability of losing an object per year), achieved via replication, erasure coding, and write-ahead logs.

  11. Define scalability and distinguish vertical from horizontal scaling.

    Scalability is a system's ability to handle increased load by adding resources. Vertical scaling (scale up) adds more power (CPU, RAM) to a single machine. Horizontal scaling (scale out) adds more machines/nodes and distributes load among them. Horizontal scaling generally offers better fault tolerance and near-linear growth; vertical scaling is simpler but bounded by a single machine's limits.

  12. What is maintainability, and what three sub-properties commonly define it?

    Maintainability is how easily a system can be operated, understood, and evolved over time. It commonly comprises: operability (easy to keep running smoothly), simplicity (easy to understand, low accidental complexity), and evolvability/extensibility (easy to change and add features).

  13. List the main advantages and limits of vertical scaling (scale up).

    Advantages: simplicity (no distributed-systems complexity), no application changes needed, data stays on one node (easier consistency), lower latency for local operations. Limits: a hard ceiling set by the largest available machine, a single point of failure, and cost that grows non-linearly (high-end hardware is disproportionately expensive), plus downtime often required to upgrade.

  14. List the main advantages and challenges of horizontal scaling (scale out).

    Advantages: near-unlimited scaling by adding commodity nodes, better fault tolerance/redundancy, and often lower cost per unit of capacity. Challenges: data partitioning and rebalancing, distributed consistency, network overhead and partial failures, load balancing, and greater operational/architectural complexity.

  15. What is the difference between a stateless and a stateful service?

    A stateless service keeps no client-session state between requests; each request contains all needed information, so any instance can handle any request. A stateful service retains session/context data across requests, tying a client to specific state (and often a specific instance). Stateless services scale horizontally more easily and fail over trivially; stateful ones need sticky sessions or shared/replicated state.

  16. Why are stateless services easier to scale horizontally?

    Because any instance can serve any request, you can add or remove instances freely and place a load balancer in front without sticky sessions. There is no per-instance session data to migrate or replicate, so failover is trivial (a failed node's requests just go elsewhere). State is externalized to shared stores (databases, caches) rather than living in the app tier.

  17. How is state typically externalized to keep application servers stateless?

    By moving session and shared state out of the app tier into external stores: databases for durable data, distributed caches (e.g., Redis/Memcached) for sessions, object stores for files, and token-based auth (e.g., JWT) so the client carries identity. The app servers then hold no critical local state and become interchangeable.

  18. What is back-of-the-envelope (capacity) estimation and why is it used in system design?

    It is quick, rough calculation using order-of-magnitude approximations to size a system โ€” estimating QPS, storage, bandwidth, memory, and number of servers โ€” before detailed design. It validates feasibility, reveals bottlenecks, and guides architecture choices without needing precise numbers.

  19. List the common powers-of-ten and byte-size shortcuts used in capacity estimation.

    Time: 1 day $\approx 86{,}400 \approx 10^{5}$ seconds; 1 month $\approx 2.5 \times 10^{6}$ s. Data sizes: $\text{KB}=10^{3}$, $\text{MB}=10^{6}$, $\text{GB}=10^{9}$, $\text{TB}=10^{12}$, $\text{PB}=10^{15}$ bytes. A char $\approx 1$ byte; these let you convert daily volumes to per-second rates and storage quickly.

  20. How do you estimate write QPS from daily traffic, and derive peak QPS?

    Average QPS $= \dfrac{\text{requests per day}}{86{,}400}$. Peak QPS is estimated by multiplying average by a factor (commonly $2\times$ to $10\times$) to account for bursts: $\text{Peak QPS} \approx k \times \text{Average QPS}$. For example, $100$M requests/day gives $\approx 1{,}157$ QPS average, so peak $\approx 2{,}300$โ€“$11{,}000$ QPS.

Show the other 30 Fundamentals of System Design flashcards
  1. How do you estimate storage needed per year for a stream of writes?

    $$\text{Storage/year} = \text{writes per day} \times \text{bytes per write} \times 365$$ Then multiply by a replication factor if data is replicated. E.g., $1$M writes/day $\times 1\,\text{KB} \times 365 \approx 365\,\text{GB/year}$ before replication.

  2. State the CAP theorem and name its three properties.

    CAP theorem: a distributed data store can simultaneously guarantee at most two of three properties โ€” Consistency (every read sees the latest write), Availability (every request gets a non-error response), and Partition tolerance (system keeps working despite network partitions). Since network partitions are unavoidable, real systems must trade off between C and A during a partition.

  3. During a network partition, what choice does CAP force, and what are the two resulting system types?

    When a partition occurs, a system must choose between consistency and availability. A CP system rejects/blocks requests that can't be made consistent (sacrificing availability) to avoid stale/conflicting data. An AP system keeps serving requests on both sides (sacrificing consistency), accepting possibly stale data and reconciling later.

  4. Give examples of CP versus AP systems.

    CP (favor consistency during partitions): traditional RDBMS with synchronous replication, HBase, MongoDB (default), ZooKeeper, etcd. AP (favor availability during partitions): Cassandra, DynamoDB, Riak, CouchDB. The classification reflects behavior under partition, not absolute categorization.

  5. State the PACELC theorem and what it adds beyond CAP.

    PACELC extends CAP: if there is a Partition (P), trade off between Availability (A) and Consistency (C); Else (E), when running normally, trade off between Latency (L) and Consistency (C). It captures that even without partitions, systems trade latency against consistency โ€” something CAP ignores.

  6. Classify Dynamo-style and traditional systems using PACELC notation.

    PACELC labels a system by both trade-offs. Cassandra/DynamoDB are typically PA/EL (favor availability under partition, latency otherwise). A fully consistent system like a traditional RDBMS or MongoDB is PC/EC (favor consistency in both cases). Some are PA/EC or PC/EL depending on tuning.

  7. Define strong consistency and its main cost.

    Strong consistency guarantees that after a write completes, all subsequent reads (from any node) return that write or a newer one โ€” the system behaves as if there is a single up-to-date copy (linearizability). Its cost is higher latency and reduced availability, because writes must be coordinated/replicated synchronously across nodes before acknowledging.

  8. What is linearizability?

    Linearizability is the strongest single-object consistency model: every operation appears to take effect atomically at some instant between its invocation and completion, and once a read returns a value, all later reads return that value or a newer one. It provides a real-time ordering guarantee, making the system appear as a single, up-to-date copy of the data.

  9. Define eventual consistency and when it is appropriate.

    Eventual consistency guarantees that, if no new updates are made, all replicas will eventually converge to the same value โ€” but reads may temporarily return stale data. It suits high-availability, high-throughput systems where temporary staleness is acceptable (e.g., DNS, social media feeds, shopping-cart counts) and offers low latency and partition tolerance.

  10. What is causal consistency and what does it preserve?

    Causal consistency ensures that operations causally related (one could have influenced another, per the happens-before relation) are seen by all processes in the same order; concurrent (unrelated) operations may be seen in different orders. It preserves cause-and-effect ordering โ€” e.g., a reply is never seen before the message it answers โ€” while being weaker (and more available) than strong consistency.

  11. What is read-your-writes consistency?

    Read-your-writes (read-your-own-writes) consistency guarantees that after a process writes a value, its own subsequent reads always reflect that write (never an older value). It is a session/client-centric guarantee that prevents a user from, e.g., updating their profile and then seeing the old version, even in an otherwise eventually consistent system.

  12. Name common client-centric (session) consistency guarantees.

    Read-your-writes (see your own updates), monotonic reads (never see data go backward in time), monotonic writes (your writes are applied in order), and writes-follow-reads/causal (a write after a read is ordered after the value read). These provide intuitive per-session guarantees on top of eventually consistent stores.

  13. Explain quorum-based consistency and the formula for strong consistency.

    With $N$ replicas, a read must contact $R$ replicas and a write must be acknowledged by $W$ replicas. Strong consistency is guaranteed when reads and writes overlap: $$R + W > N$$ ensuring any read quorum intersects the latest write quorum. Also requiring $W > N/2$ prevents conflicting concurrent writes.

  14. In quorum systems, how do you tune $R$ and $W$ for read-heavy versus write-heavy workloads?

    For fast reads (read-heavy): set $R$ small and $W$ large (e.g., $W = N$, $R = 1$) so reads are cheap while still satisfying $R+W>N$. For fast writes (write-heavy): set $W$ small and $R$ large (e.g., $W=1$, $R=N$). Lowering both below the $R+W>N$ threshold sacrifices strong consistency for lower latency/higher availability.

  15. Compare TCP and UDP across reliability, ordering, connection, and use cases.

    TCP is connection-oriented, reliable (acknowledgements + retransmission), ordered, flow- and congestion-controlled, with higher overhead โ€” used for web, email, file transfer. UDP is connectionless, unreliable (no ACK/retransmit), unordered, with minimal overhead and lower latency โ€” used for streaming, VoIP, gaming, and DNS queries.

  16. Describe the TCP three-way handshake.

    To establish a connection: (1) client sends SYN with an initial sequence number; (2) server replies SYN-ACK (its own SYN plus ACK of the client's); (3) client sends ACK. After these three messages both sides have synchronized sequence numbers and the connection is established. Sequence: $\text{SYN} \to \text{SYN{-}ACK} \to \text{ACK}$.

  17. Where do TCP, UDP, and IP sit in the TCP/IP model, and what does each layer do?

    IP is at the Internet (network) layer: logical addressing and routing of packets between hosts (best-effort, connectionless). TCP and UDP are at the Transport layer: process-to-process delivery via ports โ€” TCP adds reliability/ordering, UDP is minimal. Above them is the Application layer (HTTP, DNS, etc.); below is the Link layer (Ethernet, Wi-Fi).

  18. What is the difference between HTTP and HTTPS?

    HTTP is a stateless, text-based application-layer request/response protocol, transmitted in plaintext (default port 80). HTTPS is HTTP layered over TLS/SSL (default port 443), providing encryption (confidentiality), integrity, and server authentication via certificates. HTTPS prevents eavesdropping and tampering; HTTP does not.

  19. List the main HTTP methods and whether they are idempotent/safe.

    GET (safe, idempotent โ€” retrieve), HEAD (safe, idempotent โ€” headers only), PUT (idempotent โ€” replace), DELETE (idempotent โ€” remove), POST (not idempotent โ€” create/submit), PATCH (not necessarily idempotent โ€” partial update), OPTIONS (safe). Safe = no state change; idempotent = repeating has the same effect as once.

  20. Summarize the HTTP status code classes.

    1xx Informational; 2xx Success (e.g., 200 OK, 201 Created, 204 No Content); 3xx Redirection (301 Moved Permanently, 302 Found, 304 Not Modified); 4xx Client Error (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests); 5xx Server Error (500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout).

  21. What key improvements did HTTP/2 introduce over HTTP/1.1?

    HTTP/2 added: multiplexing (many concurrent streams over one TCP connection, eliminating head-of-line blocking at the HTTP layer), binary framing (vs text), header compression (HPACK), stream prioritization, and server push. It reduces latency and connection overhead while remaining semantically compatible with HTTP/1.1.

  22. What problem does HTTP/2 still have, and how does HTTP/3 solve it?

    HTTP/2 multiplexes streams over a single TCP connection, so a lost TCP packet stalls all streams (TCP head-of-line blocking). HTTP/3 runs over QUIC (built on UDP), which provides independent streams so packet loss affects only one stream. QUIC also integrates TLS 1.3 for faster (often 0-RTT) connection setup and supports connection migration across network changes.

  23. What is QUIC and why does it use UDP?

    QUIC is a transport protocol (the basis of HTTP/3) implemented on top of UDP in user space. It uses UDP to avoid TCP's kernel-level head-of-line blocking and to enable rapid iteration/deployment, while itself providing reliability, congestion control, per-stream ordering, built-in TLS 1.3 encryption, faster handshakes (0-/1-RTT), and connection migration via connection IDs.

  24. What is DNS and what problem does it solve?

    DNS (Domain Name System) is the distributed, hierarchical naming system that translates human-readable domain names (e.g., example.com) into IP addresses (e.g., 93.184.216.34) that machines use to route traffic. It acts as the internet's phone book, decoupling stable names from changeable IPs.

  25. Describe the steps of recursive DNS resolution.

    On a cache miss, a recursive resolver queries: (1) a root nameserver, which returns the TLD server for the extension (e.g., .com); (2) the TLD nameserver, which returns the authoritative nameserver for the domain; (3) the authoritative nameserver, which returns the actual record (e.g., A record with the IP). The resolver caches results (per TTL) and returns the IP to the client.

  26. Explain the DNS server hierarchy: resolver, root, TLD, authoritative.

    Recursive resolver: queries on the client's behalf and caches answers. Root nameservers: top of the hierarchy; direct queries to the correct TLD servers. TLD nameservers: manage a top-level domain (.com, .org, .net) and point to authoritative servers. Authoritative nameservers: hold the actual DNS records for a domain and give the definitive answer.

  27. Define common DNS record types: A, AAAA, CNAME, MX, NS, TXT.

    A: maps a name to an IPv4 address. AAAA: maps a name to an IPv6 address. CNAME: aliases one name to another canonical name. MX: mail exchange server for the domain (with priority). NS: delegates a zone to authoritative nameservers. TXT: arbitrary text, used for verification and email auth (SPF, DKIM, DMARC).

  28. What is DNS TTL and how does caching affect propagation?

    TTL (Time To Live) is the number of seconds a DNS record may be cached by resolvers before it must be re-fetched. High TTL improves performance and reduces lookups but slows propagation of changes; low TTL speeds propagation of updates (e.g., for failover) at the cost of more frequent queries. 'DNS propagation delay' after a change is bounded by the old record's TTL.

  29. How can DNS be used for load balancing and high availability?

    DNS can return multiple A records (round-robin) to distribute clients across servers, use geo-/latency-based routing to send users to the nearest region, and support failover by lowering TTL and updating records to healthy endpoints. Weighted records enable canary/gradual rollouts. Limitations include client caching and coarse-grained control compared to L4/L7 load balancers.

  30. Compare strong versus eventual consistency across guarantees, latency, and availability.

    Strong consistency: reads always see the latest write (single-copy illusion), but higher write latency and lower availability under partitions (tends toward CP). Eventual consistency: reads may be stale but replicas converge over time, giving lower latency and higher availability/partition tolerance (tends toward AP). The choice trades data freshness against performance and uptime.

System Design Fundamentals of System Design FAQ

What is in the System Design Fundamentals of System Design syllabus?

System Design Fundamentals of System Design is split into 5 chapters: Performance Metrics and Non-Functional Requirements, Scaling Strategies, The CAP and PACELC Theorems, Consistency Models and Networking Foundations. Together they contain 19 topics.

How many chapters are in System Design Fundamentals of System Design?

5 chapters, containing 19 topics. The largest chapter is Performance Metrics and Non-Functional Requirements, with 4 topics.

Are there flashcards for System Design Fundamentals of System Design?

Yes โ€” a 50-card Fundamentals of System Design deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.