LeetDesign
← All problems
Medium

Design a Product Catalog

Serve product pages for a storefront under a sale-day flood. The cache is the design — and it only works if you actually size its RAM against the working set.

Design the catalog service behind a storefront: shoppers fetch product pages and run searches; sellers update prices and stock.

Reads bury writes — tens of thousands of page fetches per second on a sale day against a few hundred updates — and most of the heat lands on the active slice of a 400-million-product catalog. That working set is tens of gigabytes: cacheable, but only by a tier that actually holds it. And a shopper who just watched a price change must not be sold the old number — the catalog may lag a seller's edit by two seconds, no more.