Skip to content

High-Level Design (Step 3 Deep Dive) โ€‹

AdvancedAdvanced3+ yrs experience Deep technical material โ€” distributed-systems theory, low-level implementation details, and case studies of real production systems.Prerequisites: Production experience with at least one distributed system. Comfort reading research papers and RFCs.

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.