"Take an array of n values where each value is an int between 1 and n-1, for example 5 numbers between 1 and 4. Obviously, there must be at least one duplicate number in this array. Write a function that finds a duplicate value. Okay, easy enough. However, the interviewer insisted that the code cannot allocate any new memory (so i can't keep a hash table of what I've read so far, or allocate a new array) and it also must be O(n) (so i can't just look at the first number then scan the whole array looking for the same number).."
Now despite the fact that I know the "trick" that's used to get this answer, I didn't think of it. Granted, I was really busy when I first read the entry, so I didn't really spend much time on it. But I was a little disappointed that the answer did not come to me quickly. But if I should ever need to be interviewed again, it's less likely that I'll be stumped by this, because it'll be in the back of my mind somewhere.
Just a few days ago, I interviewed a candidate for a position in my group. Without going into too many details, I confirmed some of what I've written on the subject of tech interviews here and elsewhere. I will say however that the candidate was very enthusiastic, which made an impression on everyone in my group who spoke to him. The significance of this is clear, and it's something I'll need to work on. I'm sure that in some of my interviews from hell, I had a "deer in headlights" look on my face and tone of voice.
The experience of being on the other side of the table was informative and refreshing. I think the time I've spent researching and discussing tech interviews will make me a better interviewer, and hopefully a better interviewee, should the need arise.