Module 11 - Interview Prep

High-Level Design

Drawing the architecture-the most visual part of your interview.

1The Blueprint Analogy

Simple Analogy
An architect doesn't start with door handles-they draw the building's floor plan first. Similarly, high-level design shows the major components (rooms) and how they connect (hallways), not the implementation details (paint color).

High-level design (HLD) is the system architecture showing major components, their interactions, and data flow. It's the 30,000-foot view before diving into details.

2Core Components

Every system needs some combination of these building blocks:

Client

Web app, mobile app, API consumer

Load Balancer

Distributes traffic across servers

Web/App Servers

Handle business logic

Database

Persistent storage (SQL/NoSQL)

Cache

Fast data access (Redis/Memcached)

Message Queue

Async processing (Kafka/SQS)

CDN

Static content delivery

Blob Storage

Images, videos, files (S3)

3Drawing the Diagram

1
Start with the Client
Draw users/clients on the left. This is where requests originate.
2
Add the Entry Point
Load balancer or API gateway. Single entry point to your system.
3
Add Application Layer
Web servers that handle business logic. Show horizontal scaling.
4
Add Data Layer
Databases, caches, queues. Show read replicas if relevant.
5
Show Data Flow
Arrows indicating request/response flow. Label the arrows.
6
Add Supporting Services
CDN, blob storage, background workers as needed.

Tip: Talk while you draw. "The request hits the load balancer, which routes to one of our app servers..."

4Example: URL Shortener HLD

Architecture Components
┌─────────────────────────────────────────────────────────────┐
│                                                             │
│   ┌──────┐     ┌────────────┐     ┌──────────────────┐     │
│   │Client│────▶│    CDN     │────▶│  Static Assets   │     │
│   └──────┘     └────────────┘     └──────────────────┘     │
│       │                                                     │
│       ▼                                                     │
│   ┌────────────┐                                           │
│   │Load Balancer│                                          │
│   └────────────┘                                           │
│       │                                                     │
│       ▼                                                     │
│   ┌──────────────────────────────────────┐                 │
│   │         App Servers (x3)              │                 │
│   │  • Create short URL                   │                 │
│   │  • Redirect to long URL               │                 │
│   └──────────────────────────────────────┘                 │
│       │                     │                               │
│       ▼                     ▼                               │
│   ┌────────┐         ┌──────────────┐                      │
│   │ Cache  │◀───────▶│   Database   │                      │
│   │(Redis) │         │(URL mappings)│                      │
│   └────────┘         └──────────────┘                      │
│                                                             │
└─────────────────────────────────────────────────────────────┘
1Client requests shortened URL: POST /shorten {url: 'https://...'}
2App server generates unique ID, stores mapping in DB
3Returns short URL: https://tiny.url/abc123
4On redirect: GET /abc123 → check cache → DB → 301 redirect

5Common Patterns

Read-Heavy System

LB → Servers → Cache → Read Replicas → Primary DB

Twitter feed, news sites, product catalog

Write-Heavy System

LB → Servers → Queue → Workers → DB

Logging, analytics, IoT data ingestion

Real-Time System

WebSocket Server ↔ Pub/Sub ↔ Subscribers

Chat, live scores, notifications

Media-Heavy System

Upload → Queue → Processor → CDN + Blob Storage

Instagram, YouTube, image sharing

6Mistakes to Avoid

Too Much Detail

Don't show every microservice. Start high-level, add detail when asked.

No Labels

Label your components and data flows. 'This box' is not helpful.

Missing Data Flow

Show how data moves. Arrows matter. Request path vs response path.

Forgetting Scale

If you said 10K QPS, show multiple servers. Single boxes don't scale.

Kitchen Sink

Adding every component you know. Start simple, add as needed.

7Key Takeaways

1Start simple: Client → LB → Servers → DB. Add complexity as needed.
2Talk while drawing. Explain your thought process.
3Label everything. Components and data flows.
4Show scaling. Multiple servers, replicas, shards.
5Match the requirements. Read-heavy? Write-heavy? Real-time?

?Quiz

1. You're designing a read-heavy system. First component after load balancer?

2. Your diagram has 5 boxes but no arrows. Problem?