Shopping Cart Challenge - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Shopping Cart Challenge (222 Views)
1 Reply
| Shopping Cart Challenge by MindHacker9009(op): 8:52am On May 18, 2025 |
If you have only one item left in stock and five online shoppers adds that item to their shopping cart then they all press buy at the same time. Question is who gets the item? |
| Re: Shopping Cart Challenge by Wbuser21: 11:14am On May 18, 2025 |
MindHacker9009:Pressing the button at thesame time is one thing but those requests completing at thesame time is almost impossible Because at that point it now depends on how fast each persons network is and how fast the bank validates the transfer But short answer is that, the first request to be completed gets the item then the other person either gets a refund or waits longer for his item |
| Re: Shopping Cart Challenge by MindHacker9009(op): 12:05pm On May 18, 2025*. Modified: 12:26pm On May 18, 2025 |
Wbuser21:Good answer. Also the server processes each request one at a time, in the order they are received. |
Shopping Cart I Made With Mevn Stack • How To Optimizing Your Ecommerce Store To Reduce Shopping Cart Abandonment • Building An Ionic 3 Shopping Cart App With Firebase Realtime Database - Part 4 • 2 • 3 • 4
Common Web Development Mistakes That Ruin Website Performance • Enquiry • Get Your Own Website At Low Costs