Available question text
Manage an exam room of n seats where seat() places the next student at the index that maximizes the distance to the nearest occupied seat (ties broken by smallest index) and leave(p) frees a seat. The challenge is to design a data structure—typically interval tracking with a max-heap and ordered set—to pick and merge the largest empty segments efficiently for up to 10^4 operations with n up to 10^9.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Apple
Leetcode 855. Exam Room
Reported Sep 16, 2025 · 2 source reports
SENIOR
Source snapshot: Nov 12, 2026
View source