Practice — System Design Basics (6 questions)
Horizontal vs Vertical Scaling Permalink →
Explain the difference between horizontal scaling and vertical scaling. What are the key trade-offs, and why do large-scale web systems typically prefer horizontal scaling?
Share this question
Latency vs Throughput Permalink →
A web service has a latency of 500 ms per request and can handle 1,000 requests per second. An engineer proposes adding a cache in front of the database, which reduces latency to 20 ms for 80% of requests.
- How does caching affect throughput?
- What is the risk introduced by caching, and how would you mitigate it?
Share this question
Availability Nines Permalink →
A payment processing service has a monthly availability SLA of 99.95%.
- How many minutes of downtime is that per month (assume a 30-day month)?
- If the service is composed of two independent components each with 99.99% availability, what is the combined availability?
Share this question
Stateless Services Permalink →
What does it mean for an application server to be "stateless"? Why is statelessness a prerequisite for horizontal scaling? Give a concrete example of a stateful design and how you would refactor it to be stateless.
Share this question
Message Queue Use Case Permalink →
An e-commerce site sends a welcome email immediately after a user registers. The current implementation calls the email API synchronously inside the registration handler. The email API occasionally takes 3–5 seconds to respond, making registration feel slow.
Redesign this using a message queue. Draw the new request flow and explain the trade-offs.
Share this question
How Much Slower a Disk Seek Is Than a RAM Read Permalink →
A main-memory reference takes ~100 nanoseconds. A spinning-disk seek takes ~10 milliseconds.
How many times slower is the disk seek — and what does that ratio look like at human scale?
Place an SSD random read on the same ladder.
Share this question