Skip to content

System design

Classic design questions, each with a full walkthrough: requirements, estimates, architecture and trade-offs.

SD-1Mid
URL ShortenerKey generation, read-heavy caching, redirects
SD-2Senior
Chat AppWebSockets, fan-out, message order, delivery receipts
SD-3Mid
PastebinLarge immutable blobs, object storage, CDN reads, expiry
SD-4Mid
Photo Social NetworkPhoto uploads, resizing, CDN delivery, follow graph, feed fan-out
SD-5Senior
File Sync and StorageBlock-level sync, dedup, change journal and cursors, push notifications, conflicts
SD-6Mid
Microblog TimelineHome timeline fan-out, celebrity accounts, timeline and tweet caches, time-sorted IDs
SD-7Senior
Video StreamingTranscoding pipeline, segments and adaptive bitrate, CDN and origin shield, resumable uploads
SD-8Senior
Typeahead AutocompleteTries with precomputed top-k, offline build from logs, edge caching of prefixes, trending queries
SD-9Senior
API Rate LimiterToken buckets, shared counters across gateways, atomic updates, failing open, multi-region limits
SD-10Staff
Distributed Metrics AggregationTime-series ingest, sharding by series, rollups, cardinality control, fast range queries
SD-11Staff
Distributed Event LogPartitioned replicated logs, ISR and acks, consumer groups, offsets, tiered storage
SD-12Senior
Key-Value StoreConsistent hashing, N/R/W quorums, hinted handoff, Merkle repair, LSM-tree storage
SD-13Senior
Top Shared ArticlesStream aggregation, sliding windows, top K, hot keys, exactly-once counting
SD-14Senior
Web CrawlerURL frontier, politeness per host, URL and content dedup, DNS, recrawl scheduling
SD-15Senior
News FeedFan-out on write vs read, celebrity accounts, timeline cache, hydration, ranking
SD-16Staff
Nearby Places and FriendsGeospatial indexing, geohash cells, live location fan-out over pub/sub
SD-17Senior
Server Metrics CollectorPush ingestion, time-series storage, downsampling, alerting at scale
SD-18Senior
Calendar ServiceRecurring events, time zones, invite fan-out, reminder scheduling, device sync
SD-19Senior
Distributed Message QueueReplicated logs, group commit, acks and redelivery, partitions, dead letters
SD-20Senior
Web Analytics PipelineEvent ingestion, stream rollups, columnar storage, HyperLogLog uniques, bot filtering
SD-21Mid
Sorting Large Data SetsExternal merge sort, range partitioning, key sampling, shuffle, task retries
SD-22Mid
Top K RankingsStream counting, sliding windows, top-K merge, precomputed lists, ranking fraud
SD-23Mid
Job SchedulerDue-time index, run queue, sharded schedulers with leases, at-least-once runs, cron spikes
SD-24Senior
Notification ServiceChannel queues, priority lanes, campaign fan-out, provider limits, preferences, dedupe and delivery tracking
SD-25Staff
Surge PricingStream processing, windowed counts per map cell, smoothing, locked quotes
SD-26Senior
Concurrent Stream LimitsLeases with TTL, atomic check-and-add, heartbeats, sharding by account, fail open
SD-27Staff
ETA and Location SharingLive location fan-out, WebSockets and pub/sub by trip, road graph routing, live traffic
SD-28Senior
Hotel BookingSearch vs booking split, no double booking, holds with expiry, payments, sharding by hotel
SD-29Senior
A/B Testing PlatformDeterministic hash assignment in the SDK, exposure logging, event pipeline, trustworthy statistics, guardrails
SD-30Mid
Price AlertsEvent-driven matching, range index on target price, fan-out on sale days, fire once and re-arm
SD-31Staff
Dependency Injection FrameworkRegistry and resolver, lifetimes and scopes, graph validation, compiled plans, thread safety, disposal, build-time code generation
SD-32Staff
Card Payment ProcessingIdempotency, payment state machine, timeouts and reversals, double-entry ledger, tokenization, settlement
SD-33Senior
Like Counts at ScaleHot counters, idempotent likes, async aggregation, hot-key caching, recounts
SD-34Staff
Database Control PlaneShard map, consensus metadata, failure detection, placement, durable workflows, cells
SD-35Senior
Login and AuthenticationPassword hashing, server-side sessions, gateway checks, credential stuffing, MFA, resets
SD-36Mid
Weather AppGrid-cell cache keys, bulk ingest, CDN for storm spikes, provider limits, alert fan-out
SD-37Mid
Collaborative DocumentsReal-time co-editing, operation logs, one owner per document, snapshots and version history
SD-38Mid
Social MarketplaceGeo + text search, keeping a search index in sync, photo delivery, ranking and trust
SD-39Senior
Cluster Health MonitoringFailure detection without false alarms, a metrics pipeline at millions of samples a second, alert grouping, watching the watcher
SD-40Senior
Ride and Courier MatchingLive location ingest, geo cells, matching with ETAs, driver locks, offers over WebSockets
SD-41Staff
Distributed TracingContext propagation, tail sampling by trace id, span pipelines, cheap trace storage, metrics before sampling
SD-42Senior
Flash GiveawayLaunch spikes, waiting rooms, sharded inventory counters, one claim per user, bots, async fulfilment
SD-43Senior
File DownloaderChunked range requests, resume, retries with backoff, integrity checks, signed CDN delivery
SD-44Mid
Live Stock PricesExchange feed ingest, push over WebSockets, conflation, symbol fan-out, regional gateways
SD-45Senior
Photo LibraryDirect resumable uploads, hash dedupe, async thumbnails, timeline by user, sharing, cold storage
SD-46Senior
On-Call EscalationAlert dedupe, durable timers, on-call schedules, multi-provider paging, never missing a page
SD-47Senior
Wire Transfer APIIdempotency keys, double-entry ledger, holds, outbox to the payment network, reconciliation
SD-48Senior
Live CommentsWebSocket gateways, pub/sub by post, hot-post sampling and batching, catch-up by cursor, moderation
SD-49Mid
Live Page Viewer CountPresence counting, heartbeats and expiry, counting at the gateway, fan-out to viewers, hot pages
SD-50Mid
Live LikesHot counters, idempotent likes, stream aggregation, count caching, coalesced live updates
SD-51Staff
Cloud Data MigrationBulk transfer math, network vs shipped appliances, chunked resumable copies, verification, change capture and cutover
SD-52Senior
Peer-to-Peer File TransferHashed pieces, trackers sharded by info hash, rarest-first and tit-for-tat, DHT, NAT traversal
SD-53Mid
Parts CompatibilityFitment rules compiled to vehicle sets, vehicle-filtered search, fit cache, supplier feed validation
SD-54Staff
Ads Management and DeliveryTargeting index, two-stage ranking and auction, leased budgets and pacing, exactly-once billing from an event stream