A curated collection of system design knowledge + real-world case studies. This repo documents my journey mastering High-Level Design (HLD) and Low-Level Design (LLD) — from theory to practice — with recruiter-facing examples.
Real-world HLD (High-Level Design) essentials — to build scalable systems like Google, Facebook, Netflix.
When designing any large-scale system, you always split requirements into two buckets:
Upload photos/videos
Follow/unfollow users
News feed generation
Likes, comments, shares
Notifications
Upload videos
Stream videos (adaptive bitrate)
Search & recommendations
Subscriptions & notifications
Monetization (ads, premium)
Generate short URL
Redirect short → long URL
Track analytics (click count, geo, device)
#Instagram: must be up 24/7 globally.
#YouTube: downtime = millions lost in ad revenue.
#URL Shortener: critical for links embedded everywhere.
Instagram: feed load < 200ms.
YouTube: video playback must start < 1s.
URL Shortener: redirect < 50ms.
Instagram: billions of posts, millions of concurrent users.
YouTube: petabytes of video, global CDN distribution.
URL Shortener: billions of URLs, high read-heavy traffic.
Instagram: optimize infra for storage + CDN.
YouTube: video transcoding is expensive → need efficient pipelines.
URL Shortener: cheap storage, caching for hot URLs.
This is where system design mastery comes in — you must articulate trade-offs.
Instagram: feed may show slightly stale likes/comments (eventual consistency).
YouTube: view counts may lag (eventual consistency).
URL Shortener: must be strongly consistent (short → long mapping must never fail).
Instagram: caching feed results improves latency but may show outdated posts.
YouTube: CDN improves performance but requires replication delays.
URL Shortener: cache hot URLs in Redis for instant redirects.
Instagram: replication across regions ensures uptime.
YouTube: multiple data centers, failover for streaming.
URL Shortener: fallback to DB if cache fails.