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.

HardSystem Design
60 practiced

Design a GDPR-compliant caching strategy for user data that balances performance and legal constraints. Include approaches for tokenization, encryption, cache scoping, TTLs, and the process for honoring user data deletion requests that may require removing cached copies across distributed caches and CDNs.

MediumTechnical
45 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.

MediumTechnical
43 practiced

Explain how to establish performance budgets for API latency and page load (e.g., target TTFB and p95 response time). Describe how caching decisions and instrumentation map to these budgets and propose a short roadmap of caching interventions to meet a 200ms p95 TTFB SLO.

HardSystem Design
61 practiced

GraphQL APIs often return deeply nested, personalized payloads. Design a caching approach for a GraphQL server that maximizes reuse: describe persisted queries, response fingerprinting, partial-field caching, query whitelisting, cache key strategies (root-level vs field-level), and how you'd handle authorization (Vary behavior).

MediumTechnical
50 practiced

Compare in-process caches (like Caffeine/Guava) vs remote/shared caches (Redis) for microservices. Discuss latency, consistency, memory duplication across instances, eviction complexity, failure modes, and operational trade-offs. Provide guidance for when to use local caches, remote caches, or a two-level strategy.

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.