InterviewStack.io LogoInterviewStack.io

Caching and Performance Optimization Questions

Covers design and implementation of multi layer caching and end to end performance strategies for web and backend systems. Topics include client side techniques such as browser caching, service worker strategies, code splitting, and lazy loading for components images and data; edge and distribution techniques such as content delivery network design and caching of static assets; and server side and data layer caching using in memory stores such as Redis and Memcached, query result caching, and database caching patterns. Includes cache invalidation and coherence strategies such as time to live, least recently used eviction, cache aside, write through and write behind, and prevention of cache stampedes. Covers when to introduce caching and when not to, performance and consistency trade offs, connection pooling, monitoring and metrics, establishing performance budgets, and operational considerations such as cache warm up and invalidation during deploys. Also addresses higher level concerns including search engine optimization implications and server side rendering trade offs, and how performance decisions map to user experience and business metrics at senior levels.

EasyTechnical
28 practiced
List scenarios where caching can hurt correctness or performance and should be avoided or applied cautiously, such as real-time financial data, per-request personalization, strong consistency requirements, or high-churn keys. For each scenario explain why caching is problematic and suggest alternative approaches or mitigations.
HardTechnical
32 practiced
Analyze memory fragmentation and eviction tuning for Redis when storing many large objects of varying size. Discuss maxmemory-policy choices, memory-fragmentation-ratio, lazyfree-lazy-eviction, active defragmentation, impact of large-key eviction on latency, and recommendations to minimize OOMs and outage risk.
MediumTechnical
28 practiced
Design rules for edge cache key composition when requests include query strings and cookies. For example, search endpoints accept ?q= and pagination ?page=, while cookies include session info. Explain which query params should be part of the cache key, how to canonicalize and normalize query strings, how to deal with ordering and irrelevant tracking params, and how to ensure personalization doesn't leak between users.
HardSystem Design
34 practiced
Design a write-behind queue system for caching writes to the persistent database. Include architecture for batching, backpressure, idempotence, retry semantics, failure handling, and guarantees (at-least-once vs exactly-once). Explain how you ensure durability of queued writes and how to drain the queue safely during maintenance or failure.
MediumTechnical
36 practiced
You are building a comment system where new comments must be visible immediately to the author and followers and durability is important. Compare write-through and write-behind caching strategies for this use case and recommend one. Explain trade-offs around latency, durability, complexity, and how to guarantee immediate visibility to readers.

Unlock Full Question Bank

Get access to hundreds of Caching and Performance Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.