Design Loyalty Program

Medium40 min
1 / 30
understanding7 min read

Problem Statement: Design Loyalty Program

Problem Statement: Design Loyalty Program — loyalty program system design depth

Problem Statement: Design Loyalty Program

A loyalty program is a financial subsystem that issues, stores, and settles a private currency — points — against real money the customer spends. Treat it that way and you out-perform every candidate who reaches for a marketing-rewards mental model.

At its core the system does three things. It earns points when an order settles. It tracks a per-member balance that must never go negative. And it redeems points against a catalog of offers without ever letting two concurrent carts spend the same point twice. Starbucks proved the mobile-first version: you order ahead, Stars post after the card is captured, and you redeem at the POS by scanning a barcode that reconciles to a central wallet within minutes even when the store Wi-Fi drops. Sephora layers tiers on top — Insider, VIB, and Rouge unlock multipliers and gifts based on rolling spend. Amazon ties the earn rate to category and Prime status.

The interviewer is listening for one decision early: do you model points as an immutable, append-only ledger, or as a mutable integer you increment and decrement? The mutable column is the trap. The moment a refund, a chargeback, or a duplicate event arrives, you cannot reconstruct how the balance got where it is, and finance cannot audit it. We anchor on settled-order accrual, double-entry ledger rows, and a redemption path that holds points before it commits them. The trade-off is more storage and more write amplification per transaction; the payoff is that every point traces back to the order that minted it.

The failure that defines the design: a member redeems 500 points for a \$5 reward, then returns half the order. The earn that funded those points is now partially reversed. Clawback ordering — debit the reversed earn, decide whether the already-spent reward survives, and decide whether the balance may go temporarily negative — is the question that separates a real answer from a sticker chart.

Key Highlights

  • Model points as an append-only, double-entry ledger, not a mutable balance column
  • Three verbs: earn on settled orders, track a never-negative balance, hold-then-commit on redeem
  • Starbucks central wallet + store-and-forward POS; Sephora tier multipliers on rolling spend
  • Defining edge case: redeem-then-partial-refund clawback ordering
State the invariant
Tie Problem Statement: Design Loyalty Program to ledger idempotency and zero overspend redeem—not buzzwords.
Mutating balances
Never UPDATE balance without append-only entry; finance audits fail.
Idempotency scope
Key earn by order_id + event; key redeem hold by cart_id.

Section Rescue Kit

Buzzwords to use:

Double-entry ledgerIdempotency key

Safe statements:

  • "I'll quantify earn writes/s before naming Kafka vs Kinesis."
  • "Happy to compare central ledger vs store-and-forward with explicit reconciliation SLAs."
Design Loyalty Program - System Design | WinJob | WinJob