HLD Interview Framework

A 6-step framework for backend system design interviews โ€” requirements, estimation, API, data model, architecture, and deep-dives.

must medium โฑ 25 min hldframeworksystem-designrequirementsestimationscalability
Mastery:
Why interviewers ask this
Every HLD round rewards structure over trivia. A clear framework signals senior-level thinking and keeps you from rambling.

The 6-step framework

Step 1: Clarify requirements (5 min)

Split into two types:

Functional requirements โ€” what the system does:

  • Core features only (3โ€“4 max for the interview)
  • Who are the users? What are their primary journeys?

Non-functional requirements โ€” the quality of how it does it:

  • Scale: DAU, peak RPS, data volume
  • Latency: real-time? < 200ms p99? eventual consistency ok?
  • Availability: 99.9%? 99.99%? (9s = downtime/year)
  • Consistency: strong vs eventual
  • Durability: can we lose a few events?

What to scope out: โ€œIโ€™ll skip auth, GDPR handling, and payment processing for this design.โ€


Step 2: Capacity estimation (3 min)

Quick back-of-envelope. The goal is to know the order of magnitude โ€” not to be precise.

Useful numbers to memorize:

1 day = 86,400 seconds โ‰ˆ 100K seconds
1 month = 2.5M seconds

Traffic:
  1M DAU ร— 10 req/day = 10M req/day = 100 RPS
  
Storage:
  1M users ร— 1KB/user = 1 GB
  1B users ร— 1KB = 1 TB

Bandwidth:
  100 RPS ร— 1KB/request = 100 KB/s (negligible)
  100 RPS ร— 1MB/request = 100 MB/s (significant)

Template:

DAU: __M
Read RPS: __   Write RPS: __
Storage per record: __ KB
New records/day: __
Total storage (5 years): __ GB / TB

Step 3: API design

Define the core REST (or GraphQL) API surface:

# Resource endpoints โ€” noun-based, plural
GET    /api/v1/posts?cursor=xxx&limit=20     โ†’ 200 { items, nextCursor }
POST   /api/v1/posts                         โ†’ 201 { id, ... }
GET    /api/v1/posts/:id                     โ†’ 200 Post
PATCH  /api/v1/posts/:id                     โ†’ 200 Post
DELETE /api/v1/posts/:id                     โ†’ 204

# Actions
POST   /api/v1/posts/:id/like               โ†’ 200 { likeCount }
POST   /api/v1/posts/:id/share              โ†’ 201 Share

Mention:

  • Versioning (/v1/)
  • Auth header (Authorization: Bearer <token>)
  • Pagination strategy (cursor, not offset, for live feeds)
  • Rate limiting headers

Step 4: Data model & storage

Define the primary entities and choose a storage engine per use case:

User:    { id, username, email, passwordHash, createdAt }
Post:    { id, authorId, content, mediaUrls[], likeCount, createdAt }
Like:    { postId, userId, createdAt }          โ† composite primary key
Follow:  { followerId, followeeId, createdAt }  โ† composite PK

Storage decision matrix:

NeedTechnologyWhy
Structured relational dataPostgreSQLACID, joins, mature
Flexible documents / catalogMongoDBSchema-less, horizontal scale
High-throughput time-seriesCassandraWide-column, append-only optimized
Session / cache / ephemeralRedisSub-millisecond reads, TTL support
Full-text searchElasticsearchInverted index, relevance scoring
Blob storageS3Cheap, durable, CDN-friendly
Graph relationshipsNeo4jTraversal-optimized (rarely needed)

Step 5: High-level architecture

Draw the components and connections. A standard web-scale architecture:

Clients (web/mobile)
        โ”‚
        โ–ผ
[ CDN โ€” static assets + cached API responses ]
        โ”‚
        โ–ผ
[ Load Balancer (L7 โ€” nginx / AWS ALB) ]
        โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
   โ–ผ         โ–ผ
[App Server] [App Server]   โ† stateless, horizontally scalable
   โ”‚         โ”‚
   โ–ผ         โ–ผ
[ Cache โ€” Redis ]           โ† read-through for hot data
   โ”‚
   โ–ผ
[ Primary DB ] โ”€โ”€replicateโ”€โ”€โ–ถ [ Read Replica(s) ]
   โ”‚
   โ–ผ
[ Message Queue (Kafka / SQS) ]
   โ”‚
   โ–ผ
[ Async Workers ]           โ† emails, notifications, thumbnails, analytics

Label the arrows with protocols (HTTP/2, gRPC, TCP) and data sizes where relevant.


Step 6: Deep-dive (10 min)

Pick one or two components the interviewer asks about, or where your design has interesting tradeoffs:

Common deep-dives:

  • Database schema + indexing โ€” how do you avoid slow queries at scale?
  • Caching strategy โ€” cache-aside? write-through? whatโ€™s the TTL? what do you cache?
  • Message queue fanout โ€” push vs pull model; at-least-once vs exactly-once delivery
  • Rate limiting โ€” token bucket vs sliding window; distributed rate limiter
  • Consistency tradeoffs โ€” eventual vs strong; what breaks if a userโ€™s feed is 1s stale?

Trade-off cheat sheet

ScenarioPush towardAway from
Read-heavy (10:1)Cache, read replicas, CDNNormalize excessively
Write-heavyAsync queues, batching, CassandraSync writes to multiple tables
Low-latency readsRedis, denormalize, pre-computeReal-time JOINs
Global usersCDN, multi-region, eventual consistencySingle-region, strong consistency
Auditability / complianceAppend-only log, event sourcingIn-place updates

The senior signal in HLD
Donโ€™t just describe the happy path. Interviewers give senior-level credit for: (1) stating a failure mode before they ask, (2) offering two options for a decision with a genuine trade-off, and (3) knowing when not to add complexity (โ€œIโ€™d start with a single Postgres instance โ€” at 10K RPS Iโ€™d add read replicas, not shard yetโ€).

Likely follow-up questions
  • How do you estimate scale before designing?
  • What is the difference between functional and non-functional requirements?
  • How do you decide between SQL and NoSQL?
  • When would you add a message queue?

References