FastPrepMinimum in a Rotated Sorted Array
Problems/Minimum in a Rotated Sorted Array

Minimum in a Rotated Sorted Array

NVIDIA logoNVIDIA● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an NVIDIA onsite interview for a full-time role. The report names the well-known rotated-array minimum exercise without repeating its statement. We followed that exercise. The values are distinct, and the time must be logarithmic.

Our version is about 95% the same as the reported question.

The array nums contains distinct integers. It was sorted in strictly increasing order and then rotated; a full-length rotation may leave it unchanged.

Return the minimum value in the array. Your final algorithm must use O(log n) time, where n = nums.length.

Function

findMin(nums: int[]) → int

Examples

Example 1

nums = [3,4,5,1,2]return = 1

The increasing lower segment begins at 1.

Example 2

nums = [4,5,6,7,0,1,2]return = 0

A rotation places 0 between 7 and 1.

Example 3

nums = [11,13,15,17]return = 11

A full-length rotation leaves the increasing array unchanged.

Constraints

  • 1 <= nums.length <= 5000.
  • -5000 <= nums[i] <= 5000.
  • All values are distinct, and nums is a rotation of a strictly increasing array.

More NVIDIA Onsite Interview questions

  • Check Endianness Of A Byte ArrayONSITE INTERVIEW · Seen Sep 2026
  • Implement MallocONSITE INTERVIEW · Seen Sep 2026
  • Implement PrintfONSITE INTERVIEW · Seen Sep 2026
  • Merge Two Arrays Into Sorted OrderONSITE INTERVIEW · Seen Sep 2026
  • Middle Node Of A Linked ListONSITE INTERVIEW · Seen Sep 2026
  • Ping Reply TrackingONSITE INTERVIEW · Seen Sep 2026
  • Reverse A StringONSITE INTERVIEW · Seen Sep 2026
  • Maximum Fish in a GridONSITE INTERVIEW · Seen Sep 2024
  • First Register Overflow TickONSITE INTERVIEW · Seen May 2024
  • Two-Egg DroppingONSITE INTERVIEW · Seen May 2024

Similar questions at other companies

  • Search in a Rotated Sorted ArrayAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Search a Row- and Column-Sorted MatrixByteDance · ONSITE INTERVIEWByteDance interview questions
  • First and Last Target Position in a Mountain ArrayGoogle · ONSITE INTERVIEWGoogle interview questions
  • 3Sum SmallerSalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Smallest Batch Size Within a Step LimitMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Peak of an Increasing-Then-Decreasing ArraySnap Inc. · ONSITE INTERVIEWSnap Inc. interview questions
  • Online Meeting Scheduler with Fixed RoomsUber · ONSITE INTERVIEWUber interview questions
  • Search a 2D MatrixWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
  • Search in Rotated Sorted ArrayKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Find First and Last Position in Sorted ArrayPaytm · ONSITE INTERVIEWPaytm interview questions

NVIDIA interview experiences

  • NVIDIA Full-Time SWE Onsite Scheduling: 1 Experience
  • NVIDIA OA: What It Tests (2026)
  • NVIDIA DevOps, QA and Infra Intern Interviews: 12 Experiences
  • NVIDIA Ignite Internship OA Experience
  • NVIDIA Software Intern Interview Questions: 9 Experiences
  • NVIDIA Ignite SWE Intern OA Questions: 6 Experiences
All NVIDIA interview questionsSee NVIDIA hiring insights
Saved
class Solution {
    public int findMin(int[] nums) {
        return 0;
    }
}
Checking account…