Maximum Building Height
A hard-tier problem at 37% community acceptance, tagged with Array, Math, Sorting. Reported in interviews at Dataminr and 0 others.
Maximum Building Height is the kind of problem that looks straightforward until you realize the naive greedy approach fails silently. You're given constraints on building heights at different positions, and you need to maximize the tallest structure while respecting those limits. This problem appears in Dataminr's assessments and carries a 37% acceptance rate, meaning most candidates who attempt it don't land a clean solution on first try. The trick isn't calculus or dynamic programming. It's understanding how to construct the answer backward, then verify it holds forward. If this pattern hits your live assessment and you freeze, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Maximum Building Height"
Maximum Building Height 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 an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.
Get StealthCoderThe problem forces you to think about constraints as a network of dependencies, not independent facts. Most candidates try greedy left-to-right construction, which fails because a local maximum can violate future constraints. The actual insight: build the answer by sorting and processing constraints in the right order, then validate the sequence satisfies all bounds. Math and Sorting are the core topics here because you're not actually using complex algorithms, just the right computational model. When you don't see the pattern before the OA, you waste 20 minutes on a dead-end approach. StealthCoder is the hedge for that exact moment, showing you the correct sequence and why earlier attempts were invalid.
Pattern tags
You know the problem.
Make sure you actually pass it.
Maximum Building Height recycles across companies for a reason. It's hard-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 an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Maximum Building Height interview FAQ
Is this a DP problem or greedy?+
Neither, primarily. It's a constraint-satisfaction problem disguised as optimization. You build the solution by sorting and applying bounds in the correct order, then verify the result works. The math comes from understanding why one sequence of operations respects all constraints while others don't.
What makes this harder than typical array problems?+
The acceptance rate of 37% tells you most people hit a wall. The trap is attempting greedy or left-to-right construction. You have to think backward or sideways about how constraints interact, which isn't intuitive without seeing the trick first.
How does sorting help here?+
Sorting the constraints reframes the problem so you can apply them in an order that guarantees correctness. Without the right sort order, you're fighting dependencies that seem contradictory when they're actually solvable.
Does this come up at other companies, or is it Dataminr-specific?+
Reports show Dataminr as the primary company asking this variant. Problems with similar constraint-satisfaction patterns appear elsewhere, but this exact problem is less common across the broader interview circuit.
If I haven't seen the pattern, how should I approach it live?+
Start by coding a brute-force validator to check if a candidate sequence works. That gives you confidence in what 'correct' means. Then work backward: if the answer looks like X, what constraints force that shape. That reasoning often reveals the construction method.
Want the actual problem statement? View "Maximum Building Height" on LeetCode →