Skip to content

🟑 Middle Level (251–500)

← Junior Β· README Β· Senior β†’

Focus: Real-world system designs (Twitter feed, Instagram, Bitly, Yelp), trade-offs, sharding, replication, MQ patterns, caching strategies, microservices communication, basic distributed concepts.

For whom: 2–5 years of experience, mid-level engineer. Time per question: 30–45 minutes, whiteboard sketch with components.


🧠 Core Distributed Concepts (251–280)

  1. Explain the CAP theorem and the three trade-offs.
  2. Explain the PACELC theorem.
  3. What is BASE in contrast with ACID?
  4. Explain strong consistency vs eventual consistency with examples.
  5. What is read-your-writes consistency?
  6. What is monotonic read consistency?
  7. What is causal consistency?
  8. What is linearizability?
  9. What is serializability?
  10. What is the difference between linearizability and serializability?
  11. Explain quorum (R + W > N) in distributed databases.
  12. What is consistent hashing and why is it useful?
  13. How do virtual nodes (vnodes) help in consistent hashing?
  14. What is a hot shard and how do you mitigate it?
  15. What is split-brain in distributed systems?
  16. What are the trade-offs of strong vs eventual consistency in a chat app?
  17. What is "exactly-once" semantics and is it achievable?
  18. Explain at-most-once vs at-least-once vs exactly-once.
  19. What is back-pressure?
  20. What is fan-out (read vs write)?
  21. What is the difference between push vs pull models?
  22. What is the difference between sync replication and async replication?
  23. What is data locality and why is it important?
  24. What is leader–follower replication?
  25. What is multi-master replication and what are its conflicts?
  26. What is replication lag?
  27. What is geo-replication?
  28. What is horizontal vs vertical partitioning?
  29. What is sharding by range vs hash vs directory?
  30. What is a "shard key" and how do you pick one?

πŸ›’οΈ Database & Sharding (281–320)

  1. When would you choose Cassandra over Postgres?
  2. When would you choose MongoDB over MySQL?
  3. When would you use DynamoDB?
  4. When would you use Redis as a primary store vs cache?
  5. What are secondary indexes and what do they cost?
  6. What is a covering index?
  7. What is an index merge?
  8. What is the cost of too many indexes?
  9. What is a write-ahead log (WAL)?
  10. What is MVCC (multi-version concurrency control)?
  11. What are the four standard isolation levels?
  12. What is a phantom read?
  13. What is a non-repeatable read?
  14. What is dirty read?
  15. How would you migrate a schema with zero downtime?
  16. How does double-write deal with cache–DB consistency?
  17. How do you handle failed cache writes?
  18. What is read-through cache?
  19. What is a cache stampede and how to avoid it?
  20. What is request coalescing?
  21. What is a denormalized read model?
  22. What is materialized view?
  23. What is CDC (change data capture)?
  24. How does CDC help with cache invalidation?
  25. What is an outbox pattern?
  26. What is a saga pattern?
  27. What is two-phase commit and why is it problematic?
  28. What is three-phase commit?
  29. What is eventual consistency through compensating transactions?
  30. How would you shard a "users" table by user_id?
  31. How would you shard a "messages" table for a chat app?
  32. What is co-location of related shards?
  33. What is the "hot key" problem in sharded systems?
  34. How would you re-shard a live database?
  35. What is a global secondary index?
  36. What is a local secondary index?
  37. What is the n+1 query problem and how to fix it?
  38. What is connection pooling at the proxy level (PgBouncer)?
  39. What is read-replica lag and how to handle it for user-facing reads?
  40. What is the difference between OLTP and OLAP DBs at the architecture level?

πŸ“¨ Messaging & Streaming (321–350)

  1. What is Apache Kafka at a high level?
  2. How do partitions work in Kafka?
  3. What is a Kafka consumer group?
  4. What is offset in Kafka and how is it managed?
  5. How does Kafka guarantee ordering?
  6. What is RabbitMQ and how does it differ from Kafka?
  7. What is an exchange in RabbitMQ (direct, topic, fanout, headers)?
  8. What is dead-letter queue?
  9. When do you use SQS vs SNS?
  10. When do you use Kafka vs Kinesis?
  11. What is the difference between queue and topic?
  12. What is a consumer lag and how do you monitor it?
  13. How do you achieve at-least-once delivery?
  14. How do you make a consumer idempotent?
  15. What is the outbox + relay pattern?
  16. How do you design retries with exponential backoff and jitter?
  17. What is poison pill in queue processing?
  18. How would you handle ordering across partitions?
  19. What is a compacted topic in Kafka?
  20. What is exactly-once semantics in Kafka?
  21. What is mirror-maker?
  22. What is a stream-table duality?
  23. What is windowing in stream processing?
  24. What is a watermark in stream processing?
  25. What is event time vs processing time?
  26. When do you choose Flink vs Spark Streaming?
  27. What is back-pressure handling in a streaming pipeline?
  28. What is a side-car proxy in messaging context?
  29. How do you handle schema evolution (Avro, Protobuf)?
  30. What is the difference between push and pull queue consumers?

🌐 Microservices & APIs (351–380)

  1. What are pros and cons of microservices vs modular monolith?
  2. How do you decide service boundaries (DDD)?
  3. What is a bounded context?
  4. What is an aggregate in DDD?
  5. What is service discovery and why is it needed?
  6. What is client-side vs server-side service discovery?
  7. What is the role of an API gateway in microservices?
  8. What is a service mesh and why use it?
  9. What is sidecar pattern (Envoy/Istio)?
  10. How do services authenticate to each other (mTLS, JWT)?
  11. What is a circuit breaker and how does it work?
  12. What is a bulkhead pattern?
  13. What is retry storm and how to avoid it?
  14. What is a backend-for-frontend (BFF)?
  15. What is a strangler fig pattern in migrations?
  16. How do you handle distributed transactions across services?
  17. How would you implement a saga for "order β†’ payment β†’ shipping"?
  18. What is the choreography vs orchestration in saga?
  19. How would you handle versioning in microservice APIs?
  20. What is contract testing?
  21. What is consumer-driven contracts (Pact)?
  22. How would you design a search service in front of multiple data stores?
  23. What is the read-model / write-model split (CQRS basics)?
  24. What is BFF cache vs origin cache?
  25. How would you migrate from monolith to microservices step by step?
  26. What is event-carried state transfer?
  27. What is the "shared database anti-pattern"?
  28. What is pipelined gRPC?
  29. What is server streaming vs client streaming vs bi-di in gRPC?
  30. What is REST vs gRPC vs GraphQL trade-off?

🌍 Real-World Designs (381–430)

  1. Design Twitter (timeline, tweets, follow).
  2. Design Instagram (photo upload, feed).
  3. Design Facebook News Feed (basic).
  4. Design YouTube (video upload, playback).
  5. Design Netflix (catalog + streaming).
  6. Design Spotify (music streaming).
  7. Design WhatsApp / Messenger (chat).
  8. Design Slack (channels, threads).
  9. Design Discord (servers, voice channels).
  10. Design Zoom (video conferencing).
  11. Design Google Drive / Dropbox.
  12. Design Google Docs (real-time collaborative editing).
  13. Design Pinterest (boards + pins).
  14. Design Reddit (subreddits, voting).
  15. Design Quora / StackOverflow (Q&A platform).
  16. Design Yelp (location-based reviews).
  17. Design Airbnb (booking, search by location).
  18. Design Uber (ride matching, geospatial).
  19. Design DoorDash / UberEats (food delivery).
  20. Design Amazon product page + cart.
  21. Design Shopify-like multi-tenant store.
  22. Design eBay / online auctions.
  23. Design Tinder (matching, swipes).
  24. Design LinkedIn (connections, feed).
  25. Design Medium (publishing platform).
  26. Design GitHub (repos, PRs, issues).
  27. Design Jira (issue tracker, boards).
  28. Design Trello (kanban boards).
  29. Design Notion (blocks-based docs).
  30. Design Figma (collaborative canvas).
  31. Design Twitch (live streaming + chat).
  32. Design TikTok (short-video feed).
  33. Design SoundCloud (audio uploads).
  34. Design a typeahead / autocomplete service.
  35. Design a real-time multiplayer chess server.
  36. Design a basic e-mail service (Gmail-lite).
  37. Design a calendar service with reminders.
  38. Design a video conferencing whiteboard.
  39. Design a real-time stock ticker dashboard.
  40. Design a flight booking system.
  41. Design a hotel booking system.
  42. Design a movie ticket booking system at scale.
  43. Design a parking-lot reservation system at city scale.
  44. Design a ride-share carpool matcher.
  45. Design a coupon / promo code service.
  46. Design a recommendation engine for an e-commerce site.
  47. Design a "people you may know" service.
  48. Design a "who viewed your profile" service.
  49. Design a hashtag trending service.
  50. Design a real-time leaderboard for a global game.

πŸ—οΈ Reliability & Performance Patterns (431–470)

  1. What is graceful degradation? Give an example.
  2. What is fail-fast vs fail-safe?
  3. What is retry with backoff and jitter?
  4. What is circuit breaker open/half-open/closed states?
  5. What is timeout cascading and how to prevent it?
  6. What is hedged request?
  7. What is request collapsing?
  8. What is shadow traffic / dark launching?
  9. What is feature flag rollout?
  10. What is canary deployment with metric guardrails?
  11. What is blue-green deployment trade-off?
  12. What is rolling deployment?
  13. What is in-place vs immutable deployment?
  14. What is the role of synthetic monitoring?
  15. What is real-user monitoring (RUM)?
  16. What is APM and what tools provide it?
  17. What is the four golden signals (latency, traffic, errors, saturation)?
  18. What is the USE method (Utilization, Saturation, Errors)?
  19. What is the RED method (Rate, Errors, Duration)?
  20. How do you set SLO, SLA, SLI?
  21. What is error budget?
  22. What is the role of chaos engineering?
  23. What is fault injection?
  24. What is request tracing and why is it valuable?
  25. What is OpenTelemetry?
  26. What is span vs trace vs context propagation?
  27. What is structured logging?
  28. What is log aggregation (e.g., ELK, Loki)?
  29. What is metric cardinality and why is it dangerous?
  30. What is alert fatigue and how do you avoid it?
  31. What is on-call rotation design?
  32. What is post-mortem (blameless)?
  33. What is "graceful shutdown" of a service?
  34. What is connection draining on a load balancer?
  35. What is keep-alive vs idle timeout in connection pools?
  36. What is HTTP connection coalescing?
  37. What is pre-warming a cache?
  38. What is the "thundering herd" on cold cache and fix?
  39. What is request hedging?
  40. What is bulkhead with thread-pool isolation?

πŸ”§ Caching Strategies (471–490)

  1. What is write-through, write-back, write-around caching?
  2. What is the cache-aside pattern in detail?
  3. How do you choose TTL for a session cache vs profile cache?
  4. What is negative caching and when to use it?
  5. What is cache stampede protection (mutex / lease)?
  6. How does Redis cluster sharding work?
  7. What is Redis pub/sub and what are its limitations?
  8. What is Redis Streams?
  9. What is Redis sentinel vs cluster?
  10. What is consistent hashing with virtual nodes in Memcached?
  11. How do you cache GraphQL responses?
  12. How do you cache user-specific data efficiently?
  13. What is edge caching and how does CDN cache personalized content?
  14. What is fragment caching (Russian doll caching)?
  15. What is HTTP cache header (Cache-Control, ETag, Last-Modified) interplay?
  16. What is stale-while-revalidate?
  17. What is private vs shared cache?
  18. What is varnish HTTP cache and where does it fit?
  19. What is multi-tier caching (L1 in-process + L2 Redis)?
  20. What is Redis vs ElastiCache vs MemoryDB?

πŸ” Search & Indexing (491–500)

  1. How would you build a basic search index for blog posts?
  2. What is an inverted index?
  3. What is TF-IDF and where is it used?
  4. What is BM25?
  5. What is Elasticsearch and how does it shard data?
  6. What is the difference between text and keyword fields in ES?
  7. How do you handle typo tolerance / fuzzy search?
  8. How do you implement autocomplete/typeahead at scale?
  9. How do you sync your primary DB with Elasticsearch?
  10. What are the trade-offs of using Elasticsearch as a primary data store?

← Junior Β· README Β· Senior Level β†’