# caching & performance

// [26] real interview questions. Answers and sources live in the practice app.

practice this topic
  1. When is a cache not useful, or even dangerous?(senior)
  2. Which principles would you apply to define the size of a cache?(senior)
  3. Explain the difference between RDB and AOF persistence in Redis. When would you choose each?(mid)
  4. How do you handle atomic operations in Redis when multiple clients update the same data?(mid)
  5. How should you structure Redis keys for maintainability and performance?(junior)
  6. What is pipelining in Redis, and when would you use it?(mid)
  7. How would you implement a simple counter in Redis, for example for page views or a rate limit?(junior)
  8. Describe the Pub/Sub model in Redis. What are the disadvantages of publish-subscribe at scale?(mid)
  9. Scale out vs scale up: how are they different, and when do you apply each?(mid)
  10. How do you deal with failover and user sessions? A server dies mid-session — what does the user experience, and how do you design so they notice nothing?(senior)
  11. How would you design a software system for scalability?(senior)
  12. How could a denial of service arise not from an attack, but from a design or architectural problem?(senior)
  13. What is the C10k problem, and how did servers evolve to handle tens of thousands of concurrent connections?(senior)
  14. When would you apply asynchronous communication between two systems instead of a synchronous call?(mid)
  15. Why does event-driven architecture improve scalability?(mid)
  16. Compare the caching strategies: cache-aside, read-through, write-through, write-behind, refresh-ahead.(mid)
  17. Cache eviction: LRU vs LFU vs FIFO — and what does Redis actually do when memory runs out?(mid)
  18. How does a CDN work, what's the difference between push and pull CDNs, and what belongs on one?(mid)
  19. Message queue vs event stream — RabbitMQ vs Kafka semantics — and how do you choose?(senior)
  20. What is backpressure, and what actually happens to a system that has none?(senior)
  21. Explain the circuit breaker pattern: the three states, and why it beats naive retrying.(mid)
  22. What are the safe rules for timeouts and retries when calling downstream services?(mid)
  23. Redis beyond strings: match each data type to the use case it was built for.(mid)
  24. Storing objects in Redis: hash per object, separate keys per field, or one JSON string — how do you choose?(mid)
  25. You built a job queue with Redis lists (LPUSH + BRPOP). What can go wrong, and when do you move to Redis Streams?(mid)
  26. When you open a site for the second time it appears almost instantly, while the first visit spun for a while. What is the browser reusing under the hood, and how does it decide a stored copy is still safe to serve?(mid)