Coupon promotion engine

DesignMedium40 minShopify style

Your task

Design a coupon/promotion engine for an e-commerce checkout serving ~3,000 carts/sec at peak (flash sales). Promotions vary: percentage off, fixed amount, BOGO, free shipping, first-order-only, and stackable vs exclusive rules. Constraints: total redemption caps (e.g. 'first 10,000 uses') and per-user caps must be enforced exactly even under a flash-sale stampede, evaluation must add <20ms to checkout, and applying multiple eligible promos must pick the best legal combination. Read-heavy on the catalog, contended on the cap counters.

It covers

  • Promotions
  • Rules engine
  • Concurrency
  • Redemption limits