Leetcode 855. Exam Room
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.
Asked at:
Apple
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid September, 2025
Apple
Senior
A question very similar to Leetcode 855 Exam Room.
Your account is free and you can post anonymously if you choose.