Minimum Number of Chairs in a Waiting Room
A easy-tier problem at 78% community acceptance, tagged with String, Simulation. Reported in interviews at Expedia and 0 others.
Expedia asked this one, and it's deceptively simple on the surface. You're given a string of 'E' (entry) and 'L' (leave) events, and you need to find the minimum number of chairs required so nobody's left standing. The acceptance rate sits at 78%, which means most people get it right, but the gotcha lies in the order of operations and tracking state correctly. If you blank on the simulation logic during a live OA, StealthCoder solves it in seconds, invisible to the proctor.
Companies that ask "Minimum Number of Chairs in a Waiting Room"
Minimum Number of Chairs in a Waiting Room is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by a senior engineer who knows the OA is theater. This is the script.
Get StealthCoderThe trick is tracking concurrent occupancy, not just total entries and exits. A naive approach might sum entries minus exits, but that doesn't account for the actual waiting room state at any point in time. You need to simulate the string character by character, incrementing a counter on 'E' and decrementing on 'L', then record the maximum occupancy you hit. The pattern is pure simulation: iterate once, track state, find the peak. Common pitfall: people overthink it or assume 'E' and 'L' are always balanced. They're not always. Edge cases like 'EEL' or leading 'L' chars matter. Since this is a String and Simulation problem, you're just parsing and tracking in one pass. StealthCoder hedges the moment you second-guess the approach during the assessment.
Pattern tags
You know the problem.
Make sure you actually pass it.
Minimum Number of Chairs in a Waiting Room recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by a senior engineer who knows the OA is theater. This is the script. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Minimum Number of Chairs in a Waiting Room interview FAQ
Is this really an Expedia problem, or is it everywhere?+
Expedia has confirmed asking it. It's a straightforward simulation problem, so it may float around other companies too, but the data here anchors to Expedia. Treat it as a real, live possibility.
What's the actual trick if the acceptance rate is 78%?+
Most candidates get it right, but the 22% who don't usually miscount state transitions or don't track the maximum occupancy correctly. Simulate the string once, track concurrent occupancy, record the peak. No trick, just careful bookkeeping.
Can I solve this without simulation?+
Not really. You must iterate the string and track real-time occupancy to find the maximum chairs needed at any moment. Greedy or mathematical shortcuts won't work because order matters.
How does this relate to other interview problems?+
It's a baby version of problems like 'Minimum Stack Size' or 'Discrete Event Simulation'. If you nail the state-tracking pattern here, harder simulation problems become much clearer.
What languages can I use?+
Any. The logic is language-agnostic: a counter, a loop, and a max tracker. Implement it in whatever your assessment allows.
Want the actual problem statement? View "Minimum Number of Chairs in a Waiting Room" on LeetCode →