Design a Cache Layer for Product Price Lookups
Last updated: November 29, 2026
Quick Overview
Add a cache in front of a slow pricing service so that search results and carousels can show prices for dozens of products per request quickly.
Amazon
November 29, 20260
0
0 solved
Add a cache in front of a slow pricing service so that search results and carousels can show prices for dozens of products per request quickly.
A typical warm-up design question in an Amazon phone screen to see if a candidate knows cache basics well: where the cache sits, eviction, TTLs and batch reads. The interviewer checks clarity and sensible numbers more than exotic techniques.
What the Interviewer Expects
- Ask about read and write rates and staleness tolerance
- Choose cache-aside with TTL and explain eviction (LRU)
- Support batch get for 50 ASINs per search page
- Estimate memory footprint
- Mention what happens on a cache outage
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you handle a price update that must show within 5 seconds?
- What if one search page needs 48 prices and 3 are misses?
- Would you add a local cache on each web host?
- How do you handle negative results for ASINs with no offer?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
The pricing service takes about 80 ms per call and supports batch requests. Search pages need prices for up to 48 ASINs. Reads are about 300k ASIN lookups per second; price changes are around 5k per s...
High-Level Design
Use cache-aside with a distributed in-memory cache (Redis or Memcached cluster). The search service:
- Calls
MGETfor all 48 ASINs. - Collects misses and sends one batched call to the pricing ...