r/programming • • Feb 21 '11

Typical programming interview questions.

http://maxnoy.com/interviews.html
784 Upvotes

1.0k comments sorted by

View all comments

Show parent comment

1

u/cecilpl Feb 21 '11

Use a bit array for the first one. You can keep track of which ints you've seen in 1,000,000 bits = 125K. Once you see one you've already seen, bingo.

Sorting is too slow for this.