Meeting Room
Reported by candidates from Wework's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
You've got a WeWork OA coming up in the next 48 hours and Meeting Room is on the menu. This is a classic interval scheduling problem disguised as a practical business question. The trap is thinking you need complex data structures. You don't. Sort the intervals, track one counter, and you're done. If you blank on the greedy insight during the live assessment, StealthCoder sits invisibly on your desktop and feeds you the pattern in real time. The proctor sees nothing. You stay calm and code.
Pattern and pitfall
The trick here is recognizing that you only need one variable to track concurrent meetings, not a fancy heap or segment tree. Sort all meeting end times and start times separately, then walk through them in order using two pointers. Every time a meeting starts, increment a counter. Every time one ends, decrement it. The maximum value that counter hits is your answer. It's greedy and linear. The pitfall is overcomplicating it or trying to track which specific meetings overlap. You don't care about that. You care about the peak occupancy. StealthCoder handles the edge cases if the problem statement is ambiguous in the moment.
StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.
You can drill Meeting Room cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. If you're reading this with an OA window open, you're who this was built for.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as meeting rooms ii. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Wework's OA.
Wework reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Meeting Room FAQ
Is this really just a counting problem?+
Yes. You're counting the maximum number of meetings active at any single moment in time. It's not about which meetings, just how many. Sort start and end times, walk through with two pointers, and track the running count. The max you see is the answer.
Do I need to remember which meetings are in each room?+
No. The problem asks for the minimum number of rooms needed, not which meetings go where. You only need the peak occupancy count. That's the greedy insight that makes this linear instead of exponential.
What if two meetings start and end at the same time?+
This is the edge case. If a meeting ends at time T and another starts at time T, you can reuse the room. Sort so that end times are processed before start times at the same time value. Most languages handle this naturally if you sort ends first, then starts.
How do I solve this in under 10 minutes on the real OA?+
Write two separate arrays: one for starts, one for ends. Sort both. Use two pointers, one on each array. Increment count if you hit a start first, decrement if you hit an end. Track max. Code it in 5 minutes, test with the given example in 3.
Is this pattern still being asked by tech companies?+
Absolutely. Interval scheduling is timeless because it models real resource allocation. WeWork is asking it literally because they manage physical rooms. Expect variants on this in future OAs. The core greedy pattern doesn't change.