MindForge
MindForge
DashboardHelp & Support
Dashboard
MindForge

Interview Preparation Bootcamp

Course progress

0%
0 of 177 modules complete
Start Here0/1
  • How to Use This Course
Data Structures & Algorithms0/27
  • Arrays and Hashing
  • Two Pointers
  • Sliding Window
  • Sliding Window: Harder Problems
  • Binary Search
  • Stacks
  • Practice Test: Arrays, Pointers, Windows, Search and Stacks
  • Trees: Traversals and Core Patterns
  • Binary Search Trees and Rebuilding a Tree
  • Tries (Prefix Trees)
  • Heaps and Priority Queues
  • Graphs: BFS and DFS
  • Topological Sort and Cycle Detection
  • Union-Find (Disjoint Set Union)
  • Practice Test: Trees, Heaps and Graphs
  • Dynamic Programming Basics
  • Dynamic Programming: Two Dimensions
  • Dynamic Programming: Hard String Matching
  • Backtracking
  • Backtracking: Constraint Satisfaction
  • Greedy Algorithms
  • Interval Problems
  • Bit Manipulation
  • Math and Geometry
  • String Manipulation
  • Pattern Recall and Mock Coding Rounds
  • Practice Test: DP, Backtracking, Greedy and More

System Design

Foundations0/16
  • The System Design Interview Framework
  • Back-of-the-Envelope Estimation
  • Networking and Protocols for Design
  • API Design and Idempotency
  • Load Balancing, Proxies, and Scaling Out
  • Caching and CDNs
  • Choosing a Database: Storage, Indexes and Transactions
  • Replication, Partitioning, and Sharding
  • CAP, PACELC, and Levels of Consistency
  • Messaging, Queues, and Event-Driven Architecture
  • Distributed Transactions and Data Integrity
  • Coordination, Consensus, and Distributed Locks
  • Reliability, Resilience, and Rate Limiting
  • Observability, Security, and Cost
  • System Design Cheat Sheet
  • Practice Test: System Design Foundations
Case Studies0/23
  • Design a URL Shortener
  • Design a Rate Limiter
  • Design a Notification Service
  • Design a Job Queue System
  • Design a Chat App (WhatsApp)
  • Design an Analytics Pipeline
  • Design a Multi-tenant SaaS Architecture
  • Design a Social Media Feed (Twitter/X)
  • Design a Search Autocomplete System
  • Design a File Storage Service (Dropbox)
  • Design Google Docs
  • Design a Code Review System
  • Design Netflix
  • Design YouTube
  • Design Spotify
  • Design Uber/Lyft
  • Design Airbnb
  • Design Ticketmaster (Eventbrite)
  • Design an E-commerce Cart, Checkout, and Catalog
  • Design a Payment System
  • Design a Logging and Monitoring System
  • Mock Design Rounds
  • Practice Test: System Design Case Studies
Low-Level Design0/19
  • The LLD Interview Framework and UML
  • OOP Foundations for Design
  • SOLID Principles
  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns I — Strategy, Observer, Command, State, Template Method
  • Behavioral Patterns II and Anti-Patterns
  • Concurrency in Low-Level Design
  • Design a Parking Lot
  • Design an Elevator System
  • Design a Movie Ticket Booking System
  • Design an Expense-Sharing App (Splitwise)
  • Design a Vending Machine and an ATM
  • Design a Rate Limiter and a Logging Framework
  • Design a Notification Service and an In-Memory Cache
  • Design Games — Tic-Tac-Toe, Snake and Ladder, Chess
  • Database Design for LLD
  • LLD Cheat Sheet and Recall Drill
  • Practice Test: Low-Level Design

Backend

Python0/5
  • How Python Runs Your Code
  • Functions Deep Dive: Closures, Generators, Context Managers, Scope
  • Classes Deep Dive: Method Types, MRO, Metaclasses
  • Standard Library and Serialization
  • Practice Test: Python
Django0/6
  • Django Request Lifecycle
  • Lab: Django Middleware — Request ID & Response Time
  • Django ORM and Querysets
  • Django's Cache Framework
  • Practice Test: Django
  • Django in Production: Debugging Labs
FastAPI0/5
  • FastAPI, ASGI, and Async
  • FastAPI Dependency Injection
  • FastAPI Background Tasks
  • Lab: FastAPI Async — Concurrent Aggregation
  • Practice Test: FastAPI
Databases (PostgreSQL)0/6
  • Indexing
  • Query Optimization
  • Transactions and Isolation
  • Migrations and Schema Changes
  • Hierarchical Data and Safe Concurrent Updates
  • Practice Test: Databases
Caching, Queues & Distributed Systems0/8
  • Redis Caching
  • Redis Advanced Patterns
  • Celery and Background Workers
  • Kafka and Message Queues
  • Async Pipelines
  • Distributed Systems Basics
  • Distributed Locks
  • Practice Test: Caching, Queues and Distributed Systems
APIs, Security & Deployment0/9
  • REST API Design
  • API Versioning and Error Handling
  • API Security and Authentication
  • WebSockets and Real-Time Systems
  • Docker and Containers
  • File Storage with S3
  • Testing Strategies
  • Mock Backend Round
  • Practice Test: APIs, Security and Deployment
Frontend0/38
  • HTML Document Structure and Semantics
  • CSS Box Model, Flexbox and Grid
  • CSS Architecture and Theming
  • CSS and Rendering Performance
  • Variables, Scope, Hoisting, and Truthiness
  • Functions, this, and Binding
  • Objects and Prototypal Inheritance
  • JavaScript Utility Patterns: Cloning, Caching, and Memory
  • Promises From Scratch
  • The Event Loop and Browser Rendering Pipeline
  • The DOM: Nodes, Events, and Traversal
  • Practice Test: HTML, CSS and JavaScript
  • React Rendering Fundamentals
  • React Hooks Internals
  • React Performance
  • Lab: React — Stateful Counter Component
  • State Management
  • State Machines in React
  • React Custom Hooks and Composition Patterns
  • TypeScript for React
  • React Testing
  • Practice Test: React
  • HTTP and Caching
  • Network Performance and Web Vitals
  • Code Splitting and Bundles
  • Virtualization
  • GraphQL and Data Fetching
  • Web Security
  • WebSockets and Real-time
  • SSR and Next.js
  • Micro-frontends
  • Build Tools and Bundling
  • Accessibility
  • Error Handling
  • Internationalization
  • Animation
  • Rapid Recall and Mock Frontend Rounds
  • Practice Test: Performance, Architecture and Production
Behavioral & Interview Day0/14
  • Resume and Project Walkthroughs
  • The STAR Method and Refining Your Stories
  • Conflict and Difficult Coworkers
  • Failures, Incidents, and Obstacles
  • Leadership, Mentorship, and Ownership
  • Teamwork, Communication, and Feedback
  • Growth and Handling Ambiguity
  • Career Goals, Why This Company, and Negotiation
  • Situational Questions
  • Company Research
  • Mock Behavioral Rounds
  • Interview Day
  • After the Interview
  • Practice Test: Behavioral and Interview Day
Back-of-the-Envelope Estimation
Course contents

Interview Preparation Bootcamp

Course progress

0%
0 of 177 modules complete
Start Here0/1
  • How to Use This Course
Data Structures & Algorithms0/27
  • Arrays and Hashing
  • Two Pointers
  • Sliding Window
  • Sliding Window: Harder Problems
  • Binary Search
  • Stacks
  • Practice Test: Arrays, Pointers, Windows, Search and Stacks
  • Trees: Traversals and Core Patterns
  • Binary Search Trees and Rebuilding a Tree
  • Tries (Prefix Trees)
  • Heaps and Priority Queues
  • Graphs: BFS and DFS
  • Topological Sort and Cycle Detection
  • Union-Find (Disjoint Set Union)
  • Practice Test: Trees, Heaps and Graphs
  • Dynamic Programming Basics
  • Dynamic Programming: Two Dimensions
  • Dynamic Programming: Hard String Matching
  • Backtracking
  • Backtracking: Constraint Satisfaction
  • Greedy Algorithms
  • Interval Problems
  • Bit Manipulation
  • Math and Geometry
  • String Manipulation
  • Pattern Recall and Mock Coding Rounds
  • Practice Test: DP, Backtracking, Greedy and More

System Design

Foundations0/16
  • The System Design Interview Framework
  • Back-of-the-Envelope Estimation
  • Networking and Protocols for Design
  • API Design and Idempotency
  • Load Balancing, Proxies, and Scaling Out
  • Caching and CDNs
  • Choosing a Database: Storage, Indexes and Transactions
  • Replication, Partitioning, and Sharding
  • CAP, PACELC, and Levels of Consistency
  • Messaging, Queues, and Event-Driven Architecture
  • Distributed Transactions and Data Integrity
  • Coordination, Consensus, and Distributed Locks
  • Reliability, Resilience, and Rate Limiting
  • Observability, Security, and Cost
  • System Design Cheat Sheet
  • Practice Test: System Design Foundations
Case Studies0/23
  • Design a URL Shortener
  • Design a Rate Limiter
  • Design a Notification Service
  • Design a Job Queue System
  • Design a Chat App (WhatsApp)
  • Design an Analytics Pipeline
  • Design a Multi-tenant SaaS Architecture
  • Design a Social Media Feed (Twitter/X)
  • Design a Search Autocomplete System
  • Design a File Storage Service (Dropbox)
  • Design Google Docs
  • Design a Code Review System
  • Design Netflix
  • Design YouTube
  • Design Spotify
  • Design Uber/Lyft
  • Design Airbnb
  • Design Ticketmaster (Eventbrite)
  • Design an E-commerce Cart, Checkout, and Catalog
  • Design a Payment System
  • Design a Logging and Monitoring System
  • Mock Design Rounds
  • Practice Test: System Design Case Studies
Low-Level Design0/19
  • The LLD Interview Framework and UML
  • OOP Foundations for Design
  • SOLID Principles
  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns I — Strategy, Observer, Command, State, Template Method
  • Behavioral Patterns II and Anti-Patterns
  • Concurrency in Low-Level Design
  • Design a Parking Lot
  • Design an Elevator System
  • Design a Movie Ticket Booking System
  • Design an Expense-Sharing App (Splitwise)
  • Design a Vending Machine and an ATM
  • Design a Rate Limiter and a Logging Framework
  • Design a Notification Service and an In-Memory Cache
  • Design Games — Tic-Tac-Toe, Snake and Ladder, Chess
  • Database Design for LLD
  • LLD Cheat Sheet and Recall Drill
  • Practice Test: Low-Level Design

Backend

Python0/5
  • How Python Runs Your Code
  • Functions Deep Dive: Closures, Generators, Context Managers, Scope
  • Classes Deep Dive: Method Types, MRO, Metaclasses
  • Standard Library and Serialization
  • Practice Test: Python
Django0/6
  • Django Request Lifecycle
  • Lab: Django Middleware — Request ID & Response Time
  • Django ORM and Querysets
  • Django's Cache Framework
  • Practice Test: Django
  • Django in Production: Debugging Labs
FastAPI0/5
  • FastAPI, ASGI, and Async
  • FastAPI Dependency Injection
  • FastAPI Background Tasks
  • Lab: FastAPI Async — Concurrent Aggregation
  • Practice Test: FastAPI
Databases (PostgreSQL)0/6
  • Indexing
  • Query Optimization
  • Transactions and Isolation
  • Migrations and Schema Changes
  • Hierarchical Data and Safe Concurrent Updates
  • Practice Test: Databases
Caching, Queues & Distributed Systems0/8
  • Redis Caching
  • Redis Advanced Patterns
  • Celery and Background Workers
  • Kafka and Message Queues
  • Async Pipelines
  • Distributed Systems Basics
  • Distributed Locks
  • Practice Test: Caching, Queues and Distributed Systems
APIs, Security & Deployment0/9
  • REST API Design
  • API Versioning and Error Handling
  • API Security and Authentication
  • WebSockets and Real-Time Systems
  • Docker and Containers
  • File Storage with S3
  • Testing Strategies
  • Mock Backend Round
  • Practice Test: APIs, Security and Deployment
Frontend0/38
  • HTML Document Structure and Semantics
  • CSS Box Model, Flexbox and Grid
  • CSS Architecture and Theming
  • CSS and Rendering Performance
  • Variables, Scope, Hoisting, and Truthiness
  • Functions, this, and Binding
  • Objects and Prototypal Inheritance
  • JavaScript Utility Patterns: Cloning, Caching, and Memory
  • Promises From Scratch
  • The Event Loop and Browser Rendering Pipeline
  • The DOM: Nodes, Events, and Traversal
  • Practice Test: HTML, CSS and JavaScript
  • React Rendering Fundamentals
  • React Hooks Internals
  • React Performance
  • Lab: React — Stateful Counter Component
  • State Management
  • State Machines in React
  • React Custom Hooks and Composition Patterns
  • TypeScript for React
  • React Testing
  • Practice Test: React
  • HTTP and Caching
  • Network Performance and Web Vitals
  • Code Splitting and Bundles
  • Virtualization
  • GraphQL and Data Fetching
  • Web Security
  • WebSockets and Real-time
  • SSR and Next.js
  • Micro-frontends
  • Build Tools and Bundling
  • Accessibility
  • Error Handling
  • Internationalization
  • Animation
  • Rapid Recall and Mock Frontend Rounds
  • Practice Test: Performance, Architecture and Production
Behavioral & Interview Day0/14
  • Resume and Project Walkthroughs
  • The STAR Method and Refining Your Stories
  • Conflict and Difficult Coworkers
  • Failures, Incidents, and Obstacles
  • Leadership, Mentorship, and Ownership
  • Teamwork, Communication, and Feedback
  • Growth and Handling Ambiguity
  • Career Goals, Why This Company, and Negotiation
  • Situational Questions
  • Company Research
  • Mock Behavioral Rounds
  • Interview Day
  • After the Interview
  • Practice Test: Behavioral and Interview Day
Browsing without an account — progress is saved in this browser only.Sign in to save it

Back-of-the-Envelope Estimation

Reading45 min

Picture a shopkeeper who, before ordering stock, asks "how many customers a day, roughly?" She doesn't need the exact number. She needs to know if she's stocking a corner shop or a supermarket. Estimation in a system design interview is that same quick check, done with rough numbers in three minutes. Nobody checks your arithmetic. The only question that matters is: is this a one-machine problem, a one-rack-of-machines problem, or a thousand-machine problem? The answer decides everything you draw next.

This lesson gives you a set of numbers worth memorising, four shortcuts for doing the maths fast, and three worked examples to pattern-match against.

The numbers worth memorising

Learn these two tables once. They cover almost every estimate you'll ever do at a whiteboard.

Picture two friends. One passes a note across the same classroom; the other mails a letter to a friend in another country. The classroom note is like reading from computer memory: almost instant. The international letter is like a network call to a server on another continent: it takes far, far longer. That speed gap is the entire reason system design keeps data close to whoever is asking for it.

Latency, the time one operation takes. These are rounded on purpose, because round numbers are what you actually need to remember:

Operation Time Rule of thumb
L1 cache reference (a tiny, ultra-fast memory inside the CPU) 1 ns —
Main memory reference (regular RAM) 100 ns RAM is about 100 times slower than L1
Read 1 MB from memory 10 µs —
SSD random read (a solid-state drive) 100 µs SSD is about 1,000 times slower than RAM
Read 1 MB from SSD 200 µs —
Round trip within one data center 500 µs
Disk (HDD) seek (an old-style spinning hard drive) 10 ms HDD is about 100 times slower than SSD
Round trip, US East to US West 70 ms
Round trip, US to Europe 150 ms Light in fibre-optic cable travels about 200 km per millisecond

Here ns means nanosecond (a billionth of a second), µs means microsecond (a millionth of a second), and ms means millisecond (a thousandth of a second).

Three ratios matter more than the exact numbers: memory is roughly 100 times faster than SSD, SSD is roughly 100 times faster than a spinning disk, and a trip across a continent costs more than 100,000 memory reads. That last fact is the whole reason you cache data, batch requests together, and avoid chatty calls between services in different regions.

How much one ordinary machine can handle, before you need a second one:

Resource Realistic single-machine number
Redis (a fast, in-memory data store) 100,000 to 1 million operations per second, tens of gigabytes of memory
PostgreSQL, well-indexed 5,000 to 10,000 simple queries per second
Application server, Go or Java, simple JSON 5,000 to 20,000 requests per second
Application server, Python or Ruby, one process 500 to 2,000 requests per second
Kafka broker (a message-queue server) 100,000 to 1 million messages per second
Network interface 10 gigabits per second, about 1.25 gigabytes per second

Round aggressively. If someone else says "8,000 queries per second on one Postgres node" and you said 10,000, nothing about your design changes. That's the whole point of rounding.

Remember: memory beats SSD by about 100 times, SSD beats a spinning disk by about 100 times, and a cross-continent trip costs more than 100,000 memory reads. That's why you cache data close to the user.

Sign in to try this knowledge check.

Four arithmetic shortcuts

These four turn estimation from real maths into something you just remember.

1. Powers of two match common data sizes.

Power Value Name
2^10 about 1 thousand KB (kilobyte)
2^20 about 1 million MB (megabyte)
2^30 about 1 billion GB (gigabyte)
2^40 about 1 trillion TB (terabyte)

2. A day has about 100,000 seconds. It's really 86,400, but rounding up to 100,000 makes the mental maths easy. So 1 million events a day is about 10 a second, and 1 billion a day is about 10,000 a second. Nearly every "how many per second" question you'll ever answer is a version of one of those two.

3. The busiest moment is 2 to 3 times the average. Real traffic rises and falls through the day, like a shop that's quiet at 3am and busy at 7pm. Design your system to survive the busy peak, but estimate cost using the average. If a big launch or a sale is part of the scenario, use 10 times instead of 2 to 3.

4. Typical sizes let you turn "how many requests" into "how many bytes."

Thing Size
UUID (a unique random ID) 16 bytes
Timestamp 8 bytes
A tweet or short text post about 300 bytes
A user record about 1 KB
A JSON API response about 1 to 10 KB
A thumbnail image about 50 KB
A full photo about 2 MB
One minute of 1080p video about 50 MB

One habit that follows from this: storage for a year is roughly bytes-per-day multiplied by 400 (365 rounded up), and multiply again by 3 if you keep extra copies of the data.

Remember: a million events a day is about 10 a second. A billion a day is about 10,000 a second. Multiply by 2 to 3 for the busiest moments of the day.

Sign in to try this knowledge check.

The estimation template

Run through the same five lines every time, in this order, and say each one out loud. Each line is a chance to earn a point.

1. Users        : DAU, and actions per user per day
2. QPS          : (DAU × actions) ÷ 100,000 sec  → then ×3 for peak
3. Read : Write : the single most design-relevant ratio
4. Storage      : bytes per record × records/day × 400 days/yr × years × replication
5. Bandwidth    : bytes per response × peak QPS

Here DAU means daily active users, and QPS means queries (or requests) per second.

Then do the part most people forget: say the conclusion out loud. An estimate with no conclusion has earned nothing. Examples of a real conclusion:

  • "3,500 requests a second at peak is a handful of app servers, not a thousand. I'm not building Google here."
  • "100 reads for every write, so caching and extra read copies carry this design."
  • "50 terabytes of video a year means the files live in object storage behind a CDN, and the database only stores information about them."
  • "One database shard tops out around 10,000 requests a second, so at 40,000 I need at least 4 to 8 shards plus some spare room."

There's a fifth conclusion worth practising, because it's the bravest and most senior one to say: "these numbers are small. A single Postgres database with one backup copy for reads handles this easily, and I'd start there." Reaching for a big distributed system that the problem doesn't actually need is a real mistake, and interviewers do mark it down.

Remember: an estimate that doesn't end in a "so..." sentence wasted everyone's time. Numbers only matter for the decision they point to.

Sign in to try this knowledge check.

Three worked estimates

A. A read-heavy social feed, 10 million daily active users.

Reads : 10M × 10 timeline views       = 100M/day  → 1,000 QPS avg → 3,000 peak
Writes: 10M × 0.1 posts               = 1M/day    → 10 QPS avg    → 30 peak
Ratio : 100:1 read-heavy
Storage: 1M posts × 300 B             = 300 MB/day → ~120 GB/yr text
         (+ media: 10% of posts × 2 MB = 200 GB/day → 80 TB/yr → object store + CDN)
Bandwidth: 5 KB response × 3,000 QPS  = 15 MB/s   → trivial for text, huge for media

Conclusion: the text is a small problem. The photos and videos are the real storage and bandwidth problem. Build the read path around a cache, keep the files in object storage behind a CDN, and store only information about each file in the database.

B. Write-heavy metrics collection, 100,000 servers each sending one measurement a second.

Writes: 100k × 1/sec                  = 100,000 writes/sec sustained
Storage: 100k/sec × 50 B × 100k sec/day = 500 GB/day raw → 180 TB/yr

Conclusion: a normal database table with one row per measurement can't keep up. This calls for a time-series database (one built for exactly this shape of data), which compresses data by column, batches writes together, and shrinks old data over time: full detail for a day, once-a-minute detail for a month, once-an-hour detail for a year. That cuts long-term storage by about 99%.

C. A video platform, 1 million uploads a day, 500 million views a day.

Views  : 500M/day                     = 5,000 QPS avg → 15,000 peak
Uploads: 1M/day × 50 MB               = 50 TB/day ingest → 18 PB/yr raw
Transcoding: 1M videos × 5 renditions = 5M transcode jobs/day → 50/sec sustained
Egress : 15,000 concurrent streams × 5 Mbps ≈ 75 Gbps

Conclusion: 75 gigabits per second cannot come straight from your own servers. The entire design has to be built around a CDN. Converting videos into different quality levels is a queue-and-worker problem, and the database that stores video titles and descriptions is by far the easiest part.

Notice the pattern across all three examples: the estimate points straight at one subsystem that's actually hard, and that subsystem becomes your deep dive later in the interview.

Remember: every worked estimate should end by pointing at one subsystem. That's the part worth designing carefully.

Sign in to try this knowledge check.

Quick recap

Seconds/day     ≈ 100,000        1M/day  ≈ 10 QPS      1B/day ≈ 10,000 QPS
Peak            ≈ 2–3× average   Storage/yr ≈ bytes/day × 400 × replicas
Memory 100 ns · SSD 100 µs · DC round trip 500 µs · cross-continent 150 ms
Postgres ≈ 10k QPS/node · Redis ≈ 100k+ ops/sec · app server ≈ 10k req/sec
Tweet 300 B · user 1 KB · JSON response 1–10 KB · photo 2 MB · 1080p video 50 MB/min
PreviousThe System Design Interview FrameworkNextNetworking and Protocols for Design

Course progress

0%
0 of 177 modules complete

On this page

  • The numbers worth memorising
  • Four arithmetic shortcuts
  • The estimation template
  • Three worked estimates
  • Quick recap