System design

Design the systems interviewers ask about.

Complete walkthroughs: requirements, scale maths, APIs, architecture diagrams, trade-offs and what breaks first.

60

problems

9

categories

718

sections

01Marketplace & BookingURL ShortenerCaching + Key GenerationA URL shortener maps long, unwieldy URLs to short memorable codes and redirects anyone who clicks them. The concept is trivial — a key-value lookup. The challenge is serving bil100M DAURead-heavy 1000:102Social & FeedNews FeedFan-out ProblemA social media feed that shows posts from people you follow, ranked algorithmically, updated in near-real-time. The core challenge: one celebrity post needs to reach 10 million500M DAURead-heavy 15:103Storage & DataGoogle DriveChunk + SyncA cloud file storage and synchronisation service that lets users upload any file, access it from any device, share it with others, and keep it in sync across all their machines500M users7.5 Exabytes04CommunicationWhatsAppWebSockets + Real-time RoutingA real-time messaging system supporting one-to-one and group chat, delivery receipts, and offline message queuing at 2 billion user scale. The core challenge: maintaining 50 mil2B Users100B msgs/day05Media & StreamingYouTube / NetflixVideo Encoding PipelineA video streaming platform that ingests raw user-uploaded content (YouTube) or studio-licensed media (Netflix), transcodes it into adaptive renditions, and delivers billions of500M DAURead-heavy 200:106Search & DiscoverySearch AutocompleteTrie + Top-K cachingA typeahead system that returns ranked suggestions on every keystroke — at sub-100ms latency, for billions of daily searches. The challenge isn't finding matches. It's pre-organ5B searches/day<100ms p9907InfrastructureRate LimiterSliding Window CounterA rate limiter controls how frequently a client can make requests to an API — protecting backend services from being overwhelmed by traffic spikes, malicious abuse, or runaway r100K RPSLow Latency (<5ms overhead)08Search & DiscoveryWeb CrawlerURL Frontier + DeduplicationA system that automatically traverses the web — starting from seed URLs, fetching pages, extracting links, and repeating — to build a searchable index of internet content. Decep10B pages09Search & DiscoveryYelp / Google PlacesGeospatial IndexingA local business discovery platform where users search for nearby restaurants, shops, and services by location, category, and filters. The core challenge is answering "what is n50M DAU100M Businesses10Social & FeedAd Click AggregatorStream Aggregate + Fraud Filter + OLAP Query10 billion clicks per day, counted in real-time for billing and analytics. Every click is money. The hard parts: a streaming aggregation pipeline that groups clicks by campaign,~10B clicks/day~115K clicks/sec avg11Marketplace & BookingAirbnbAvailability + Pricing + BookingA two-sided marketplace with ~7M listings and ~100M nights booked per year. The hard parts: date-range availability search — "find homes in Lisbon for 4 guests, June 3–10, under7M listings100M nights/year12Financial & TradingBidding PlatformDesign an eBay-scale auction system where sellers list items, buyers place real-time bids, proxy bidding resolves automatically, and auctions close with sub-second precision — a13InfrastructureCode Deployment PipelineHermetic Build + Immutable Artifact + Canary AnalysisDeveloper pushes code. CI builds and tests inside isolated ephemeral containers . An immutable, SHA-tagged artifact is stored in an S3-backed content-addressed store. CD does a~10K deploys/day~1000 concurrent builds14CommunicationCollaborative WhiteboardCRDT + Spatial Index + Real-Time Cursors + Per-User UndoInfinite canvas. Shapes, text, freehand drawing. Multiple users see each other's cursors in real time . Undo/redo, zoom/pan, offline edits that sync when reconnected. Like Miro100K+ canvas objects50+ concurrent users15InfrastructureCount Unique Active UsersDesign a system to count DAU, WAU, and MAU at massive scale — balancing exact accuracy for financial reporting against real-time approximate answers for dashboards, using probab16Financial & TradingCrypto ExchangeMatching + Wallets + Blockchain IngressA cryptocurrency exchange like Coinbase or Binance: order-book trading across hundreds of coin pairs, wallets for hundreds of coins, deposits + withdrawals to the public blockch~100K trades/sec24/7 operation17InfrastructureCDNAnycast + Cache Hierarchy + PurgeA global Content Delivery Network: serve cached copies of customer content from hundreds of edge points-of-presence (PoPs), delivering to users with sub-50ms RTT anywhere on Ear300+ PoPs55M req/sec18InfrastructureChatGPTKV-Cache + Continuous Batching + Tensor ParallelismUser sends a prompt. API gateway routes it through a tokenizer to a GPU cluster of ~10K A100s running autoregressive inference. Tokens stream back via server-sent events — the u~100M users~1B tokens/day19InfrastructureDistributed CacheHash-Slot Sharding + Eviction + ReplicationAn in-memory key-value store serving ~1M ops/sec per node with sub-millisecond latency. The hard parts: hash-slot sharding across a cluster of ~100 nodes so any key routes deter~1M ops/sec per nodeSub-ms p99 reads20InfrastructureDistributed Job SchedulerHow do you reliably execute millions of scheduled tasks at precisely the right time across a fleet of unreliable machines, ensuring no job is missed and no job runs twice?21InfrastructureDistributed LockingHow do you guarantee that at most one process operates on a shared resource at any time, across machines that can crash, networks that can partition, and clocks that can drift?22Storage & DataDistributed Logging FrameworkDesign a centralized logging system that ingests hundreds of thousands of events per second from thousands of services, stores them durably with compression, and enables full-te23InfrastructureDistributed Priority QueueDesign a horizontally scalable queue that always delivers the highest-priority message first — like a planetary-scale ER triage system where the most critical patients are alway24Marketplace & BookingDoorDash / Uber EatsDispatch + ETA + TransactionsA three-sided marketplace: eaters order, merchants prepare, Dashers deliver. The hard parts: a dispatch engine that assigns the right Dasher to the right order in real-time opti~6M orders/day~300k daily Dashers25Storage & DataDropbox SyncBlock Dedup + Metadata + Sync LoopA two-way file sync engine: every file in a user's "Dropbox" folder should appear identically across all their devices within seconds of any change. The hard parts: a content-ad~700M users4 MB blocks26Marketplace & BookingE-Commerce PlatformDesign a large-scale platform like Amazon or Flipkart — from product search to checkout — where millions browse concurrently but inventory must never oversell.27Marketplace & BookingFlash SaleWaiting Room + Atomic Inventory + Fair Queue100K users hit "Buy" at the exact same second for 1K limited items. No overselling. The hard parts: a waiting room that absorbs the thundering herd without crashing your backend100K concurrent users1K items28Financial & TradingReal-time Fraud DetectionOnline Features + ML Scoring + FeedbackA system that scores every incoming payment / account action in under 100 ms and decides: approve, review, or block. The hard parts: a low-latency feature store that can answer< 100 ms decision~10K tx/sec29CommunicationGmailSMTP Ingress + Spam + SearchAn email service for ~1.8B users handling ~1B incoming emails per day plus outgoing. The hard parts: an SMTP ingress that accepts mail from anyone on the public internet while r1.8B users~1B emails/day30Financial & TradingGoogle AdsAuction + Quality Score + Budget Pacing + Click TrackingAdvertiser creates a campaign. Every search query or page-view triggers an ad auction in under 100 ms. The winner's ad is shown, the click is tracked , and the advertiser is bil10M+ auctions/secSub-100ms latency31CommunicationGoogle CalendarRRULE Expansion + Free/BusyA calendar and scheduling platform handling recurring events, calendar sharing, and free/busy queries for 1.5 billion users across every timezone. The hard parts: an RRULE recur1.5B users~500M events/day32Storage & DataGoogle Docs / Live Collaborative EditorDesign a real-time collaborative document editor where multiple users type simultaneously and every screen converges to the same result — without locks, without data loss, and w33Search & DiscoveryGoogle MapsDesign a global mapping platform that renders interactive maps, computes optimal routes in milliseconds, and ingests real-time GPS data from millions of phones to estimate live34Search & DiscoveryGoogle NewsCrawl + Cluster + Rank + PersonalizeCrawl 50K+ news sources worldwide, rank by freshness + authority + personalization, and serve a unique feed to each of 1B users. The hard parts: near-duplicate clustering so use1B users100K articles/day35Social & FeedInstagramMedia Pipeline + Ranked FeedA photo and short-video sharing platform with feeds, stories, reels, and direct messaging serving 2 billion monthly active users. The hard parts: a media upload pipeline handlin2B MAU95M uploads/day36Storage & DataKey-Value StoreConsistent Hashing + LSM Engine + Quorum Replication10 million requests per second, 100 TB of data, single-digit millisecond p99 at any scale. The hard parts: a consistent hash ring that routes every request to the right partitio~10M req/sec~100 TB data37Social & FeedTop-K LeaderboardDesign a real-time ranking system that maintains sorted standings of millions of users, serving both "who's on top?" and "what's my rank?" with sub-50ms latency.38InfrastructureLeetCodeSandbox + Judge Queue + VerdictsUsers submit code solutions in 15+ languages. The system compiles, runs against hidden test cases with strict time/memory limits, and returns a verdict — all within seconds. The10M submissions/day15+ languages39Media & StreamingLive Streaming PlatformDesign a Twitch-scale live streaming platform where creators broadcast live video to millions of concurrent viewers with sub-5-second latency, real-time chat, and adaptive quality.40InfrastructureMetrics & MonitoringAgents + TSDB + Query Engine + Alerting1M hosts each running an agent that collects CPU, memory, disk, and custom application metrics every 10-15 seconds. That is ~100M data points/sec flowing into your ingest pipeli1M hosts10M unique series41Social & FeedLinkedIn MutualConnection SearchDesign a system that finds shared connections between any two users on a billion-user professional network — in under 50ms, at 100K+ queries per second.42CommunicationNotification SystemDesign a scalable, multi-channel notification platform that reliably delivers OTPs in 2 seconds and promo blasts to 50 million users — without one starving the other.43Financial & TradingPayment GatewayDesign a system like Stripe or Amazon Pay that orchestrates multi-party financial transactions across unreliable networks — guaranteeing money is never lost, duplicated, or stuc44GamingDesign PUBGDesign a multiplayer battle royale system where 100 players drop onto a large map, scavenge for equipment, and fight until one player or squad survives — all synchronized in rea45Social & FeedRecommendation AlgorithmDesign the engine behind "Recommended for you" — a system that surfaces personalised content or products for hundreds of millions of users across a catalogue of millions of item46Social & FeedReddit-Style CommentsDesign a nested, threaded comment system with voting, ranking algorithms, and tree pagination — where the hardest problem isn't storing data, it's retrieving a sorted, truncated47Social & FeedRedditHot Ranking + Comment Trees + Vote Pipeline1.7 billion monthly visits across millions of subreddit communities. The hard parts: a Hot ranking algorithm that decays old posts and surfaces fresh content without scanning ev1.7B monthly visits100K posts/day48CommunicationReminder AlertTime Buckets + Timezone + At-Least-OnceSchedule a reminder for "Thursday 9am in America/New_York" and have it arrive on the user's phone at exactly that local time — even when DST changes, the user moves timezones, o~100M reminders/day49Storage & DataAmazon S3Durability + Hot-Partition HandlingA bucket-and-key object store with read-your-writes consistency, ~ 11 nines of durability , and exabyte-scale capacity. The hard parts: a key → bytes service that doesn't fall o11 nines durability100T+ objects50Search & DiscoverySearch EngineInverted Index + RankingA web-scale search engine — crawl the public web, build an inverted index, serve queries in under 200 ms with high-quality ranked results. Google handles ~100K queries per secon~100K QPS< 200 ms p9951Marketplace & BookingShopping CartAdd/Remove/Merge + Soft Hold + Price Lock500M carts updated daily across every device. Never lose a cart. The hard parts: a hybrid storage layer that keeps hot carts in Redis for sub-ms reads while persisting to Dynamo~500M carts/day~50K ops/sec52CommunicationSlack / DiscordWebSockets + Fan-Out + PresenceA real-time messaging platform with channels, DMs, threads, reactions, presence, and file sharing. The hard parts: a persistent WebSocket fleet holding tens of millions of long-200M MAU (Discord)~4B msgs/day53Financial & TradingHigh-Throughput Stock ExchangeDesign a NASDAQ-scale order-matching system that processes millions of orders per second with single-digit microsecond latency, maintains deterministic fairness guarantees, and54Financial & TradingStock Trading PlatformDesign a Robinhood-scale platform that handles money and stock ownership with zero tolerance for inconsistency, while simultaneously streaming real-time price data to millions o55Marketplace & BookingTicketmaster / StubHubDesign an online ticket booking platform that handles extreme concurrency spikes — millions of users competing for thousands of seats — without ever selling the same seat twice.56Social & FeedTwitter TrendingStream Top-K + Novelty + Anti-SpamSurface the top-10 trending topics — hashtags, phrases, named entities — from the firehose of all tweets, refreshed every few minutes, per geo and per user. The hard parts: appr~6K tweets/sec500M tweets/day57Marketplace & BookingUber / Ride SharingDesign a real-time ride-hailing platform that matches riders with nearby drivers, tracks trips live on a map, handles geographic demand spikes, and calculates ETAs — all at city58InfrastructureUnique ID GeneratorSnowflake-style Distributed IDsGenerate globally unique, k-sortable, compact identifiers at over 1 million IDs per second across N machines with zero coordination. The hard parts: a bit-layout balancing times1M+ IDs/sec64-bit / ~11 chars base6259CommunicationVideo ConferencingDesign a real-time video conferencing platform like Zoom or Microsoft Teams — delivering sub-300ms audio/video to millions of concurrent participants across the globe while adap60Social & FeedYouTube Likes CounterSharded Counters + DedupA distributed counter system that handles 10M+ increments per second across 10B+ videos with eventual consistency for display. The hard parts: a sharded counter architecture tha10B+ videos~500K likes/sec peak