Design a Read-Through Cache for Real-Time Inventory Availability

Last updated: November 29, 2026

Quick Overview

Design a cache that answers 'is this item in stock and how many can ship from which fulfillment centers' for search and detail pages, with inventory changing constantly as orders and receipts happen.

Amazon
System Design
Software Engineer
Amazon
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design a cache that answers 'is this item in stock and how many can ship from which fulfillment centers' for search and detail pages, with inventory changing constantly as orders and receipts happen.

Shows up in Amazon retail and supply chain loops because availability is read orders of magnitude more often than it changes, but overselling is expensive. Interviewers check that you separate the display path from the reservation path and pick sensible staleness bounds.

What the Interviewer Expects
  • Clarify reads per second vs inventory updates per second
  • Separate display availability (cached) from reservation (authoritative)
  • Use change data capture or events to update the cache
  • Choose cache key granularity (ASIN vs ASIN plus region)
  • Explain how low-stock items are treated differently
Key Topics to Cover
Read-through caching
Change data capture
Bucketed availability
Reservation vs display
Regional keys
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 do you avoid showing In Stock for the last unit 50 people are viewing?
  • Would you write-through or invalidate on update?
  • How do you handle a fulfillment center going offline?
  • How would you shard the authoritative inventory store?
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

Functional: return availability for an ASIN in a buyer's region: in stock / low stock / out of stock, plus the FCs that can fulfill. Non-functional: reads ~2M/s at peak with p99 under 10 ms; u...

High-Level Design
  • Inventory service of record: per (ASIN, FC) counts in a sharded store (DynamoDB style, partition key ASIN). Reservations are conditional decrements here.
  • Availability cache: key `(ASIN, re...

Submit Your Answer
Markdown supported