A walk-in is just a reservation that starts now
transcript
Reservations in one list. Walk-ins in another. That's how a restaurant double-books a table.
Treat a booking as an interval. Ninety minutes, from a start. A walk-in is an interval that starts now. A table is free if nothing overlaps. One check, both kinds of party.
Chen books a four-top from minute sixty. Park walks in at zero, four people. That table overlaps from sixty, so it's out. The other four-top is free. Smallest that fits. Done.
Sort tables by seats. The first free one that fits is the best fit. A couple doesn't take the six-top. And the family of six still finds it free.
Two intervals overlap unless one ends before the other starts. That's the whole rule. No-shows? The booking holds the table for fifteen minutes, then it's released. Time is a parameter. So a ninety-minute slot tests in a millisecond. No sleeping.
A walk-in is a booking that starts now.
Full breakdown in the lecture.