Low & High Level System Design
0% Completed
Low Level System Design
Low Level Design Basic Building Blocks
Learn core LLD concepts like inheritance, association, composition, aggregation, with a quick quiz to test understanding.
SOLID Principles
Understand SOLID principles to design clean, scalable, and maintainable systems, with a quiz to reinforce concepts.
Design Patterns
Creational Design Patterns
Learn object creation patterns like Factory, Builder, Singleton, and more, with a quiz to test understanding.
Structural Design Patterns
Learn patterns like Adapter, Decorator, Facade, and Bridge to structure flexible systems, with a quiz to test understanding.
Behavioural Design Patterns
Understand interaction-focused patterns like Command, Observer, State, and Strategy, with a quiz to test concepts.
LLD Topics
LLD Basic Case Studies
Pizza factory
Design a Pizza Factory system from requirements to diagrams, code implementation, and interview Q&A.
SQL Query builder
Design an SQL Query Builder from requirements to diagrams, code implementation, and interview Q&A.
Logger
Design a Logger system covering requirements, diagrams, code, and interview Q&A
Car Price Calculator
Design a Car Price Calculator from requirements to diagrams, code implementation, and interview Q&A.
Weather Station
Design a Weather Station system from requirements to diagrams, code implementation, and interview Q&A.
Intermediate LLD Case Studies
Ticket management system
Design a Ticket Management System from requirements to diagrams, code implementation, and interview Q&A.
Payment processor
Design a Payment Processor from requirements to diagrams, code implementation, and interview Q&A.
Elevator System
Design an Elevator System from requirements to diagrams, code implementation, and interview Q&A.
Car parking
Design a Car Parking system covering requirements, diagrams, services, logging, design patterns, and complete code implementation.
Introduction Video
Video - 00:00:55 mins
Use Case Diagram
Video - 00:3:44 mins
Class Diagram
Video - 00:6:07 mins
Class Diagram continued
Video - 00:5:30 mins
Services
Video - 00:9:57 mins
Parking Service
Video - 00:7:59 mins
Discussion on Parking Spots and Parking Service
Video - 00:8:12 mins
Activity Diagram
Video - 00:4:17 mins
Coding Part 1
Video - 00:34:45 mins
How to add Logging in the system
Video - 00:2:20 mins
Coding Part 2 (Adding Logging in the system)
Video - 00:6:04 mins
Implementing Parking pots using Decorator Design pattern
Video - 00:2:34 mins
Coding Part 3
Video - 00:12:11 mins
Requirements
Reading
Identification of actors
Reading
Use case diagram
Reading
Class diagram
Reading
QnA
Reading
Activity Diagram
Reading
Code
Reading
Advanced LLD Case Studies
Social media
Design a Social Media system from requirements to diagrams, code implementation, and interview Q&A.
WhatsApp
Design a WhatsApp-like system from requirements to diagrams, code implementation, and interview Q&A.
Amazon
Design an Amazon-like system from requirements to diagrams, code implementation, and interview Q&A.
PayPal
Design a PayPal-like payment system from requirements to diagrams, code implementation, and interview Q&A.
Assignment
Apply design patterns by implementing the Snakes and Ladders game end-to-end.
High Level System Design
Building Blocks
Learn core HLD concepts like scalability, consistency, caching, databases, real-time systems, and GenAI-enabled APIs.
What is HLD?
Reading
Consistent Hashing
Reading
Caching
Reading
Load Balancing
Reading
CAP Theorem
Reading
Indexes
Reading
Redundancy and Replication
Reading
SQL vs NoSQL
Reading
Data Partitioning
Reading
Long Polling and WebSockets
Reading
Retrieval Augmented Generation (RAG)
Reading
Quorum
Reading
Gen AI-enabled API Systems
Reading
Basic HLD Case Studies
TinyURL
Design a TinyURL system covering requirements, capacity planning, APIs, databases, caching, scaling, and testing.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High-Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Test
Reading
Rate Limiter
Design a Rate Limiter covering requirements, capacity planning, APIs, data storage, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Intermediate HLD Case Studies
Typeahead suggestion (Google queries)
Design a Typeahead system covering requirements, capacity planning, APIs, data storage, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Pastebin
Design a Pastebin-like system covering requirements, capacity planning, APIs, databases, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Advanced HLD Case Studies
DropBox
Design a Dropbox-like system covering requirements, capacity planning, APIs, storage, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Instagram
Design an Instagram-like system covering requirements, capacity planning, APIs, databases, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Messenger
Design a Messenger system covering requirements, capacity planning, APIs, databases, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
BookMyShow
Design a BookMyShow-like ticketing system covering requirements, capacity planning, APIs, databases, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Uber/Ola
Design a ride-hailing system covering requirements, capacity planning, APIs, databases, real-time matching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Newsfeed
Design a Newsfeed system covering requirements, capacity planning, APIs, databases, caching, feed generation, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
Youtube/Netflix
Design a video streaming system covering requirements, capacity planning, APIs, storage, caching, scaling, and reliability.
Introduction
Reading
Requirements & Goals of the System
Reading
Capacity Estimations & Constraints
Reading
System APIs
Reading
Database design & Schema
Reading
High Level Design
Reading
QnA
Reading
Purging & Db Cleanup
Reading
Database Partitioning & Replication
Reading
Cache & Load Balancing
Reading
1. Estimating Scale of the System
1.1. Traffic Estimations
- Assume the system shortens about 100 million URLs per month.
- Assume each short URL is accessed 10 times on average.
- This results in 1 billion redirection requests per month.
1.2. URL Storage Estimations
-
If we store URLs for 10 years, the system will store:
100 million × 12 months × 10 years = 12 billion URLs
1.3. Read vs. Write Ratio
- URL shortening is a write operation.
- URL redirection is a read operation.
- Reads are much higher than writes (typically 100:1 ratio).
2. Storage Constraints
2.1. URL Storage Size
Each stored URL requires:
- Short URL ID: ~7 bytes (Base62 encoding)
- Original URL: ~500 bytes (average)
- Metadata (timestamp, access count, expiration, etc.): ~100 bytes
- Total Storage per URL = ~600 bytes
For 12 billion URLs, the storage required is: 12 billion × 600 bytes ≈ 7.2 TB
If we add indexing overhead, storage may reach 10 TB over 10 years.
2.2. Caching Requirements
- Frequently accessed URLs should be cached (Redis, Memcached).
- If 20% of URLs account for 80% of traffic, caching 2.4 billion URLs would require:
- Each cached URL entry ~100 bytes
- Total Cache Size ≈ 240 GB (using Redis or Memcached).
3. Bandwidth Constraints
3.1. Shortening Requests (Writes)
- 100 million URL shortening requests per month
- ~40 URLs per second
3.2. Redirection Requests (Reads)
- 1 billion redirections per month
- ~4,000 requests per second (RPS) at peak load
3.3. Data Transfer Estimation
Assuming each redirection request is ~0.5 KB (URL lookup, metadata, logs):
- Daily Data Transfer:
4,000 RPS × 0.5 KB × 86,400 sec ≈ 172 GB/day - Monthly Data Transfer:
~5 TB per month
4. Performance & Latency Constraints
4.1. URL Shortening Latency
- Shortening should take <100 ms, including:
- Encoding the URL (Base62)
- Storing it in a database
- Returning the short URL to the user
4.2. URL Redirection Latency
- Redirection should be <10 ms for cached URLs.
- <100 ms for database lookups.
- CDNs and edge caching can reduce latency further.
5. Constraints & Challenges
5.1. Database Constraints
- A relational database (MySQL, PostgreSQL) may not scale well beyond a few billion URLs.
- A NoSQL solution (Cassandra, DynamoDB, MongoDB) may be better for handling high traffic.
5.2. Scalability Constraints
- The system must handle sudden traffic spikes.
- Horizontal scaling with multiple servers is needed.
5.3. Security Constraints
- Prevent brute force attacks on short URLs.
- Detect and block malicious URLs (phishing, malware).
5.4. Fault Tolerance & Availability
- Replication across data centers ensures uptime.
- Load balancers distribute traffic evenly.
6. Summary of Capacity Estimations
| Component | Estimated Value |
|---|---|
| URLs shortened per month | 100 million |
| Total URLs stored (10 years) | 12 billion |
| Short URL access per month | 1 billion |
| Read-to-write ratio | 100:1 |
| Storage per URL | ~600 bytes |
| Total storage (10 years) | ~10 TB |
| Cached URLs | ~2.4 billion |
| Cache size | ~240 GB |
| Peak redirection requests | ~4,000 RPS |
| Bandwidth usage per month | ~5 TB |
| Shortening latency | <100 ms |
| Redirection latency (cached) | <10 ms |