Skip to content

System Design Interview Cheat Sheet: Patterns & Formulas

CoreConceptAugust 1, 20263 min read

System design interviews evaluate a candidate's ability to architect scalable, resilient, and cost-effective distributed systems under real-world constraints. Success requires mastering back-of-the-envelope capacity estimations, understanding hardware latency numbers, and selecting appropriate architectural patterns for data storage, caching, and load distribution.

This cheat sheet serves as a definitive reference for engineering interviews and production system design, summarizing essential estimation formulas, latency numbers every programmer should know, and core distributed systems patterns.

Latency Numbers Every Programmer Should Know

Accurate back-of-the-envelope calculations require memorizing fundamental hardware and network latency magnitudes. Comparing L1 cache access times (nanoseconds) with network round-trips across oceans (milliseconds) informs decisions on caching layers, database indexing, and edge computing deployment.

When designing high-throughput APIs, minimizing disk I/O and network hops is paramount. For instance, reading 1 MB sequentially from RAM takes ~250 microseconds, whereas reading 1 MB sequentially from a fast NVMe SSD takes ~1,000 microseconds, and an internet packet round-trip from California to Europe takes ~150 milliseconds.

Quick reference

  • Memory (RAM) access is ~10,000x faster than disk access; always place hot metadata in Redis or in-memory caches.
  • An internet round-trip across continents adds 150ms of unpreventable latency; deploy CDN edge points for global users.
  • Assume 86,400 seconds per day (~100,000 for simplified mental estimation during quick interview calculations).
Hardware & Network Latency Reference Table
1+-----------------------------------------+--------------------+2| Operation                               | Latency Time       |3+-----------------------------------------+--------------------+4| L1 Cache Reference                      | 0.5 ns             |5| Branch Mispredict                       | 5 ns               |6| L2 Cache Reference                      | 7 ns               |7| Mutex Lock / Unlock                     | 25 ns              |8| Main Memory (RAM) Reference             | 100 ns             |9| Read 1 MB sequentially from RAM         | 250,000 ns (250 µs)|10| Read 1 MB sequentially from NVMe SSD    | 1,000,000 ns (1 ms)|11| Network Packet SF to NYC                | 40 ms              |12| Network Packet SF to London (Trans-Atl) | 150 ms             |13+-----------------------------------------+--------------------+
Back-of-the-Envelope Capacity Estimation Formula
1// Standard QPS & Bandwidth Calculation in TypeScript2function calculateSystemRequirements(dailyActiveUsers: number, requestsPerUserDay: number, payloadSizeBytes: number) {3  const totalDailyRequests = dailyActiveUsers * requestsPerUserDay;4  const averageQPS = Math.round(totalDailyRequests / 86400);5  const peakQPS = averageQPS * 2; // Standard 2x peak safety factor6  const dailyDataBytes = totalDailyRequests * payloadSizeBytes;7  const storage5YearsBytes = dailyDataBytes * 365 * 5;8 9  return {10    averageQPS,11    peakQPS,12    dailyBandwidthMBps: (peakQPS * payloadSizeBytes) / (1024 * 1024),13    storage5YearsTB: storage5YearsBytes / (1024 ** 4)14  };15}16 17console.log(calculateSystemRequirements(10_000_000, 10, 500));

Remember this

Memorizing latency magnitudes allows you to quickly justify architectural choices like caching, CDN placement, and database selection.

Capacity Estimation & Storage Calculation Rules

Back-of-the-envelope calculations demonstrate technical maturity during system design interviews. Interviewers evaluate whether candidates can translate product requirements (e.g., '10 million daily active users uploading 2 photos per day') into concrete bandwidth, QPS, and storage disk requirements.

A helpful rule of thumb: 1 million daily active users issuing 10 requests per day generates ~115 average QPS. At peak load (typically 2x average), plan for ~230 peak QPS. Multiply peak QPS by request payload size to determine network ingress and egress bandwidth.

Quick reference

  • 1 Million Requests / Day ≈ 12 Requests / Second (10,000,000 requests/day ≈ 115 QPS).
  • Always calculate storage for a 5-year retention period to evaluate long-term database sharding needs.
  • Account for database index overhead (add 20–30% to raw storage estimates) and replica multiplier (3x for primary-replica setups).

Remember this

Translate user metrics into QPS, peak bandwidth, and 5-year storage projections to justify database sharding and caching strategies.

Core Architectural Decision Matrix for Interviews

Every system design trade-off maps back to fundamental computer science principles: Consistency vs. Availability (CAP Theorem), SQL vs. NoSQL (Database Selection), and Polling vs. WebSockets (Real-Time Communications).

When designing high-throughput applications, apply layered defense: place a global CDN in front of an L7 Load Balancer, route read requests through Redis caches using Cache-Aside patterns, write mutative events to Kafka queues via the Transactional Outbox pattern, and execute async worker jobs across stateless microservices.

Quick reference

  • Use Load Balancers (L4 for TCP level, L7 for HTTP routing) to distribute incoming traffic across stateless worker instances.
  • Implement Rate Limiting (Token Bucket or Leaky Bucket algorithms) at the API Gateway to protect downstream microservices.
  • Decouple synchronous write operations using message queues (Kafka or RabbitMQ) for asynchronous worker processing.

Remember this

Building scalable systems requires combining CDN edge caching, L7 load balancing, database sharding, and asynchronous event queues.

Key takeaway

Mastering system design requires combining back-of-the-envelope estimation formulas, latency awareness, and proven architectural patterns. By evaluating capacity requirements upfront and selecting appropriate caching, database, and messaging layers, developers build resilient systems that perform under enterprise traffic loads.

Share:

Related Articles

This guide is for backend engineers who know HTTP and database transactions but need to decide where six microservice pa

Read

A dashboard can look “fast” while users still wait, and a load test can report huge requests-per-second while p99 checko

Read

RabbitMQ is a broker: producers publish messages; exchanges route them; queues buffer work; consumers process and acknow

Read

Keep learning

Follow a structured path or browse all courses to go deeper.