Google | Phone Interview | USA | Restaurant Wait List

Anonymous User
7363
Feb 17, 2022
Feb 18, 2022

Design a wait list for customers at restaurant:

  • Add customers to wait list (for example: Bob, party of 4 people)
  • Remove a customer from wait list
  • Given a open table with N seats, remove and return the first customer party of size N

Clarifications:

  • 10 unique table sizes
  • Customer names unique
  • FIFO if two parties have the same number of people
  • Table with N seats must have exactly N people

Ideal solution O(1) runtime for all 3 methods

This was the only question in a 45 minute interview. Took me the entire time but I passed and got the on site

Comments (21)