MakeMyTrip Backend Developer | System Design/Multithreading

Suppose there is a discount sale going on hotels/rooms, therefore huge number of requests are coming to book them. There would be limited number of rooms and many customers to book them, how would you handle this with multithreading?
-> I said I would lock a particular room when it's payment is being processed and hence won't allow other requests to access it.
But he replied what if there are multiple servers. Request 1 is coming on server 1 for a room and request 2 is coming on server 2. Server 2 won't know that the room is locked in server 1. How would you handle it now?
Any ideas how to proceed for this ?

Comments (8)