Part 17 of 18
Case Studies
55 pages · 55 written
- 1.Design a URL Shortener (Bitly)Intermediate
Design Bitly end to end: short-code generation, 301 vs 302 redirects, caching and CDN, custom aliases, expiry, click analytics and scaling to billions.
- 2.Design a PastebinIntermediate
Design Pastebin: short unguessable links to stored text, object storage vs database, expiry, CDN-heavy reads, highlighting, analytics and abuse control.
- 3.Design a Distributed Rate LimiterIntermediate
Design a 1M req/s rate limiter: algorithm choice, gateway placement, atomic Redis Lua counters, rule config, fail-open vs fail-closed and multi-region limits.
- 4.Design a Distributed CacheAdvanced
Design a Redis or Memcached-style cache: get/set/TTL API, hash map plus LRU node internals, consistent hashing, replication, failover, hot keys and membership.
- 5.Design a Distributed Key-Value Store (Dynamo-style)Advanced
Design a Dynamo-style key-value store: consistent hashing, replication, quorums, vector clocks, hinted handoff, Merkle anti-entropy, gossip and LSM storage.
- 6.Design a Notification SystemIntermediate
Design a notification platform: push, SMS, email and in-app, queue-based campaign fan-out, preferences, priorities, retries, dedupe and delivery tracking.
- 7.Design an Email Service (Gmail)Advanced
Design Gmail: SMTP, MX and IMAP delivery, SPF/DKIM/DMARC, inbound and outbound pipelines, mailbox storage, search, spam, threading and push sync.
- 8.Design Search Autocomplete (Typeahead)Intermediate
Design search autocomplete: trie with top-k per prefix, log pipeline, precomputed results, browser and edge caching, prefix sharding, trends, personalisation.
- 9.Design a News Feed (Facebook / Twitter)Advanced
Design a social news feed: fan-out on write, read and hybrid, the celebrity problem, feed caches, ranking, cursor pagination, media, timelines and search.
- 10.Design a News Aggregator (Google News)Intermediate
Design Google News: ingest RSS and sitemaps, dedupe and cluster stories, categorise, rank per region, cache at the CDN, paginate infinitely, stay fresh.
- 11.Design a Community Forum (Reddit)Advanced
Design Reddit: communities, posts, nested comment trees, voting at scale, hot/top/best ranking, home feeds, moderation, spam defence and hot-thread caching.
- 12.Design a Q&A Site (Stack Overflow)Intermediate
Design Stack Overflow: questions, answers, votes, reputation, tags, search, duplicate detection, badges, moderation, and why a few big servers can serve it.
- 13.Design a Social Graph and Shortest-Path SearchAdvanced
Design a social graph: sharded adjacency lists, BFS and bidirectional search, degrees of separation, partitioning, TAO-style caching and friend suggestions.
- 14.Design a Decentralised Social Network (Bluesky)Advanced
Design a decentralised social network like Bluesky: AT Protocol PDS, relay, firehose and app view, portable DIDs, signed repos, custom feeds and labelers.
- 15.Design a Chat System (WhatsApp)Advanced
Design a WhatsApp-scale chat: websocket servers, routing via pub/sub, inbox storage, receipts, ordering, offline push, presence, multi-device and E2EE.
- 16.Design Live Comments (Facebook Live)Advanced
Design Facebook-scale live comments: SSE push, pub/sub partitioned by video, viewer co-location, mega-stream sampling, CDN snapshots, ordering and catch-up.
- 17.Design a Photo Sharing App (Instagram)Intermediate
Design Instagram: presigned direct uploads, image and video variants, CDN delivery, the follow graph, feed generation, and like and comment counters.
- 18.Design a Short-Video App (TikTok)Advanced
Design a short-video app like TikTok: upload and transcoding, a For You feed built by recommendation, prefetching, CDN delivery, engagement signals, cold start.
- 19.Design Post Search (Facebook Search)Advanced
Design Facebook post search: an inverted index fed by a post stream, sharding by document vs term, recency and like ranking, hot-query caching and freshness.
- 20.Design a Web CrawlerAdvanced
Design a 10-billion-page web crawler: URL frontier, politeness and robots.txt, DNS caching, fetchers, URL and content dedupe, coordination and checkpoints.
- 21.Design a Web Search Engine (Google Search)Advanced
Design web search: crawl-to-index pipeline, sharded inverted index, BM25 + PageRank + learning to rank, tiered serving, result caching, freshness, spelling.
- 22.Design a Video Streaming Platform (YouTube / Netflix)Advanced
Design YouTube or Netflix: resumable uploads, a parallel transcoding DAG, adaptive bitrate with HLS and DASH, CDN delivery, search, view counts and live.
- 23.Design a Music Streaming Service (Spotify)Advanced
Design Spotify: audio encoding ladder, instant playback via CDN and client caches, catalogue, playlists, search, offline DRM, recommendations, royalties.
- 24.Design Video Conferencing (Zoom)Advanced
Design Zoom: WebRTC with ICE, STUN and TURN, SFU media servers, simulcast and SVC, signalling, global placement, recording, chat and huge meetings.
- 25.Design File Storage and Sync (Dropbox / Google Drive)Advanced
Design Dropbox or Google Drive: chunked presigned uploads, content-defined dedupe, a metadata journal, cursor sync with push, conflicts, versions and sharing.
- 26.Design an Object Store (Amazon S3)Advanced
Design Amazon S3: metadata vs data nodes, placement across failure domains, erasure coding, durability math, strong consistency, multipart upload and GC.
- 27.Design a Collaborative Editor (Google Docs)Advanced
Design Google Docs: OT vs CRDT, a document session server, WebSocket sessions, operation log and snapshots, presence and cursors, offline edits and scaling.
- 28.Design an Online Code Judge (LeetCode)Intermediate
Design LeetCode: sandboxed code execution with containers and micro-VMs, a submission job queue, result delivery, a live contest leaderboard and contest bursts.
- 29.Design a Distributed Job SchedulerAdvanced
Design a distributed job scheduler: cron and one-off jobs, time-bucketed queues, at-least-once runs, idempotency, partitioned schedulers, retries, heartbeats.
- 30.Design a Ride-Hailing App (Uber)Advanced
Design Uber: high-rate driver location ingestion, geospatial indexes, matching with driver locks, ETA, the trip state machine and consistent assignment.
- 31.Design a Proximity Service (Yelp)Intermediate
Design Yelp: static business locations, geohash and quadtree indexes, search with filters, review and rating aggregation, and scaling a read-heavy service.
- 32.Design a Local Delivery Service (DoorDash / Gopuff)Advanced
Design rapid local delivery: availability from nearby warehouses, travel-time filtering, oversell-free ordering, regional partitioning and peak-hour scale.
- 33.Design Maps and Navigation (Google Maps)Advanced
Design Google Maps: tiles on a CDN, road-graph routing with Dijkstra, A* and contraction hierarchies, live traffic and ETA, geocoding and offline maps.
- 34.Design a Dating App (Tinder)Intermediate
Design Tinder: precomputed swipe stacks with geo filtering, high-volume swipe writes, race-free mutual match detection and Bloom filters to avoid repeats.
- 35.Design a Fitness Tracking App (Strava)Intermediate
Design Strava: offline GPS recording, track upload and storage, live sharing, segment matching and leaderboards, and a friends' activity feed at scale.
- 36.Design an Item Tracker (Apple AirTags / Find My)Advanced
Design an AirTag-style tracker: crowdsourced Bluetooth sightings, end-to-end encrypted reports with rotating keys, owner lookup at scale and anti-stalking.
- 37.Design a Ticket Booking System (Ticketmaster)Advanced
Design Ticketmaster: seat holds with TTLs, locks vs status columns, no double booking, a virtual waiting room, fast event search, cached pages, payments.
- 38.Design a Hotel and Home Booking System (Airbnb)Advanced
Design an Airbnb-style booking platform: search by place and dates, availability calendars, no double booking, pricing, payments, reviews and ranking.
- 39.Design a Flight Booking SystemAdvanced
Design an Expedia-style flight booking platform: search across GDS, NDC and airline APIs, fare caching, seat holds, PNRs, ticketing, payments and overbooking.
- 40.Design an Online Auction (eBay)Advanced
Design eBay-style auctions: strongly consistent bids, proxy bidding, real-time price updates, precise auction close, fairness and 10M live auctions.
- 41.Design Online Chess (Chess.com)Intermediate
Design Chess.com: rating-based matchmaking, server-validated moves over WebSockets, fair clocks, Elo/Glicko ratings, leaderboards, spectators and anti-cheat.
- 42.Design a Flash Sale and E-commerce CheckoutAdvanced
Design a flash sale: 10,000 units, 10M buyers in a minute. Holds with expiry, no overselling, hot-SKU contention, waiting rooms, fair access and checkout.
- 43.Design a Price Tracker (CamelCamelCamel)Intermediate
Design a CamelCamelCamel-style price tracker: collect prices for 500M products, schedule checks politely, store price history, and send price-drop alerts.
- 44.Design a Payment SystemAdvanced
Design a Stripe-like payment system: PSP card flow, idempotency, a double-entry ledger, state machines, webhooks, reconciliation, PCI security and wallets.
- 45.Design a Real-Time Payment Network (UPI and Card Rails)Advanced
Design a national real-time payment switch like UPI plus card rails: routing, VPA lookup, clearing and settlement, reversals, fraud and 24/7 availability.
- 46.Design a Personal Finance Aggregator (Mint)Advanced
Design a Mint-style money app: link bank accounts, sync and categorise transactions, track budgets and alerts, and keep credentials and data safe.
- 47.Design a Stock Trading Platform (Robinhood / Exchange)Advanced
Design a Robinhood-style broker and the exchange behind it: live prices, order lifecycle, matching engine, market-data fan-out, low latency and audit.
- 48.Design an Ad Click AggregatorAdvanced
Design a system that tracks every ad click, redirects the user, dedupes clicks and gives advertisers near-real-time, accurate per-minute metrics at scale.
- 49.Design Top-K / Trending (Top Videos, Leaderboards)Advanced
Return the K most-viewed videos for all time and for hour, day and month windows, at 700k views per second, fresh within a minute, served in milliseconds.
- 50.Design Amazon Sales Rank by CategoryAdvanced
Rank 10 million products by last week's sales in each of 1,000 categories, refresh hourly, and serve 40,000 rank lookups per second from cache.
- 51.Design a Metrics Monitoring and Alerting SystemAdvanced
Design a Datadog or Prometheus-style platform that ingests 5M metric samples per second, serves dashboards in seconds and fires alerts within a minute.
- 52.Design a Recommendation System (Twitter For You)Advanced
Pick about 50 posts from hundreds of millions for each For You request in under 1.5 seconds: candidate sources, light and heavy rankers, filters and feedback.
- 53.Design an A/B Testing and Experimentation PlatformAdvanced
Run thousands of trustworthy A/B tests at once: configs, hash-based assignment, exposure logs, metric pipelines, sequential statistics and guardrails.
- 54.Design a Distributed Message Queue (Kafka)Advanced
Design a Kafka-style partitioned, replicated log: millions of messages per second, days of retention, per-key order, no acknowledged data lost.
- 55.Design an LLM Chat Service (ChatGPT)Advanced
Design a ChatGPT-style service: streamed answers to 20k prompts/s, a scarce GPU fleet, resumable chats, fair quotas, safety checks and cost control.