Find the Missing Number: how I answered it, how I should’ve answered it
For an on-site tech interview at startup company XYZ, I was asked the following question:
You are given an array of 99 integers. It is missing exactly one integer from a range of 1 to 100 and is unsorted. Write up a function
findMissingNumber(arr)
to find the missing integer.