Skip to content

High-Level Design (Step 3 Deep Dive)

Time Budget: 10–15 minutes — Sketch the core architecture. Cover the happy path first, then expand.

High-Level Design (HLD) is where you transform your scoped requirements and scale estimates into a working blueprint of the system. You are not solving every detail — you are proposing a coherent architecture that the interviewer can react to and guide.


Why It Matters

This is the phase where most candidates either shine or struggle. The interviewer wants to see:

  • Can you identify the right building blocks for the problem?
  • Do you know where each component lives in the architecture?
  • Can you articulate the data flow end-to-end?
  • Do you drive the conversation or wait to be led?

The HLD Flow


The 5 Core Building Blocks

Every system design uses some combination of these five layers. Know them cold.


Worked Example: URL Shortener

Carrying forward from Steps 1 & 2:

  • Functional: Shorten URL, Redirect, Custom Aliases, Expiration
  • Scale: ~1,200 writes/sec, ~116,000 reads/sec (100:1 read-heavy)
  • Storage: ~182 TB over 10 years → sharding needed
  • Cache: 10 GB working set → fits in Redis

Part 1 — Define the Core APIs

Before drawing anything, define what the system exposes to the outside world.

http
POST /api/v1/urls
  Request:  { long_url: string, custom_alias?: string, expiry_days?: number }
  Response: { short_url: string, expires_at: timestamp }

GET /{short_code}
  Response: HTTP 301 Redirect → long_url
            HTTP 404 if not found or expired

DELETE /api/v1/urls/{short_code}
  Response: HTTP 204 No Content

301 vs 302? — This is a classic interview trade-off:

  • 301 (Permanent): Browser caches the redirect → fewer requests to our servers → lower load, but we lose click analytics.
  • 302 (Temporary): Browser always hits our server → we can track analytics, but higher load.

Decision: Since analytics are out of scope for our baseline requirements, we will use 301 Permanent to minimize server load.


Part 2 — Design the Data Model

Key decision — SQL vs NoSQL?

FactorChoiceReason
SchemaSimple, fixedEither works
Read patternKey-value lookup by short_code✅ Favors NoSQL (Cassandra, DynamoDB)
Scale182 TB, 116K reads/sec✅ Favors NoSQL (sharding built-in)
ConsistencyEventual OK✅ Favors NoSQL
Joins needed?No✅ Favors NoSQL

Decision: Use Cassandra or DynamoDB (NoSQL) with short_code as the partition key. This gives us distributed writes, fast key-value reads, and horizontal scaling out of the box.


Part 3 — Draw the High-Level Architecture

This is the core diagram you draw on the whiteboard.


Part 4 — Walk the Happy Path

Narrate the request flow end-to-end. This is exactly what you say to the interviewer:


Part 5 — The Short Code Generation Deep Dive

A common follow-up question: "How do you generate unique short codes?"

Best choice for interview: Option B (Base62 encoding of a distributed ID like Snowflake). It's collision-free, requires no extra DB lookup, and 7 Base62 characters gives us 62^7 = 3.5 trillion unique URLs — more than enough.


The HLD Output: At a Glance

ComponentTechnology ChoiceReason
DNSRoute 53 / CloudflareGeoDNS routing
CDNCloudFront / FastlyCache hot redirects at the edge
Load BalancerAWS ALB / NginxDistribute traffic, SSL termination
App ServersNode.js / Go (stateless)Horizontally scalable, auto-scaled
CacheRedis (LRU, TTL-aware)10 GB working set, ~95% hit rate
DatabaseCassandra / DynamoDBNative sharding, 182 TB scale
ID GeneratorSnowflake / Base62Collision-free short codes
Cleanup WorkerCron job / LambdaPurge expired URLs periodically

The Universal HLD Template

Apply this same structure to any system design question:

StepWhat You DoTime
APIsWrite 2-3 key endpoints on the board2 min
Data ModelSketch key tables/documents and relationships2-3 min
Architecture DiagramDraw boxes and arrows, label each component5 min
Happy Path WalkthroughNarrate a request end-to-end2-3 min
Bottleneck CalloutPoint to where the system will fail under load1-2 min

Red Flags vs. Green Flags

🔴 Red Flag🟢 Green Flag
Draw the architecture without defining APIs firstAlways start with APIs — they define the system's contract
Use a single giant serverShow horizontal scaling from the start
Never mention the database choiceExplicitly state SQL vs NoSQL and why
Draw components but don't explain data flowWalk through the happy path out loud
Jump to optimization before the basics workGet the happy path working, then optimize
Generic diagram that could apply to any systemTailor every component to your specific requirements

Next Steps

With the high-level design in place, move to Step 4: Deep Dive & Detailed Design → where you zoom into individual components to address bottlenecks, edge cases, and trade-offs.

IMPORTANT

Always get buy-in before moving on. After drawing your architecture, ask: "Does this high-level design look reasonable? Are there areas you'd like me to go deeper on?" This is your chance to show collaboration and redirect your energy to what the interviewer cares most about.

TIP

If you run out of time, a complete HLD with clear trade-off reasoning is more impressive than a partial deep-dive. Breadth first, then depth.

Released under the ISC License.