The HLD Problem-Solving Framework
Definition
HLD framework
- In plain English
- An HLD framework is a fixed order of steps for turning a vague product idea into a clear high-level design.
- Think of it like
- It is like an architect's process: brief, sketch, structure, then details.
Deep dive
- In plain English
- A deep dive is a focused, detailed look at one hard part of a design after the overall picture is clear.
- Think of it like
- It is like zooming into the kitchen plan after the whole restaurant layout is agreed.
Why it exists
You spend twenty minutes naming services, then discover the customer needed only one small app.
Without a method, you can miss the real requirement and leave no time for failures.
How it works
Non-goal
- In plain English
- A non-goal is something you deliberately decide not to build, so scope stays clear.
- Think of it like
- Like a recipe saying "no dessert today".
- 1. Requirements and non-goals — 5 minutes
Ask who uses the system, what they need, and what you will leave out.
- 2. Estimates — 5 minutes
Write traffic, storage, and bandwidth assumptions using Module 2 estimation.
- 3. API — 4 minutes
Sketch the requests and responses using APIs from Module 1.
- 4. Data model — 4 minutes
Choose records, keys, and correctness rules using Module 3.
- 5. High-level diagram — 10 minutes
Connect clients, servers, storage, and delivery paths using Modules 1–4.
- 6. Deep dives — 10 minutes
Choose the two or three hardest requirements and explain how the design meets them.
- 7. Failures and trade-offs — 7 minutes
Use Module 5 reliability tools to explain outages and recovery.
Requirements lead to estimates, API, data, a diagram, deep dives, and failures.
| Step | Question answered | Earlier module |
|---|---|---|
| Requirements | What must work? | Module 1: system design |
| Estimates | How much work arrives? | Module 2: estimation |
| API | What can clients request? | Module 1: APIs |
| Data | What must be remembered correctly? | Module 3: data layer |
| Diagram | Which components connect? | Modules 1–4 |
| Deep dives | Which parts need closer reasoning? | Choose from Modules 1–5 |
| Failures | What happens when something stops? | Module 5: reliability |
Examples
Practise in ten minutes
You want parents to see each bus location within 30 seconds.
Assume 100 buses report every five seconds: 100 ÷ 5 = 20 writes per second. Five thousand parents refresh every 15 seconds.
GET /buses/{id}/locationBuses report to an app server; parents read through a cache, while the server stores latest locations and history.
Parent reads total 5,000 ÷ 15 ≈ 333 per second, or roughly 330. Use Module 4 caching for the morning spike.
The insight
Even a small design follows the same seven steps.
Let bandwidth choose the path
Listeners download two million episodes each month, averaging 30 MB each.
2,000,000 downloads/month × 30 MB = 60,000,000 MB/month
60,000,000 MB ÷ 1,000,000 = 60 TB/month
60 TB ÷ 30 days ÷ 86,400 s ≈ 23.1 MB/s averageStore audio in object storage from Module 3. Use the CDN from Module 4 so app servers never carry audio bytes.
The insight
Numbers from step two drive the architecture.
Match the actual scale
Three staff manage 20,000 records, mostly during office hours.
Start with one web app, one relational database, and nightly backups. Use Module 3 transactions for stock changes.
Check whether losing one day of work is acceptable. Test restores and add more frequent backups when needed.
At 100 times the records, you have two million records. Measure queries before adding indexes, replicas, or servers.
The insight
Matching the design to the real scale is a skill.
Trade-offs
Pros
- Covers the main design questions.
- Prevents premature detail.
- Reserves time for failures.
Cons
- Can feel mechanical.
- Small problems need shorter steps.
Use when
- An interview needs a complete design within a time limit.
- A team needs shared assumptions before choosing components.
Avoid when
- Never omit requirements or estimates, even for a small design.
- Shorten later steps when the full time boxes exceed the discussion time.
Quick check
Takeaways
- Follow requirements, estimates, API, data, diagram, deep dives, and failures.
- Let numbers drive the design.
- Always save time for what breaks.