Design a restaurant waitlist API and data structure.
Unlock detailed company stats for this questionUpgrade
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 (e.g., 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.
- Follow-up: find the ids of the people currently sitting in the restaurant.
Community answers
No answers contributed by the community yet.


