LLD - Design — Hotel Booking System
Consider this simplified booking flow code snippet:
What issue can arise if two users call
def book_slot(slot_id):
if is_available(slot_id):
reserve(slot_id)
confirm_booking(slot_id)
return 'Booked'
else:
return 'Unavailable'What issue can arise if two users call
book_slot at the same time for the same slot_id?