FastPrepFind the Missing Number from 1 to 100
Problems/Find the Missing Number from 1 to 100

Find the Missing Number from 1 to 100

NVIDIA logoNVIDIA● EasyINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an NVIDIA DevOps intern interview. One coding question asked for the one value left out of an array that should hold every whole number from 1 to 100.

The report does not say whether the array is sorted or whether a value can repeat. Here the 99 values come in any order with no repeats, and you return the missing number.

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

You are given an array nums of 99 distinct integers. Every value is between 1 and 100, so exactly one number from 1 to 100 is missing. The values can be in any order.

Return the missing number.

Function

findMissingNumber(nums: int[]) → int

Examples

Example 1

nums = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100]return = 50

The numbers are 1 to 49 and then 51 to 100, in increasing order. The number 50 never appears, so the answer is 50.

Example 2

nums = [100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2]return = 1

The numbers run from 100 down to 2. The number 1 never appears, so the answer is 1.

Example 3

nums = [33,23,48,22,60,68,25,91,82,2,27,1,72,76,45,26,93,59,66,49,81,99,70,15,50,11,43,17,94,88,3,34,58,64,62,52,39,96,30,21,87,35,32,14,40,4,78,86,46,61,57,24,92,41,63,67,79,80,44,53,36,98,37,90,19,83,38,18,6,74,95,97,77,29,16,73,89,55,71,85,31,9,54,56,12,5,28,65,8,75,47,13,69,10,7,84,51,20,42]return = 100

The numbers are in no particular order. Their sum is 4950, while 1 + 2 + ... + 100 is 5050. The difference is 100, and 100 is indeed the one number that does not appear, so the answer is 100.

Constraints

  • nums.length == 99
  • 1 <= nums[i] <= 100
  • All values in nums are distinct.

More NVIDIA Phone Screen questions

  • Summarize Server Healthcheck LogsPHONE SCREEN · Seen Oct 2026
  • Hash Partition OffsetsPHONE SCREEN · Seen Oct 2026
  • Filter Paginated Medical RecordsPHONE SCREEN · Seen Oct 2026
  • Least Frequently Used CachePHONE SCREEN · Seen Oct 2026
  • Parallel String Counts with a Custom Hash TablePHONE SCREEN · Seen Oct 2026
  • Simulate a Reference-Counted Smart PointerPHONE SCREEN · Seen Aug 2026
  • Streaming Top-K Frequent ElementsPHONE SCREEN · Seen Aug 2026
  • Merge Multiple Sorted StreamsPHONE SCREEN · Seen Aug 2026
  • Linked List Palindrome in Constant SpacePHONE SCREEN · Seen Aug 2026
  • LRU Key-Value Cache OperationsPHONE SCREEN · Seen Aug 2026

Similar questions at other companies

  • Employee Count Median, Mean and ModeClay · PHONE SCREEN
  • Average Grades per StudentHartford Financial Services · PHONE SCREENHartford Financial Services interview questions
  • Max Points on a LineUber · PHONE SCREENUber interview questions
  • Count Product-Divisible PairsMotive · PHONE SCREENMotive interview questions
  • Pair Up an Array So Every Pair Sum Divides by kAdobe · PHONE SCREENAdobe interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Distinct Products After Removing One ElementHSBC · OAHSBC interview questions
  • Majority ElementMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Count Index Pairs with Equal Value OffsetGoogle · ONSITE INTERVIEWGoogle interview questions

Interview reports that mention this question

  • NVIDIA DevOps, QA and Infra Intern Interviews: 12 Experiences

NVIDIA interview 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 findMissingNumber(int[] nums) {
        // Write your code here.
    }
}
Checking account…