Design a coupon/voucher management system | DellEMC

The requirement is as below :-

  1. 10000 users are using the application at a moment.
  2. There are 200 employees generating coupon at a moment.
  3. When a user calls GetCoupon( ), a coupon is assigned to the user for 30 seconds.
  4. Till the timespan of 30 seconds, this coupon will not be assigned to any other user.
  5. If the coupon is not used by a user within 30 seconds, the coupon is marked as expired for the user and moved back to the pool so that it is available for other users for consumption.
  6. If a coupon is used by a user, the coupon is marked as used and is not available again for sharing.
  7. If all the coupons are exhausted or not available in pool for use, appropriate error messages has to be generated. This should disappear when :
    a) If a new coupon is generated by an employee.
    b) If an already existing coupon is not used by a user in 30 seconds.
  8. There should be a failover option so that if one machine crashes, the system should still work.
  9. The design should be horizontally scalable.

Any suggestions are appreciated.

Comments (5)