Design a restaurant waitlist API and data structure.
Unlock detailed company stats for this questionUpgrade
Design a restaurant waitlist API and data structure with these requirements:
- A group of customers can join the waitlist, with a reasonable limit of n people.
- A party that has joined the waitlist can leave at any time.
- When a table becomes free, serve the first party on the waitlist that fits the available size. For example, a party of 4 can take a table of 6 if they are first in the waitlist, but a party of 8 doesn't fit a table of size 6.
- Given a list of incoming groups, where each entry has a time, group size and group id, return the time at which each group was given a table.
Expect follow-ups like
- Find the ids of the people currently sitting in the restaurant.
Community answers
No answers contributed by the community yet.


