Interview Q&A · questions with model answers

System Design Problems Interview Questions

Part of the study plan for: Backend Engineer · Tech Lead · Full Stack Engineer · Forward Deployed Engineer (FDE)

Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.

  1. Most asked Design a URL shortener (like bit.ly).

    Generate short unique codes mapped to long URLs, serve redirects with very low latency from a cache, and record click analytics asynchronously. Reads dominate writes (~100:1), so the redirect path…

  2. Most asked Design a distributed rate limiter.

    Count requests per key (user, API key, IP) in a shared fast store like Redis using a token bucket or sliding-window algorithm executed atomically, enforce it in a gateway or middleware, and return…

  3. Most asked Design a chat application (like WhatsApp or Slack).

    Clients keep persistent WebSocket connections to gateway servers; messages are persisted to a partitioned store, then fanned out to online recipients through a pub/sub layer that knows which gateway…

  4. Most asked Design a social media news feed (like Twitter/X or Instagram).

    Precompute feeds by fanning out new posts to followers' timelines in a cache (fan-out on write) for normal users, merge posts from celebrities at read time (fan-out on read), and rank the merged…

  5. Most asked Design a notification system (email, SMS, push).

    Services publish notification requests to a queue; a notification service applies user preferences, templates, deduplication and rate limits, then routes to per-channel workers that call providers…

  6. Most asked Design a payment system.

    Accept payment intents with idempotency keys, orchestrate charges through payment providers with a state machine, record every money movement in a double-entry ledger, process provider webhooks…

  7. Most asked Design a ticket booking system (like Ticketmaster).

    Hold seats with short-lived reservations (atomic seat-state transitions or Redis locks with TTL), complete payment within the hold window, and protect hot on-sales with a virtual waiting room that…

  8. Most asked Design a distributed unique ID generator.

    Generate 64-bit, roughly time-ordered IDs without coordination using the Snowflake layout (timestamp + machine ID + per-millisecond sequence), assigning machine IDs at startup and handling clock…

  9. Most asked Design a rate limiter for a public API.

    Identify clients (API key, user, IP), choose an algorithm (token bucket for bursts with a steady rate, sliding window for strict limits), store counters in a fast shared store such as Redis with…

  10. Most asked Design a webhook delivery system.

    Record events durably, enqueue one delivery per subscribed endpoint, send signed HTTP requests from workers with timeouts, retry failures with exponential backoff over hours/days, and isolate slow…

  11. Most asked Design an authentication service with SSO for multiple apps.

    Run a central identity provider implementing OpenID Connect: apps redirect users to it (Authorization Code + PKCE), it authenticates (passwords with MFA, social or enterprise IdPs), issues…

  12. Design a file storage and sharing service (like Dropbox or Google Drive).

    Store file content in object storage as content-addressed chunks, keep metadata (folders, versions, permissions) in a database, upload/download directly with pre-signed URLs, and sync clients via…

  13. Design search autocomplete (typeahead).

    Precompute the top suggestions per prefix from query logs (offline aggregation), store them in a trie or key-value map prefix → top-k list, serve from memory/cache with very low latency, and…

  14. Design a distributed job scheduler / task queue.

    Persist jobs with schedules in a durable store, have scheduler nodes claim due jobs safely (leases with SKIP LOCKED or a queue), dispatch them to worker pools, and track attempts, retries with…

  15. Design a video streaming platform (like YouTube).

    Upload raw video to object storage, transcode it asynchronously into multiple resolutions and bitrates segmented for adaptive streaming (HLS/DASH), serve segments through CDNs, and keep metadata,…

  16. Design a web crawler.

    Maintain a URL frontier prioritized and partitioned by host, fetch pages politely (robots.txt, per-host rate limits) with distributed fetchers, parse and extract links, deduplicate URLs and content,…

  17. Design a real-time leaderboard for a game.

    Use Redis sorted sets keyed by leaderboard (global, per region, per period) with ZINCRBY on score updates and ZREVRANGE/ZREVRANK for top-N and a player's rank, persisting scores durably to a…

  18. Design a ride-sharing service (like Uber).

    Drivers stream locations to a geospatial index (geohash/H3 cells in memory), riders' requests query nearby available drivers, a matching service offers trips with timeouts, and a trip service…

  19. Design the checkout and inventory system for an e-commerce site.

    Reserve inventory atomically during checkout (conditional updates or reservations with expiry), create the order and payment intent idempotently, confirm on payment success via a saga, and release…

  20. Design a distributed cache (like Memcached/Redis Cluster).

    Partition keys across nodes with consistent hashing (or hash slots), keep data in memory with eviction (LRU/LFU) and TTLs, replicate for availability, and have clients or proxies route requests to…

  21. Design a collaborative document editor (like Google Docs).

    Clients edit locally and exchange operations over WebSockets with a document session server; concurrent edits are merged with Operational Transformation or CRDTs, operations are persisted as a log…

  22. Design a metrics monitoring and alerting system (like Prometheus/Datadog).

    Agents collect metrics and ship them to an ingestion tier, which writes to a time-series database with compression and downsampling; a query engine powers dashboards, and an alert evaluator runs…

  23. Design a centralized logging pipeline.

    Applications write structured logs to stdout; collectors (Fluent Bit/Vector/OTel Collector) ship them to a buffer (Kafka), processors parse, enrich and redact them, and they're indexed into a search…

  24. Design an API gateway.

    A horizontally scaled, stateless proxy layer that terminates TLS, authenticates requests, applies rate limits and quotas, routes to backend services by path/host, and adds observability, with…

  25. Design a distributed key-value store (like DynamoDB/Cassandra).

    Partition keys with consistent hashing, replicate each partition to N nodes, use tunable quorums (R + W > N) for consistency, resolve conflicts with versioning, and handle failures with hinted…

  26. Design Pastebin.

    Store paste metadata in a database and content in object storage (or the DB for small pastes), generate short unique keys, serve reads through a cache/CDN, and expire pastes with TTLs and a cleanup…

  27. Design a 'find nearby places' service (like Yelp).

    Store businesses with coordinates in a geospatial index (geohash/quadtree/H3 or PostGIS), query cells covering the search radius, filter and rank by distance, rating and relevance, and cache results…

  28. Design a feature flag service.

    Store flag definitions and targeting rules centrally, stream changes to SDKs that cache rules locally and evaluate flags in process (no network call per check), and record exposures for experiments…

  29. Design a stock exchange order matching engine.

    Sequence all orders for an instrument through a single-threaded matching engine holding an in-memory order book (price-time priority), persist the input sequence to a replicated log for recovery,…

  30. Design a full-text search service for a product catalog.

    Index products into a search engine (Elasticsearch/OpenSearch) built on inverted indexes, keep it in sync with the primary database through change events (CDC/outbox), and serve queries with…

  31. Design a system to count likes/views at large scale.

    Accept like/view events into a queue, aggregate in memory or with stream processing per item, and periodically flush increments to a durable store; keep a per-user record of likes for idempotency,…

Was this page helpful?

Report a mistake