Answer the question
In order to leave comments, you need to log in
Guaranteed Booking Algorithm. What are some ideas?
There is a system for booking hotel rooms. The number of rooms is fixed - 15. We
need an algorithm for booking 4 rooms on a date from a given interval (say, a week).
We assume that the code is executed on the server side, i.e. not through some kind of REST API, but directly through interfaces.
If it is necessary (to reduce the number of blocking, for example) - overbooking is allowed (ie, it is allowed to book, for example, 7 rooms).
Give me some ideas please :)
Answer the question
In order to leave comments, you need to log in
Super-duper-duper-guaranteed booking algorithm:
1. We are looking for 4 rooms available on the specified dates.
2. If found, then we book them, otherwise we issue a message that it is impossible to book.
What does the API, interfaces and overbooking have to do with it - it's completely incomprehensible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question