Difficulty: 8/10eviction policies, consistency, shardingDistributed caching architecture with consistent hashing, load balancing, and automatic cache invalidation, reducing database queries by 90%Scenario Questions0-2 years experience1How would you add a cache for user‑profile lookups to reduce database load in a small feature?2If a cached profile entry expires while a user is scrolling, what does the user see and how does your system handle it?2-5 years experience1We saw latency spikes after a post went viral; how would you debug the caching layer to find the bottleneck?2Follow-up QuestionsWhat metrics would you set up to detect a cache stampede?How does your design react to a sudden traffic surge on a viral post?Walk me through a failure scenario and how you would recover.Suggest Improvement