FastPrepMinimum of a Valley Array
Problems/Minimum of a Valley Array

Minimum of a Valley Array

Bloomberg LP logoBloomberg LP● EasyINTERNONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report from a Bloomberg software internship loop in January 2025 lists one coding question: find the lowest value of a list that falls and then rises, with a binary search. It gives no signature, limits or example, and does not say which round asked it.

Everything else here is our practice choice. The list strictly falls and then strictly rises, and either part may be empty, so a list that only rises or only falls is allowed. Values may repeat across the two sides. You return the lowest value, not its position. The list has 1 to 10,000 values from -10^9 to 10^9, and the aim is O(log n) time.

The judged task matches the report at about 85%.

You are given an integer array nums shaped like a valley. Its values strictly go down until they reach a lowest point, and after that they strictly go up.

Either part may be empty. So the whole array may only go up (the lowest point is the first value), or only go down (the lowest point is the last value). Two values on different sides of the lowest point may be equal, but two neighbors are never equal.

Return the smallest value in nums. Try to do it in O(log n) time, where n is the length of nums.

Function

valleyMinimum(nums: int[]) → int

Examples

Example 1

nums = [9,4,2,5,8]return = 2

The values go down from 9 to 4 to 2, then go up to 5 and 8. The lowest point is 2.

Example 2

nums = [3,6,10]return = 3

The going-down part is empty: the values only go up. So the first value, 3, is the smallest.

Example 3

nums = [12,8,5,1,-3]return = -3

The going-up part is empty: the values only go down. So the last value, -3, is the smallest.

Constraints

  • 1 <= nums.length <= 10000
  • -10^9 <= nums[i] <= 10^9
  • There is an index k with nums[0] > nums[1] > ... > nums[k] and nums[k] < nums[k + 1] < ... < nums[nums.length - 1].

More Bloomberg LP Onsite Interview questions

  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Decode StringPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Minimum Replacements to Make Two Strings AnagramsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Currency Conversion RatePHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Roll a Weighted DieLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • Implement Binary SearchQualys · ONSITE INTERVIEWQualys interview questions
  • Messages in an Inclusive Timestamp RangeAttentive · PHONE SCREEN · ONSITE INTERVIEWAttentive interview questions
  • Count Occurrences in a Sorted ArrayAdobe · PHONE SCREEN · ONSITE INTERVIEWAdobe interview questions
  • Closest Version DateAmazon · ONSITE INTERVIEW
  • Recursive Binary SearchEPAM · ONSITE INTERVIEWEPAM interview questions
  • Find Unmet Users With Shared InterestsPalantir · ONSITE INTERVIEWPalantir interview questions
  • Find Maximum Frequency of NumberGoogle · ONSITE INTERVIEWGoogle interview questions
  • Song Duration Pairs Divisible by 60The Walt Disney Company · ONSITE INTERVIEWThe Walt Disney Company interview questions
  • Search a Sorted Array of WordsExpedia · ONSITE INTERVIEWExpedia interview questions

Interview reports that mention this question

  • Bloomberg SWE Intern Interview Questions: 68 Questions

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public int valleyMinimum(int[] nums) {
        // Write your code here.
    }
}
Checking account…