Audible interview question

If you were a hostess at a restaurant, how would you implement a data structure to organize the reservations given x number of people per table, y number of tables, reservation time intervals of 30 minutes from 6pm-11pm, and time durations of parties at a table being one hour?

Interview Answers

Anonymous

7 Feb 2019

2D array

1

Anonymous

24 Jan 2020

Dictionary of arrays

Anonymous

9 Oct 2019

List of queues/stacks. index of the list refers to the time (0 -> 6pm, 1-> 6:30pm ... ) append to index of the time and index+1 of the time # of people to sit at a table. if queue size gets greater than y, we can not confirm the reservation.