I've had an argument recently with a fellow programmer. He was interviewing for a new position and was asked this question:
Give a sequence of numbers starting at X and ending in Y but with one element missing so N is Y-X-1, find the missing element in O(N) or better.
Now, the answer is irrelevant here (but interesting). This started a discussion on whether this was even a good question to ask during an interview.
One side: Algorithms are an inherit part of programming and a candidates ability to answer this question supports that this candidate will be a good programmer and be able to solve larger problems and can handle most programming tasks which are ultimately easy to understand and answer.
Other side: Writing algorithms from scratch is rarely used in modern programming and therefore is irrelevant in the bigger question of whether the person will be a good programmer. A person could successfully answer this question yet still not be able to do more common programmings tasks.
Your thoughts? Good interview question or not?

find the missing element in O(N) or betterWhat does mean "or better" in this context? It seems the kind of thing that would be solved with a simple while loop, but anyway I don't understand - it's either solved or not solved, right? – Camilo Martin Nov 22 '10 at 18:27