Google·Software Engineer·Technical Phone Screen
- You have n rooms (indexed 0 to n-1) and a list of meetings with start and end times. Meetings are processed in order of start time. Each meeting goes to the lowest-index free room; if none are free, it waits until the earliest room opens up and runs for its original duration. Return the room index that hosted the most meetings, with ties broken by lowest index. Walk through your implementation and complexity.
“I knew pretty quickly it was a two-heap problem.”