Find in Mountain Array
A hard-tier problem at 40% community acceptance, tagged with Array, Binary Search, Interactive. Reported in interviews at Bloomberg and 0 others.
Find in Mountain Array is a hard problem that only Bloomberg reports asking, but it shows up in assessments more often than the company count suggests. You're given a mountain array (increases then decreases) and need to find a target value using the minimum number of API calls. The trick isn't just binary search, it's binary search twice, and most candidates either overthink the API cost or miss how to use the peak to split the problem. If you hit this live and freeze on the two-phase search pattern, StealthCoder solves it invisibly in seconds, giving you the working solution before you stall.
Companies that ask "Find in Mountain Array"
Find in Mountain Array 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 engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.
Get StealthCoderThe catch is that you can't iterate through the array freely. Every element access costs an API call, so a naive linear scan fails immediately. The real pattern: binary search to find the peak, then binary search again on the left side (ascending) and right side (descending) to locate the target. Most candidates know binary search but don't recognize the mountain shape forces you to handle two separate sorted subarrays. The naive mistake is trying one binary search across the whole array and getting confused when the comparison doesn't follow the usual rules. You need to identify the peak first, confirm which side the target lives on, then apply standard binary search. The acceptance rate sits around 40%, meaning even experienced engineers stumble on the two-phase logic. If this problem hits your live assessment and the peak-then-search pattern doesn't click immediately, StealthCoder runs invisibly and surfaces a clean solution.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find in Mountain Array 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 engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find in Mountain Array interview FAQ
Why can't I just use one binary search across the whole mountain?+
Because a mountain array isn't fully sorted. The left side ascends and the right descends. Standard binary search assumes a single sorted order. You have to find the peak first to know which side is sorted in which direction, then apply binary search separately to each half.
How do I find the peak without wasting API calls?+
Binary search on the property that arr[i] < arr[i+1] indicates ascending. Once that breaks, you've found the peak region. It's O(log n) API calls, not O(n). This gets you to the peak in roughly 17 calls on a million-element array.
Is this still asked at Bloomberg, or just in old systems?+
Bloomberg is the only company in recent reports asking this. It's a low-frequency ask overall, but when it appears, candidates are expected to know the two-phase binary search. The 40% acceptance rate shows it's genuinely tricky.
What's the difference between this and a regular binary search problem?+
Regular binary search assumes one monotonic direction. Mountain Array forces you to identify structure first (peak location), then apply binary search twice. It combines problem decomposition with classical binary search, making it a step harder.
How do I tell if the target is on the left or right side of the peak?+
Compare the target to the peak value. If target is less than peak, search both sides. If target is greater, it won't be found. If target equals peak, you're done. Then standard binary search on whichever side is actually sorted in the right direction for your target.
Want the actual problem statement? View "Find in Mountain Array" on LeetCode →