Restaurant Waitlist API
Use your API to get a party from a FIFO waitlist. Your API needs to:
- add a party to the waitlist
- remove a party from the waitlist
- find the best party based on available table size
This is a restaurant waitlist and table-assignment design problem. The main tasks are to support adding and removing parties from a FIFO waitlist, and to select the best-fit party for a given table size. A queue preserves arrival order, while an ordered structure or similar indexing approach can help efficiently find the most suitable party without scanning the entire list. The key is to balance fairness with capacity matching.