When interviewing for a programming position, did you ever get an answer to your question that you didn't quite expect? The answer could've been quite smart that you didn't even know or it could've been a dumbest answer you never expected. I'm expecting technical type of questions but anything interesting is fine.
As an interviewer I had not been surprised very often. Most of the people have been respectful and intelligent. I had only been surprised by how quiet and nervous some people get or how little they tried to answer some of the technical questions.
As an interviewee I've given answers that were not expected. There was one occasion where I gave an answer at an early stage interviewer for large multinational company- and they simply did not understand the solution. Lesson learned: never give a 'different' or 'out of the box' answer unless it is in writing and the person receiving it is technical in that area. Otherwise, they may simply regard it as incorrect. Give the answer you think will be the norm- because in most cases the early interviewer has a very short list of the 'possible' answers.
Update: The interview I was referring to was a 4th or 5th stage phone screen- so I guess it is not as applicable. The question was one of those ones that involve 'assume you have infinite memory' so I played on that coming up with some strange 'what if' scenario. The 'best' answer was one that was more to the point using traditional methods.
Not any questions, but I was once told that I had to hold a presentation about the company after he had given me information about it. Made me really pay attention to what he told me about the job and organization (I got the job).
I have also been doing a lot of interviews and hired several of my co-worker, something I wrote about for this question:
Sorry, I misread the question. But since I've also done interviewing I can adapt my answer.
Where I work, the first question we ask in every interview is "tell us a joke". (Yes, I know, it isn't technically a "question"). This tends to lead to some unexpected answers, but they'd only be entertaining in person.
A light-hearted one...
Towards the end of an interview, which I thought went reasonably well with the candidate asking sensible questions, showing interest and a good general rapport I asked a closing question because I wanted to know whether to proceed, "so what do you think, would you be interested in the position?".
He replied "I think it is the most boring job I have ever heard of and there is no way I would come and work for you and I think your whole company is lame" (the company was a nasdaq listed software house turning over around a billion dollars). I looked at my co-interviewer, who was a seasoned development manager who worked for me. He smiled and we showed the guy out.
In almost 20 years of interviewing that is the most surprising response I have had.
I asked someone to sketch some Java code on a whiteboard when interviewing and was surprised to see the candidate put some Python up instead. Turned out the person's Java skills were, shall we say, over inflated on the CV...
As an interviewer I never had a big surprise, but as a candidate I was shocked and appalled at one company where I was not allowed to ask questions... WTF? I left pretty quickly.
I remember once I was interviewing at Microsoft and the manager told me that he was on the fence with me about whether to hire me or not. I told him, "Then don't hire me," which I think may have been a bit of a surprise to him.
We were looking for an application programmer. After putting up some pseudo code on a white board I ask the candidate a question about it. His answer "is this some type of programming thing?"
Not an answer I heard, but one that I gave.
An interviewer asked me if it was possible to write object-oriented programs "using only a C compiler". I was a little bit amused by the peculiar word choice, so I jokingly answered that, in C, you could write a compiler for an object-oriented language and do it that way.
The interviewer didn't give me a chance to say how I understood that structs aren't really objects, functions aren't really tied to their data strongly enough, and there are a bunch of other OO features missing, so you can't really do it in C, which was probably the answer he was going for. I thought I had screwed up until he ended the interview with an offer for the position.
This doesn't apply just to the single item I mention below.
We did ask an applicant for a C++-centric software engineering position one time to talk about classes and objects in C++, which he could not answer. The final thing that ended it all was "do you even have any experience with C++?" The response: "No." "You had a school class and you list it on your resumé..."
Not really an answer, and a long dead question, but anyway... I was once one of several people interviewing a candidate. It wasn't going very well for him, but not a complete disaster either. At one point during the interview, his phone rang.
At this point, I kind of felt bad for him - he was obviously nervous and now had forgotten to turn off his ringer.
What I didn't expect to happen was for him to TAKE THE CALL, speaking for several minutes. In a foreign language. My coworkers and I looked at each other incredulously.
When he was finished on the phone, he simply hung it up and proceeded with the interview as if nothing out of the ordinary had happened.
He didn't get the job.
I interviewed a guy for a C++ job. He had lots of C++ buzzwords on his resume, including 'smart pointers'.
I wrote a little example program that used a raw pointer in a loop, the pointer was never deallocated. There were several if() statements that had if() statements inside of them, so stuff was going in and out of scope a lot.
I told him that this program ran fine for a while, but eventually it would bog down my computer or throw some kind of error message from the OS. I asked him to please take a look at this and see if you can see a problem or suggest an improvement.
After what seemed like forever, but was really on five or ten minutes, he noticed that several of the if statements would reassign my pointer without deleting the thing it was currently pointed at. He went through and added delete statements before these lines. So far, so good, if a little slow.
I asked him if there was anyway to make this code cleaner and less dangerous. I tried for over ten minutes to get him to say 'use a smart pointer', but I just could not do it. At one point I even said 'the answer is on your resume'. Still, total brain lock.
I really expected that using a smart pointer would occur to a guy who put 'smart pointers' on his resume would. I had anticipated we would discuss the different flavors of smart points that exist in the C++ universe, I didn't expect a total vacuum on something listed on his resume.
After more talking the fellow it came out that in his current position in a defense contractor he spent almost all his time going to meetings and wrote almost no code at all.
I liked the guy, but didn't feel good about putting in a full time C++ job so we passed on him.