Find the Missing Number: how I answered it, how I should’ve answered it

Kevin Kim
ITNEXT
Published in
4 min readJun 11, 2018

--

Which ball is missing? Photo credits: 90% wikiHow, 9% photopea.com 1% me

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.

--

--