LLD - Design — Hotel Booking System
Given this simplified booking code:
What happens if two users call book_slot for the same slot at the same time?
def book_slot(slot_id):
if is_available(slot_id):
reserve(slot_id)
return 'Booked'
else:
return 'Unavailable'What happens if two users call book_slot for the same slot at the same time?
