KatInterview

Digital Game Marketplace: Catalog, Checkout, Downloads, Reviews

System DesignModel answer
MediumModel answerSystem Designsystem-designe-commerceidempotency

Last updated

Design a digital game marketplace covering category browsing, a payment-safe purchase flow, entitlement-gated downloads, and a review system, with explicit policies and retry-safe behavior.

You are asked to design the backend and user-facing flows for an online marketplace that sells digital games. Users should be able to:

  1. Browse games organized by category.
  2. Buy a game and then download it.
  3. Leave reviews on games.

Walk through the user journeys, the data model, the APIs, and the backend behavior that keeps all of this consistent, including what happens when requests are retried or a payment outcome is unclear.

No traffic numbers are given, so begin by stating the clarifying questions you would ask and the assumptions you will make (catalog size, peak traffic, installer sizes, client platforms, availability targets). Treat pricing, refunds, and how long download access lasts as product policies that you must define explicitly.

Part 1: Catalog browsing. Describe the category listing and game-detail pages, how they link to each other and to the buy action, what data each needs, and how you handle ordering, pagination, and caching.

Part 2: Purchase and download. Describe how a purchase is created, how payment state is tracked (including retries and unknown outcomes), how a lasting right to download is recorded, and how downloads are authorized and delivered efficiently for large files.

Part 3: Reviews. Describe who may review, whether reviews are editable, how they are stored and validated, how duplicates and abuse are handled, and how review lists are paginated and cached, including any consistency trade-offs.

Hints

Hint 1

Separate the catalog (read-heavy, cacheable, eventually consistent) from purchases and entitlements (write-sensitive, strongly consistent). Different parts deserve different storage and caching choices.

Hint 2

Use an idempotency key on checkout and a state machine for orders (created, pending, paid, failed, refunded). Treat the payment provider's webhook, not the browser redirect, as the source of truth, and add reconciliation for unknown outcomes.

Hint 3

Never serve game files from your application servers. Check entitlement, then issue a short-lived signed CDN URL. For reviews, enforce one review per user per game with a unique constraint, and keep aggregate ratings as a denormalized, asynchronously updated value.