Imagine we have this website.

image.png

Now let’s try to login to our account.

As we see we bought a gift card.

image.png

Now we have two requests.

  1. adding a product to site.

image.png

  1. Confirming the purchace.

image.png

Now let’s make a group.

image.png

now let’s change the product id to 1 which is the jacket we want to buy

image.png

Now let’s send in parallel.

image.png

after alot of trying it finally works.

The idea of the challenge is you are trying to buy a 10$ gift card the server is checking if you jave enough balance the at the checkout there is a race condition where you can checkout at the same second adding a product to the cart so that you order the product without paying for it.