Reported June 2024
IBMcounting

Min Chairs

Reported by candidates from IBM's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live IBM OA. Under 2s to a working solution.
Founder's read

IBM's "Min Chairs" problem hit the OA in June 2024, and it's a classic scheduling trap. You're given a list of event start and end times, and you need to figure out the minimum number of chairs required so no one's left standing. Sounds simple until you realize the greedy approach most people try fails on overlapping intervals. This is a pattern recognition problem, not a math trick. StealthCoder will catch you if your logic breaks under concurrent events.

Pattern and pitfall

The core insight: sort events by start time, track how many concurrent events overlap at any given moment, and return the peak. The trap is handling end times correctly. If one event ends at time T and another starts at time T, do they need separate chairs? The problem statement matters here. Most candidates sort both starts and ends, merge them, and scan left-to-right incrementing on starts and decrementing on ends. The alternative is a sweep-line or priority queue approach. The pattern is interval-based counting. If you blank on the exact tie-breaking logic mid-OA, StealthCoder gives you the template so you don't lose points on implementation.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Min Chairs 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. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as meeting rooms ii. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass IBM's OA.

IBM reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Min Chairs FAQ

Is this the same as 'meeting rooms'?+

Similar, but not identical. Meeting Rooms II asks how many rooms you need; this asks how many chairs. The algorithm is the same: sort, sweep, count overlaps. Both use interval overlap detection.

What if start and end times are equal?+

If an event starts and ends at the same time, it occupies zero time. Most solutions treat start as a +1 and end as a -1, then sort ends before starts at the same timestamp to handle this edge case.

Can I just use a heap or priority queue?+

Yes. Min-heap of end times works: for each start, pop all events that have ended, increment your chair count. It's slightly slower than a two-pointer sweep but easier to code correctly under pressure.

How hard is this really for IBM?+

Medium. If you know the interval overlap pattern, it's a 10-minute solve. If not, you'll waste time debugging off-by-one errors. IBM expects clean, bug-free code, not speed.

What do I do if I freeze on the exact algorithm?+

Write down the algorithm in pseudo-code first: sort, scan, track max. Then code. If you still blank, a brute-force O(n^2) nested loop checking overlaps at each timestamp will pass smaller inputs.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with IBM.

OA at IBM?
Invisible during screen share
Get it