ScaleCrafts

Scenario: the database is at 95% CPU

A product catalogue API runs on one MySQL server. Traffic has grown to 30,000 reads a second, database CPU sits at 95% and p99 latency has climbed from 50 ms to 2 seconds. Bring latency back down, and keep it down as traffic doubles.

Functional requirements

  • Product and listing pages keep working throughout
  • Merchants can still edit prices and stock
  • Shoppers see their own reviews and wishlist changes straight away

Non-functional requirements

  • p99 read latency back under 100 ms
  • A price change shows up within a few seconds
  • No downtime while the fix rolls out

Scale

  • Reads outnumber writes 100 to 1, and traffic doubles within a year
  • 2M products of about 10 KB each
  • The top 1% of products get half of all reads

How you’ll be scored

9 checks covering your diagram and your notes, and any valid approach counts. Hints appear for anything you miss. Common mistakes, such as single points of failure or components you never explain, cost points. How grading works

What interviewers look for

  • Clarify before you draw. State what is in and out of scope. For “Scenario: the database is at 95% CPU”, that starts with: Product and listing pages keep working throughout; Merchants can still edit prices and stock; Shoppers see their own reviews and wishlist changes straight away. Interviewers notice candidates who pin the requirements down first.
  • Turn the scale into numbers. The scale (Reads outnumber writes 100 to 1, and traffic doubles within a year; 2M products of about 10 KB each; The top 1% of products get half of all reads) should become requests per second, storage and bandwidth, and those figures should drive your choices. Estimates with units carry more weight than adjectives.
  • Show how each quality is met. Your design should visibly deliver: p99 read latency back under 100 ms; A price change shows up within a few seconds; No downtime while the fix rolls out. Saying that it does isn’t enough; point to the part of the design that makes it true.
  • Expect follow-ups on the hard parts. Interviewers usually probe scenario, read scaling and caching here. This is an easy problem, so interviewers expect the fundamentals done cleanly: a clear request path, the right kind of data store, and a reason for each component.
  • Explain failure and trade-offs. Say what happens when a component fails, where a single point of failure would hurt, and what you chose not to build. Naming a trade-off is a stronger answer than claiming there isn’t one.

Related problems

Loading your workspace…