KatInterview

Catalog Backend for a Multi-Retailer Grocery Delivery App

System DesignModel answer
MediumModel answerSystem Designsystem-designcatalogdata-ingestion

Last updated

Design the service that ingests retailer product, price and stock data and serves store-scoped browse, search and item pages, while keeping checkout prices consistent.

You are building the catalog layer for an online grocery delivery marketplace. Shoppers pick a nearby store, browse its aisles, search for items and fill a cart. A personal shopper then collects the order inside the physical store. Item listings, search results, product pages and the prices used in the cart and at checkout all come from the catalog.

The marketplace has these characteristics:

  • Many independent retailers, each operating many store locations.
  • One physical product (for example a specific brand and size of milk) is sold by many retailers, but price, availability and promotions differ by store.
  • Retailers deliver data as bulk files and incremental updates, on their own schedules, with inconsistent quality.

Your task: design the system that ingests retailer data and serves it to customers.

Constraints and notes

  • No scale, freshness or latency numbers are given. Propose reasonable ones and keep the design consistent with them.
  • Search ranking quality, recommendations, payments and shopper routing are out of scope, except for what they require from the catalog.
  • Actual in-store stock is never known exactly. The catalog only knows what retailers report.

Points worth clarifying or assuming explicitly

  • Is browsing limited to one selected store, or do we also need cross-store views such as comparing one product across retailers?
  • How fresh must price and availability be, and if the price changes between add-to-cart and checkout, which price applies?
  • Do retailers provide standard identifiers (such as barcodes) for every item, or must we match items to shared products ourselves?
  • Are there weight-priced items (produce) or variants (sizes, flavors)?
  • Roughly how many retailers, stores and items per store?

A strong answer covers requirements and scale, the data model, ingestion and data quality, the read path, consistency at checkout, and scaling, failure handling and observability.

Hints

Hint 1

Separate what is true of a product everywhere (name, brand, size, images) from what is true only at one store (price, stock, aisle, promotion). Decide the key for each.

Hint 2

Treat ingestion as a pipeline with stages: raw landing, parse, validate, normalize, match to a shared product, then diff against current state and publish only the changes.

Hint 3

Serve reads from a store-scoped, denormalized view and search index, and make checkout re-validate against the authoritative offer rather than trusting cached browse data.