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.

MediumTechnical
49 practiced
Write a Python function that computes a deterministic TTL jitter for cache keys to reduce synchronized expirations. Signature: jitter_ttl(base_ttl_seconds, key, jitter_ratio=0.1) -> ttl_seconds. Ensure the jitter is deterministic per key across nodes but distributes expirations evenly.
HardTechnical
27 practiced
Explain Redis eviction policies (volatile-lru, allkeys-lru, volatile-ttl, volatile-random, allkeys-random, volatile-lfu, allkeys-lfu). For each, describe how it works, memory and CPU tradeoffs, and which policy you'd choose for a large cache with many short-lived keys.
HardTechnical
39 practiced
Implement a request coalescing mechanism in Node.js or Python that deduplicates concurrent in-flight identical cache misses: the first request performs the DB fetch while others wait and receive the same response. Provide code or structured pseudocode showing promise/future usage and timeout handling.
MediumTechnical
32 practiced
Design a health-check for a Redis cluster that an orchestrator can call. Include checks for memory usage, eviction rate, replication offset/lag, command latency (p95), and connection saturation. Provide pseudocode or commands and suggest threshold values that indicate degraded or unhealthy status.
EasyTechnical
59 practiced
You're an SRE and dashboards show a sudden drop in Redis cache hit rate and a corresponding spike in DB load. Describe the immediate triage steps you would take (first 15 minutes), the commands/metrics you'd inspect, and the quick mitigations you might apply to reduce DB pressure.

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.