Implement Restaurant Waitlist API
Implement restaurant waitlist API and data structure with the following requirements: 1) A party of customers can join the waitlist (with a reasonable limit of n people). 2) A party which has joined the waitlist can leave at any time. 3) When a table becomes free, serve the first party on the waitlist that fits the available size (e.g., a party of 4 can join a table of 6 if they are first in waitlist, but a party of 8 doesn't fit at a table of size 6).
Asked at: