Caching Strategies & In-Memory Optimization Questions

Designing cache layers to cut redundant work and speed up reads, and the correctness costs that come with them. Covers cache placement across client, CDN, application, and in-memory store tiers, including platform-specific caching on mobile (in-memory and disk caches on iOS and Android, secure on-device token storage) and in the browser (localStorage, IndexedDB, Service Workers). Covers eviction policies, TTLs, write-through vs write-back, warming, and invalidation, plus cache stampede and thundering-herd mitigation when a hot key expires under load. Also covers using an in-memory store like Redis directly rather than only as a cache: distributed locks, counters, rate limiters, and leaderboards. Includes distributed and sharded cache architecture (replication, failover, sizing, migration) and the operational side of running one: health monitoring, alerting, and incident runbooks, plus the security and privacy risks caching introduces, such as cache poisoning and caching PII across shared tenants. Emphasizes hit-rate reasoning and the staleness/consistency trade-offs caching introduces.

HardTechnical
44 practiced

You're responsible for migrating multiple teams from per-service local caches to a shared Redis cluster. Outline a governance and operational plan: tenancy model, quotas, key naming conventions, SLAs, monitoring, on-call responsibilities, and a migration checklist that minimizes regressions.

MediumTechnical
51 practiced

Your Redis cache cluster is experiencing frequent evictions and high memory usage, degrading application performance. Walk through a step-by-step troubleshooting and remediation plan: which Redis metrics to inspect, how to identify hot keys, best practices for eviction policies (LRU/LFU), configuration changes, and application-side mitigations to reduce cache pressure.

MediumTechnical
50 practiced

Discuss the pros and cons of using Redis as both a cache and the primary data store for use cases like session storage or leaderboards. Cover persistence trade-offs (RDB vs AOF), durability and RPO/RTO implications, memory constraints, eviction behavior, and operational complexity for backups and failover.

HardTechnical
58 practiced

You have 100 million keys in Redis, each holding roughly 1KB of JSON, and memory pressure is causing frequent evictions. How would you go about shrinking the footprint without just buying more memory, and what would you weigh in choosing between the options you come up with?

MediumTechnical
58 practiced

Write a Node.js function that uses Redis to implement a per-user sliding window rate limiter allowing N requests per T seconds. The implementation should be atomic, return the remaining quota and reset time, and be performant under high concurrency. Use Redis commands or a Lua script and explain how your approach ensures atomicity and correctness.

Unlock Full Question Bank

Get access to all Caching Strategies & In-Memory Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.