You are designing a distributed key-value cache that sits in front of a search engine to store the results of recent queries. The system handles 10 billion queries per month with limited memory, so you must decide what to keep and what to evict. Explain your caching architecture, eviction strategy, how you would distribute the cache across multiple machines, and how you handle cache misses.
How to approach it
- Hint 1
LRU (Least Recently Used) is the most common eviction policy for this use case -- think about why.
- Hint 2
For distributing across machines, consider consistent hashing to determine which node holds a given query.
- Hint 3
Each cached entry is small (~270 bytes: query + title + snippet), but 10 billion unique queries would need ~2.7 TB.
Ready to answer it out loud?
Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.
Practising needs an invite code. Join the waitlist and we’ll send you one.