System design interview prep
60 questions worked through at staff-level depth: capacity math, tradeoff tables, and the non-obvious insights that separate a senior answer from a principal one.
- questions
- 60
- levels, mid to staff
- 3
- categories
- 9
Topic
Level
Showing 60 of 60 questions
Design an A/B Testing Platform Design an experiment platform that assigns users to A/B test variants deterministically, collects and aggregates metric events, detects Sample Ratio Mismatch, and performs statistical significance tests with variance reduction. Design a Real-Time Collaborative Editor Implement conflict-free concurrent editing with Operational Transformation or CRDTs, maintain causal consistency across all collaborators, persist document history, and fan-out changes in real-time to all active editors. Design a Content Moderation System Design a multi-layer content moderation pipeline combining pre-upload hash matching, real-time ML classifiers for text/image/video, async human review queues, and an appeals management system. Design a Feature Store Build a dual-store feature platform with an offline Hive/Spark store for point-in-time correct training data and a Redis online store for low-latency serving, bridged by a Kafka materialization pipeline. Design a Real-Time Fraud Detection System Build a layered fraud detection system combining synchronous rule engine for hard blocks, real-time ML scoring with velocity features, and an asynchronous graph-based fraud ring detection pipeline. Design a Live Sports Score System Ingest score events from sports data feeds, fan-out updates to millions of concurrent WebSocket and SSE connections, and maintain a globally consistent live scoreboard with sub-second latency. Design an LLM Serving Infrastructure Design production LLM serving infrastructure handling auto-regressive token generation at scale, using continuous batching, PagedAttention KV cache management, speculative decoding, and multi-node tensor parallelism. Design an ML Model Serving Infrastructure Design a production ML serving platform that handles model versioning, online and batch inference, adaptive micro-batching, shadow-mode deployment, and canary rollouts with automatic rollback. Design a Multiplayer Game Backend Design an authoritative game server with deterministic tick-based simulation, client-side prediction, lag compensation via history buffers, and a matchmaking service that pairs players by skill rating. Design an Online Auction System Model an auction as a state machine, prevent double-bidding and sniping, handle concurrent bids under high contention, and fan-out real-time bid updates to all watchers. Design a Recommendation Engine Architect a production recommendation system combining offline collaborative filtering, real-time feature pipelines, two-tower neural network retrieval, and a lightweight ranking layer — deployed at billions-of-events scale. Design a Search Ranking System Design a production search ranking system with a two-stage pipeline: BM25 recall at scale followed by a neural re-ranker, trained on implicit click signals using Learning to Rank with NDCG loss. Design a Stream Processing System Design a stream processing system using Kafka as the event backbone and Apache Flink for stateful computation with windowing, watermarks for late data, and exactly-once semantics via two-phase commit. Design a Vector Database Build a distributed approximate nearest neighbor search system over dense embedding vectors using HNSW indexing, support CRUD operations with immediate consistency, and scale to billions of vectors with sub-10ms query latency. Design Airbnb Design Airbnb's two-sided marketplace: geo-spatial listing search with availability filtering, calendar-based booking with double-booking prevention, dynamic pricing, and the data model that handles 7 million listings across 220 countries. Design Amazon's Product Catalog Design Amazon's product catalog: a 350M-item database with real-time inventory, per-seller pricing, product search with faceted filtering, and the availability guarantee that drives 'Buy Now' at Black Friday scale. Design Discord Design Discord's real-time messaging infrastructure: persistent WebSocket fleet across millions of connections, guild sharding, voice channel SFU, online presence at scale, and the Cassandra message store behind 4 billion messages per day. Design DoorDash Design DoorDash's food delivery platform: restaurant catalog with real-time menu updates, three-sided marketplace matching (customer → restaurant → Dasher), order state machine, real-time delivery tracking, and the operational complexity of coordinating kitchen prep time with Dasher arrival. Design an Email Service Design a Gmail-scale email service: SMTP ingestion, anti-spam pipeline, conversation threading, full-text search, and the deliverability engineering that keeps your IP reputation clean at 15 billion emails per day. Design Facebook News Feed Design Facebook's News Feed at 3 B MAU — from EdgeRank's original graph-walk model to modern ML ranking with thousands of signals. Tackle write amplification, story deduplication, and privacy-aware feed generation. Design Instagram Design Instagram end-to-end: photo/video upload pipeline, ranked home feed, ephemeral Stories with 24-hour TTL, and the Explore page. Balance write amplification against read-latency at 2 B MAU. Design LinkedIn's People You May Know Design LinkedIn's social graph storage and the 'People You May Know' recommendation engine: BFS over a billion-node graph, 2nd-degree connection queries, common connection counting, and the real-time ranking pipeline that surfaces relevant suggestions. Design Netflix Design Netflix's video streaming platform: content ingestion with Mezzanine encoding, Open Connect CDN with ISP-embedded appliances, adaptive bitrate streaming, DRM, and the collaborative filtering recommendation engine behind 80% of content discovery. Design Reddit Design Reddit: the voting system, hot/top/new feed ranking, nested comment trees at depth, subreddit fan-out, and the caching strategy that keeps 1.5 B monthly visitors from melting the database. Design Slack Design Slack's workspace messaging: channel fan-out for millions of members, WebSocket fleet management, threaded message model, cross-workspace search, and the engineering choices behind @ notifications at scale. Design Spotify Design Spotify's audio streaming platform: track storage and CDN delivery, playlist management at scale, the Discover Weekly recommendation pipeline (collaborative filtering + NLP on playlist co-occurrence), and offline playback with license management. Design a Stock Trading Exchange Design a stock trading exchange: the order book data structure, price-time priority matching engine, FIX protocol order ingestion, market data fan-out, and the correctness guarantees that prevent phantom fills and duplicate executions at microsecond latency. Design Stripe's Payment Gateway Design Stripe's payment processing infrastructure: idempotent charge API, card tokenization and PCI-DSS scope isolation, the double-entry ledger for financial correctness, webhook delivery with at-least-once guarantees, and distributed money movement without distributed transactions. Design Ticketmaster Design Ticketmaster: seat reservation with atomic hold-and-pay, virtual waiting queues for Taylor Swift on-sale moments (1M users hitting simultaneously), seat map rendering, and the consistency requirements that make ticket booking harder than e-commerce. Design TikTok/Reels Design TikTok's short-form video platform: upload pipeline, the For You Page recommendation engine that drives 70% of watch time, cold-start for new creators, edge-cached pre-loading for instant playback, and content moderation at 100M videos per day. Design Twitch Live Streaming Design Twitch's live streaming infrastructure: RTMP ingest, real-time transcoding to HLS at multiple qualities, low-latency delivery (3s vs 20s trade-off), global CDN fan-out for 100K concurrent viewers, chat at millions of messages per minute, and VOD storage. Design Twitter's Home Timeline Build a home timeline feed that shows tweets from followed accounts in near-real-time. Navigate the fan-out trade-off, the celebrity problem, and Redis cache invalidation at 300 M DAU. Design Uber Ride Matching Design Uber's ride matching system: real-time driver location ingestion at 1M updates/second, geohash-based nearest driver lookup, matching algorithm, surge pricing via supply-demand imbalance, and the trip state machine from request to payment. Design WhatsApp Messenger Build WhatsApp's 1:1 and group messaging at 2 B users: Signal Protocol E2E encryption, offline message queuing, online presence at scale, and the engineering trade-offs behind 'last seen' and read receipts. Design YouTube Design YouTube end-to-end: video ingestion and transcoding pipeline, adaptive bitrate streaming with HLS/DASH, global CDN delivery, the watch-next recommendation system, and the engineering trade-offs behind serving 1 billion hours of video daily. Design Zoom Video Conferencing Design a video conferencing system like Zoom: WebRTC peer negotiation, SFU vs MCU topologies, simulcast for adaptive quality, jitter buffer management, and the network engineering behind 1-second latency for 1,000-person webinars. Design an API Gateway / Service Mesh Design the API Gateway and service mesh layer that handles cross-cutting concerns — rate limiting, authentication, mTLS, traffic shifting for canary deploys, circuit breaking, and retry budgets — so individual microservices don't need to implement these themselves. Design a CDN Design a global CDN that serves static assets with < 20ms latency worldwide using Anycast routing, a multi-tier cache hierarchy, and intelligent cache purge propagation — covering PoP placement, origin shield, cache key design, and edge computing for dynamic content. Design a CI/CD Pipeline at Scale Design a CI/CD platform that runs 10,000 builds per day, scales worker capacity elastically, caches build artifacts to avoid redundant work, and provides safe progressive delivery — covering DAG scheduling, sandbox isolation, build cache deduplication, and canary deployment automation. Design a Consistent Hashing & Sharding Service Design the ring-based consistent hashing algorithm that powers DynamoDB and Cassandra — covering virtual nodes, rebalancing cost, hotspot prevention, and when to use jump hash instead. Design a Distributed Cache Design a distributed in-memory cache supporting sub-millisecond reads, multiple eviction policies, and horizontal sharding — covering write strategies, hot-key mitigation, and cache invalidation, which is famously one of the two hard problems in CS. Design a Distributed Job Scheduler Design a distributed cron-like scheduler that triggers millions of jobs per day with exactly-once semantics, survives node failures without missed or duplicate triggers, and supports DAG-based workflows — covering leader election, idempotency, and backfill strategies. Design a Distributed KV Store Design an eventually-consistent, leaderless distributed key-value store in the style of Amazon Dynamo — covering quorum reads and writes, vector clocks for conflict resolution, gossip-based membership, Merkle trees for anti-entropy, and sloppy quorums for availability under partitions. Design a Distributed Locking Service Design a distributed lock service that provides mutual exclusion across processes with lease-based expiry, fencing tokens to handle GC pauses, and Raft consensus for correctness — the primitives behind leader election, distributed coordination, and config management. Design a Distributed Logging System Design a logging pipeline that ingests billions of structured log lines per day, supports full-text search with sub-second latency, and implements hot/warm/cold tiering to control storage costs — covering sampling strategies, schema design, and query performance. Design a Distributed Rate Limiter Build a distributed rate limiter that enforces per-user and per-endpoint quotas at millions of requests per second, with sub-millisecond overhead and no single point of failure. Design a Distributed Unique ID Generator Design a service that generates globally unique, roughly time-sortable 64-bit IDs at millions per second across distributed nodes — covering Snowflake layout, clock skew handling, and monotonicity guarantees without coordination. Design Dropbox / Google Drive Design a cloud file storage service that syncs files across devices in near-real-time using block-level deduplication, delta sync (only transfer changed blocks), and conflict resolution — handling 100M users and petabytes of storage. Design Google Maps + Routing Design the core systems behind Google Maps: a tile-based map rendering pipeline, a routing engine using Contraction Hierarchies for sub-second driving directions on billions of edges, and a real-time traffic ingestion system that continuously updates route weights. Design Google Search Design a web-scale search engine covering the full pipeline: crawling and indexing billions of documents with an inverted index, scoring with BM25 + PageRank, distributed query execution across thousands of index servers, and real-time index updates for freshness. Design a Distributed File System (HDFS) Design a distributed file system in the style of HDFS and GFS — covering NameNode/DataNode architecture, block replication with rack awareness, NameNode HA using Quorum Journal Manager, and the write-once-read-many access model that enables MapReduce-style workloads at petabyte scale. Design a Metrics & Monitoring System Design a time-series metrics system that collects billions of data points per day, stores them with 10× compression, evaluates alerting rules in near-real-time, and supports ad-hoc queries — covering pull vs push, cardinality limits, Gorilla compression, and downsampling. Design a Multi-channel Notification System Design a notification platform that routes events to push (FCM/APNs), email (SendGrid), and SMS (Twilio) channels — covering fanout strategies, exactly-once delivery semantics, user preference management, and rate limiting per channel. Design Photo Storage at Scale Design a purpose-built photo storage system in the style of Facebook Haystack — storing hundreds of billions of photos with sub-millisecond disk lookup by packing many small objects into large files, eliminating filesystem metadata overhead, and aggressive cold tiering. Design S3-like Object Storage Design a petabyte-scale object storage system supporting 11 nines of durability using erasure coding, multi-region replication, and an eventually-consistent bucket listing — covering data placement, multipart upload, storage classes, and lifecycle policies. Design a Top-K / Trending System Design a system that identifies the top-K most frequent items (trending hashtags, popular videos, heavy-hitter IPs) in a stream of billions of events — covering Count-Min Sketch for frequency estimation, HyperLogLog for distinct count, and a two-tier aggregation pipeline. Design Typeahead / Autocomplete Design a typeahead suggestion service that returns top-K search completions in < 50ms — covering trie sharding, prefix caching in Redis, personalization layer, and the data pipeline that keeps suggestions fresh from query logs. Design a URL Shortener Build a URL shortening service handling 100M new URLs/day and 10B redirects/day — the classic read-heavy, write-light system that tests your caching, hashing, and storage intuitions. Design a Web Crawler Design a distributed web crawler that discovers and indexes billions of pages — balancing politeness (robots.txt, rate limits per domain), deduplication at scale (Bloom filters + URL fingerprinting), and recrawl scheduling (freshness vs cost). Design Yelp / Nearby Places Design a proximity search service that finds businesses near a given location — covering geohash indexing, ranking by distance and rating, review aggregation at scale, and the write path for new businesses and reviews.
No questions match these filters.