implement restaurant waitlist api and datastructure
we are hired by a restaurant. they want us to create a waitlist for tables when people show up.
3 requirements:
- a party of customers can join the waitlist, assume it to be reasonable limit of n people
- a party which has joined the waitlist can also leave the waitlist at any time
- when a table becomes free, the restaurant serves the first party of waitlist with the size available
for example: a party of 4 can join a table of 6 if they are first in waitlist
a party of 8 doesnot fit at a table of size 6
for now just assume we assume this is one restaurant
create an API in java to fullfill these requirements, then implement the methods
verdict: Rejected. Feedback given was i didn't implement best solution. Asked to apply after 1 year cooldown period.
Comments (10)


