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
System Design
Software Engineer
Amazon
November 29, 2026
Software Engineer
Phone Screen
System Design
Easy

0

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
Cache-aside
TTL
LRU eviction
Batch get
Memory sizing
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. 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 Problems
Sample 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:

  1. Calls MGET for all 48 ASINs.
  2. Collects misses and sends one batched call to the pricing ...

Submit Your Answer
Markdown supported