Skip to content
learn
  1. Learn
  2. High Level System Design
  3. The System Design Interview Framework

System Design HLD-18.04

Deep dives and trade-off discussions

Picking the component most likely to break, laying out two real options, choosing with reasons tied to requirements, and quantifying with your estimates.

Intermediate 10 min Last reviewed

The big idea

A high-level diagram shows you know the building blocks; a deep dive shows you understand them. In a deep dive you take one component, usually the one most likely to break under the requirements, and examine it properly: what can go wrong, which designs could work, what each costs, and which you choose and why. This is where most of the signal in a design interview comes from, and where real design reviews earn their keep.

The key skill is trade-off reasoning. There is rarely a single right answer, but there are well-reasoned and poorly reasoned choices. "I'd use fan-out on write because reads outnumber writes 100 to 1 and feeds must load in 200 ms, except for accounts with millions of followers, where I'd switch to fan-out on read" is a strong answer even if the interviewer would have chosen differently.

Think of a mechanic inspecting a used car. Glancing at every part tells you little; testing the brakes and the engine properly, the parts most likely to fail and most expensive if they do, tells you whether to buy.

How it works

Step 1: Pick the riskiest component

Look for the place where the requirements and estimates collide: the hottest data, the highest write rate, the strictest consistency need, the biggest fan-out. For a news feed it is feed generation; for a chat system, delivery and ordering; for a payment system, exactly-once charging; for a URL shortener, unique short codes and redirect latency. Say why you picked it.

Step 2: Two options, then a choice

A deep dive: two options compared against the requirements The riskiest component, feed generation, leads to two options: fan-out on write, which precomputes feeds so reads are fast but is expensive for celebrities, and fan-out on read, which assembles feeds at read time so writes are cheap but reads are slower. Both are checked against the requirements and estimates, and a hybrid is chosen. reads 100x writes celebrity fan-out Feed generation riskiest component Fan-out on write fast reads, costly for celebrities Fan-out on read cheap writes, slower reads Hybrid write for most, read for celebrities Figure 1. Lay out two real options, score each against the requirements and numbers, then choose. Here a hybrid wins: precompute for most users, merge celebrities' posts at read time.
  1. State the problem in terms of the requirements: "200,000 feed reads per second with p99 under 200 ms, while a celebrity post reaches 50 million followers."
  2. Present two real options, each with its strengths and costs.
  3. Quantify with your estimates: "fanning out one celebrity post means 50 million cache writes; at 100,000 writes per second that is over 8 minutes of work".
  4. Choose, tie the choice to the requirements, and name what you are giving up.
  5. Name the failure mode of your choice and how you would detect and handle it.

Try it

Walk through a deep dive on short-code generation for a URL shortener

  1. Why this component Every new link needs a short code that is unique and short. At 100 million new links a month, collisions or a coordination bottleneck here would break the core feature.
  2. Option A: hash the long URL Take the first 7 characters of a hash of the URL. No coordination needed, but different URLs can collide, so every insert must check and retry, and identical URLs map to the same code.
  3. Option B: counter plus base62 Give each link a unique number, from a database sequence or a range allocated per server, and encode it in base62. No collisions and very short codes, but codes are guessable and the counter needs care to avoid a single bottleneck.
  4. Quantify 62^7 is about 3.5 trillion codes. At 100 million a month that is over 2,900 years of links, so 7 characters is plenty for either option.
  5. Choose Counter ranges plus base62: each app server takes a block of 1,000 ids at a time, so there are no collisions and no per-request coordination. If guessable codes matter, shuffle the bits before encoding.
  6. Failure mode A server that crashes wastes the rest of its block. That only leaves gaps in the sequence, which is harmless; monitor how fast ranges are consumed.

Going deeper

Let the interviewer steer

Offer the choice: "the two riskiest parts are feed generation and media storage; which would you like me to go deep on?" It shows you see both, and lets the interviewer test what they care about. If they push back on your choice, treat it as information, not an attack: re-examine with the new constraint.

Trade-offs

OptionWins whenLoses when
One deep dive done well Showing real understanding with time to quantify Breadth across other components
Several shallow dives Showing awareness of many risks Depth: few concrete numbers or failure modes

Common mistakes

  • Diving into the easiest component instead of the riskiest.
  • Presenting one option as the only answer.
  • Choosing without referring to the requirements or numbers.
  • Never mentioning how the chosen design fails.

Check yourself

  1. Which component deserves the deep dive?

    Show answer

    B. The one most likely to break given the requirements and estimates Depth on the riskiest part shows you can handle real pressure points.

  2. What makes a trade-off choice convincing?

    Show answer

    B. Tying it to requirements and quantifying with estimates Reasons grounded in the problem make a choice defensible.

  3. How many characters of base62 are needed for 100 million links a month for decades?

    Show answer

    C. 7 62^7 is about 3.5 trillion, enough for thousands of years at that rate.

  4. The interviewer disagrees with your choice. What is the best response?

    Show answer

    B. Re-examine it with their new constraint and adjust if needed Pushback is information; reasoning openly with it is what they want to see.

Recap

  • Deep dives show understanding; pick the component most likely to break.
  • Lay out two real options with their strengths and costs.
  • Quantify with your earlier estimates.
  • Choose, tie it to requirements, and name what you give up.
  • Describe how your choice fails and how you would notice.

Get new lessons by email

Get new posts on backend and AI internals. No spam, unsubscribe anytime.

Your email is only used to send new posts. Privacy

Next up