In a backend phone interview, I initially expected a familiar scheduling exercise: determine how many rooms a set of meetings needs. I discussed sorting and tracking room availability with a heap.
The interviewer then changed the setting to continuously arriving meetings, asking how to decide immediately whether a new one would fit. We discussed interval trees and segment trees. Another follow-up introduced rooms with different capacities, making attendee counts part of the assignment decision.
My takeaway was that knowing the usual implementation was insufficient. I needed to explain the reasoning behind ordering meetings and reusing the room that became free first, then adapt that reasoning when the requirements changed.
Discussion
Loading comments…