KatInterview

Merchant Catalog Service: Full-Dump Feeds and Pinned Admin Edits

System DesignModel answer
MediumModel answerSystem Designsystem-designdata-modelingingestion-pipeline

Last updated

Design a catalog service fed by full retailer snapshot files, serving 11,000 QPS under 400 ms, where admin attribute overrides persist through retailer updates and deletions.

You are designing a product catalog platform. Retailers push their product data as full snapshot files, shoppers browse the resulting catalog, and platform admins can correct product attributes globally.

Ingestion

  • Every file contains the retailer's entire catalog, never just the differences.
  • There are 50,000 retailers. The mean catalog has 20,000 products, but the median has only 50.
  • Strict versioning is not required. While a snapshot is being applied product by product, a shopper may see a mix of old and new products, and that is acceptable.

Browsing

  • List all product SKUs of a retailer by retailer_id.
  • Fetch one product's details by product_id.
  • 50 million users, 11,000 queries per second, and a 400 ms latency target.

Admin overrides

  • An admin can override any attribute of any product, and the override applies system-wide.
  • A later retailer update must never change an overridden value.
  • A retailer may delete a product even if some of its attributes are overridden.
  • Deleting an override means users see the retailer's latest value for that attribute again.

Part 1: Core design. Define the entities, choose storage and caching, and describe the write path (file to visible product) and both read APIs. Show how each override rule follows from your model.

Part 2: Diffing. How do you compare a new snapshot with existing data to find added, removed, changed, and unchanged products? Discuss cost for the biggest retailers.

Part 3: A wrong upload, quickly replaced. A retailer uploads snapshot 1, realizes it is wrong, and uploads snapshot 2. The catalog must end up exactly equal to snapshot 2. Consider snapshot 2 arriving before, during, and after processing of snapshot 1.

Part 4: Scale. Another 50,000 retailers join, and every retailer uploads daily. How does the system cope? Separate rows compared from rows written, and discuss fairness between huge and tiny retailers.

Part 5: Observability. What would you monitor, alert on, and verify to be confident the system behaves correctly?

State any assumptions you make, such as whether an override should come back if a deleted product reappears.

Hints

Hint 1

Keep retailer-supplied values and admin overrides in separate tables, and compute the visible product as retailer values overlaid with overrides. Most override rules then fall out without special cases.

Hint 2

Diff each snapshot against the catalog's current stored state, not against the previous file, and give every snapshot a server-assigned increasing sequence number per retailer so that ordering never depends on processing timing.

Hint 3

For scale, estimate rows read versus rows written separately. Most rows in a daily snapshot are unchanged, so content hashes keep writes small even though compared volume is around a billion rows per day.