Design Gift Card System

Medium40 min
1 / 30
understanding9 min read

Problem Framing and Gift Card Scope

How Problem Framing and Gift Card Scope shapes gift card liability, redemption, and fraud architecture.

Problem Framing and Gift Card Scope

A gift card system is a stored-value liability ledger with credential-based access — Amazon, Starbucks, and Target all treat gift cards as money the company owes, not as discount coupons. The framing that wins the interview separates three money movements: issuance (money enters the platform when a card is bought), redemption (money leaves at checkout when a card is spent), and breakage (unredeemed balance the company eventually recognizes as revenue after expiry). The cardinal rule is that the system must never double-spend a dollar — not across partial checkouts, not across refunds-to-credit, not across concurrent redemption attempts on the same card.

Open with three invariants, because stating them up front separates a serious answer from 'just store the balance in Redis'. First, every dollar of liability is backed by an append-only ledger entry — the balance is a projection of immutable entries, never a mutable number you overwrite. Second, redemption is hold -> capture -> release, exactly like a payment authorization — you reserve the amount, commit it on order placement, and release it on abandonment, never a direct balance decrement without idempotency. Third, codes are credentials — brute-force guessing and enumeration are first-class threats, not afterthoughts.

Scope in: digital and physical issuance, balance inquiry, partial redemption, store-credit refunds, expiration, region and currency rules, and fraud scoring. Scope out (integrate, do not build): the full payment gateway, loyalty-point accrual, and the tax engine — mention the hooks only. The nuance to voice is that Starbucks loads cards into a wallet while Amazon allows split-tender checkout (part gift card, part credit card), and a good design handles both without ever conflating promo-code semantics with stored value — a promo code is a discount rule, a gift card is money the company holds in trust.

Key Highlights

  • Gift cards are liabilities, not discounts
  • Hold/capture mirrors payment authorization
  • Codes need anti-enumeration controls
Interviewer signal
Lead with invariant: no capture without hold; ledger drift must stay zero when discussing Problem Framing and Gift Card Scope.
Design tip
Separate issuance async path from synchronous checkout hold path—Problem Framing and Gift Card Scope should not blur those latencies.

Section Rescue Kit

Buzzwords to use:

Double-Entry Liability LedgerRedemption Hold Token

Safe statements:

  • "Let me anchor Problem Framing and Gift Card Scope on liability invariants before picking databases."
  • "If time is short, I keep hold/capture and cut B2B extensions—not ledger detail."
Design Gift Card System - System Design | WinJob | WinJob