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.
List five frontend performance metrics you would monitor to evaluate the impact of caching and optimization changes. For each metric indicate whether it is user-centric or machine-centric and why it matters to business or UX outcomes.
Compare localStorage, sessionStorage, cookies, and IndexedDB for client-side caching. For each API list ideal use-cases, approximate size limits, persistence characteristics, and key security considerations for storing cached data.
You operate a monorepo build system that produces hashed assets on every deploy and you want to avoid 503s or missing asset errors when the CDN or browser requests new hashed assets before they are fully warmed. Propose a cache warm-up strategy, including steps to pre-populate CDN caches, avoid cache fragmentation, and methods to gracefully serve requests during a short warm-up window.
Design a per-tenant caching policy for a multi-tenant SaaS application where different tenants have different consistency and invalidation requirements. Explain storage layout (shared vs namespaced caches), invalidation flows, cost controls, and how to perform tenant-scoped cache purges efficiently.
Explain how a normalized GraphQL client cache works (e.g., Apollo normalized cache). Describe how entity normalization helps cache hits across queries, and what additional steps you must take to support offline sync, conflict resolution, and cache eviction in a mobile GraphQL client.
Unlock Full Question Bank
Get access to all 19 Caching Strategies & In-Memory Optimization interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.