employer cover photo
employer logo
employer logo

Knight Capital

Acquis par KCG

Est-ce votre entreprise ?

Question d’entretien chez Knight Capital

Given an array of N integers, find the missing integer.

Réponses aux questions d'entretien

Utilisateur anonyme

5 nov. 2010

the answer is subtract the sum from n*(n+1)/2

3

Utilisateur anonyme

20 mars 2011

Is that a well-known algorithm? I don't know how you could ever have figured that out. I would have sorted the array and iterated until I got to the missing integer.

Utilisateur anonyme

13 mai 2010

Iterate through array, keeping a sum of the values. Subtract the final answer from n*(n-1)/2

2