Check-then-act: making booking and allocation safe
Check-then-act is code that looks at some state and then acts on what it saw: is a seat free, then take it. Between the look and the act, another thread can change the answer. The interviewer wants to hear where the lock goes, and why a thread-safe collection doesn't remove the need for it.
The last slice of cake
Picture a café with a glass cabinet of cakes. A customer asks Ana, a waiter, for the lemon cake. She looks in the cabinet, sees one slice and says yes. At that same moment Ben looks in from the other side, sees the same slice and says yes to his table. Both walk round to fetch it, and only one of them comes back with cake. The glass was honest with both of them. The answer simply stopped being true after they looked.
The café has two ways out. The cabinet can have one key, and a waiter holds it while looking and taking, so nobody else can reach in between. Or a waiter can take the slice in one movement and only then answer the table.