Desgin a system for selling some limited amount of products in a SALE in CRED.
Each Item has a ItemID generated before hand.
Payments can also fail when user is trying to buy the product .
Example: Suppose cred is selling Iphone at a discounted price(or pay with points) and we have only 1000 items available and ~100X people trying to buy them.

Functional Requirements:

  • We should not oversell or undersell the items.
  • Handle payment failure cases.

Non Functional Requirements:

  • We should be able to scale it easily.

Questions:

  • How do we give unique itemIDs for each request?
  • How do u handle failure in payment cases?
Comments (2)