₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,217 members, 8,439,335 topics. Date: Sunday, 05 July 2026 at 02:58 AM

Toggle theme

Shopping Cart Challenge - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingShopping 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:
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?
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):
Wbuser21:
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
Good answer.
Also the server processes each request one at a time, in the order they are received.
1 Reply

Shopping Cart I Made With Mevn StackHow To Optimizing Your Ecommerce Store To Reduce Shopping Cart AbandonmentBuilding An Ionic 3 Shopping Cart App With Firebase Realtime Database - Part 4234

Common Web Development Mistakes That Ruin Website PerformanceEnquiryGet Your Own Website At Low Costs