Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is the best Interview question that you have ever been asked ?

Let it be anything C++/Java/OS/Algorithms/Data structures or even an HR Question, it should just be the best in your opinion.

You can post more than one questions also.

thanks

share|improve this question
27  
"Can you just prove that no three positive integers a, b, and c can satisfy the equation a^n + b^n = c^n for any integer value of n greater than two?" Took me half an hour, but there's no room to write the answer here. –  Gary Rowe Nov 18 '10 at 16:23
1  
@Gary Rowe: are you telling us you proved Fermat's Last Theorem in half an hour from scratch? –  whatsisname Nov 18 '10 at 17:13
4  
@whatsisname Oh, is that what it was? ;-) –  Gary Rowe Nov 18 '10 at 17:44
1  
@Gary, for a second I thought you were serious. Ha –  Casey Nov 19 '10 at 1:01
2  
@Gary - this is indeed a very good interview question. If the candidate does not answer something like: "Well, I just thought about that last night and I had a wonderful idea of how to prove it, but the time of this interview is too short to elaborate on it." then one can forget him. Worst thing would be if he sketched a pseudocode that checks (a,b,c,n) combinations. –  Ingo Apr 15 '11 at 8:53
show 4 more comments

closed as not constructive by Mark Trapp Jun 26 '11 at 22:47

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

14 Answers

up vote 24 down vote accepted

What do you do when you don't know the solution to a particular problem you're working on?

They were trying to get a feel for what kind of research techniques I use and what resources I'm familiar with. My answer, which they were pleased with was: Google, blogs, msdn, co-workers, books - generally in that order (SO/decent Q&A sites weren't well known at the time).

share|improve this answer
    
+1 - IMO this is one of the best questions to ask a programmer –  Rachel Nov 18 '10 at 15:59
    
+1 I actually used this myself in several interviews and found it to be very effective –  Gary Rowe Nov 18 '10 at 16:31
2  
This is a stupid question to ask anyone. –  kirk.burleson Nov 18 '10 at 22:45
10  
@kirk.burleson I disagree. This situation comes up all the time during greenfield development and almost any significant debugging scenario. Knowing how your fellow developer will initially go about solving the problem is important. –  Gary Rowe Nov 18 '10 at 22:52
1  
@Rei Miyasaka: "etc... is kind of a no-brainer." Fortunately for hiring managers, among the people you're trying to weed out, it isn't. Additionally, if I've learn anything about effective searching it's that searching requires feedback from the search engine in order to continually refine your search. The first search terms you use are often not the ones that will eventually find your answer(s). –  Steve Evers Jun 26 '11 at 23:54
show 4 more comments

Without being sarcastic or cynical the best question for me was:

When can you start?

share|improve this answer
    
I like this one ;) –  user2567 Nov 18 '10 at 15:59
    
My favourite :) –  5arx Nov 18 '10 at 17:01
5  
Is this one a good sign? I got asked this question, but then they said they'd let me know "in a few weeks", so now I'm sweating it out.... –  GWLlosa Nov 18 '10 at 22:02
    
you took my answer –  Casey Nov 19 '10 at 0:59
1  
@0101: This was probably asked in your situation because they had a constraint that required this knowledge. Perhaps they had a deadline and needed the new hire to start immediately and if you were a student who will not graduate in the next month then they would not consider you. If they are asking after the interview though then they are certainly considering you for the position. It is a matter of context. –  Chris Nov 19 '10 at 16:39
show 3 more comments

For a network heavy development position, "describe everything that happens, in as much detail as possible, when you open up a web browser on your desktop and go to www.foo.com".

share|improve this answer
12  
I've had this one before and had to ask them to clarify what browser they're using, whether they're using a proxy, whether they've visited the site before and whether they're going over HTTP or HTTPS... I was offered the job –  Gaz Davidson Nov 18 '10 at 16:26
    
@Gaz I didn't get the job when I was asked this question, although I think I gave a pretty good answer, but it always struck me as a really good question. –  CodeninjaTim Nov 18 '10 at 18:51
4  
I like this question. So many "web programmers" don't even understand the basics of HTTP or how the web actually works it's not even funny. –  Dean Harding Nov 18 '10 at 23:42
3  
I wish I could find an interview with questions like this. –  Sparr Nov 19 '10 at 1:53
    
@Sparr: I've encountered some variant of that question in the last few jobs I interviewed for, and added to my own interview question repertoire –  CodeninjaTim Nov 19 '10 at 5:29
show 3 more comments

Is it better to deliver a project on time with 80% of the features complete, or late with 100% of the features complete?

The answer of course, is that it depends on which features those 80% are. If you're focusing on the most important features first, then the 80% of complete features should be the most important 80%, which means that shipping should come first. If your design process is haphazard then the 80% of features complete might not be the ones you need the most, and you'll need to delay.

The key, I pointed out, was that it was a fine line between "Delay for two weeks" and "Duke Nukem Forever". You always have to be careful when walking that line.

share|improve this answer
3  
It's better to deliver almost immediately with 5% of the features. How else are you going to figure out what the most important 80% REALLY is? –  Chase Seibert Nov 18 '10 at 20:11
4  
5% is what, a few buttons on the screen? –  kirk.burleson Nov 18 '10 at 22:51
2  
It also depends on the project. 80% of a web app is probably enough, and it's probably more important to have SOMETHING out there being used and generating feedback than waiting. But I'm not sure I'd want to use just 80% of the software for a space shuttle... –  PeterL Nov 19 '10 at 1:07
    
@Peter Leppert -- the question was during an interview for a web developer position. :) –  EricBoersma Nov 19 '10 at 13:57
    
@PeterL "Okay, STS-256 (a nice, round number), you will now need to park the shuttle in orbit and spacewalk to the ISS." "Why is that, Houston?" "Management insisted we had to launch on time, and we haven't worked out the bugs in the reentry routines." On a serious note, the Challenger disaster almost certainly would have been averted had management heeded the engineers (who had been saying it was too cold to launch for a while) instead of trying to get "positive" public relations by not further delaying the launch. –  Mark C Nov 19 '10 at 15:31
add comment

Long before there was an internet...

I was given a manual for a language that they knew I didn't know, paper and pen, and put in a room with a problem for a half hour. I think the problem was something about synchronizing two databases using this language, but the actual problem wasn't that important.

What was important was how we dealt with a problem when we didn't know the language. Some people just sat there for the half hour, because they didn't know. I started working it out anyway. That was testing attitude, is the person a problem solver, or do they give up easily?

I got the job.

share|improve this answer
    
Was the task supposed to be intractable or just hard? –  David Reis Nov 21 '10 at 10:31
    
With the documentation, it wasn't that hard. Whether it would actually work or not would be debatable, but the process is not really code dependant, and it showed whether I was willing to attack a problem if I didn't already know the answer. –  thursdaysgeek Nov 30 '10 at 19:26
add comment

"So, how do you ensure the quality of your code?"

Well, the answer involved TDD, version control, peer review practices and everything else pretty much under the sun.

Got the gig as well - well pleased.

share|improve this answer
add comment

Best: "Tell me about your side projects" -- This tells you a huge amount about the candidate. If a developer candidate writes software on the side, you can learn how complex of a project they are comfortable with, how much development experience they have, how skilled they are at engineering, how they manage their own time, etc. If your prospective developer spends all his spare time modding his car, you can infer that this is not his dream job and he may not be with you long.

Honorable mention:

"What is your ideal job?" -- This was from my current employer, and it started us talking about what I actually enjoy doing. He has ever since tailored the job to meet my needs and I am much more valuable to the company as a result.

"Write your own question. Pick any question you want that shows how valuable you are, and answer it." -- Heard my boss ask an intern candidate this last week after she alleged that our logic puzzles were a biased metric.

share|improve this answer
add comment

How do you manage conflicts

(within the team)

share|improve this answer
2  
what's the answer mate ? :-) –  Geek Nov 18 '10 at 15:53
    
hmmmm I will create a question spin off from this answer –  user2567 Nov 18 '10 at 15:54
    
+1 for the interviewer. This is a good question, very difficult to make up an answer for this even though the possibility is endless to do so. –  Geek Nov 18 '10 at 16:21
1  
@Geek, either fight or arm wrestle –  Gaz Davidson Nov 18 '10 at 16:26
5  
override and commit –  IAdapter Nov 19 '10 at 16:28
show 3 more comments

"What do you do when you are certain that the solution is to use technology/technique/algorithm X, but your supervisor is equally convinced that the solution is technology/technique/algorithm Y?"

I gave an answer about making a detailed presentation as to the virtues of X over Y, but then once a decision had been made, doing my best to respect/support the decisions of upper management.

share|improve this answer
    
What weird X technology/technique/algorithm have they chosen? –  IAdapter Nov 19 '10 at 16:30
    
It doesn't necessarily have to be weird; for example, the exact interview question was "What if you think the best solution is a WPF application, but your boss wants to use Windows Forms because its a more reliable and trusted technology." –  GWLlosa Nov 19 '10 at 18:40
    
yep, have had the same conversation with a development team with regard to ASP.NET Web Forms and ASP.NET MVC –  Ken Henderson Nov 20 '10 at 2:58
    
I argue with my boss about design decisions like this all the time. The best I've come up with is to say, "well, I can do it like that, but it will take X hours, or I can do it my way and move on to project Y that much sooner." –  Brad Apr 15 '11 at 7:11
add comment

For me it is

Tell us the thing you're most be proud of.

That's the time I first realize though learning programming for years, I have not done anything really exciting that I can be proud of ...

share|improve this answer
add comment

What was your first computer?

It doesn't sound like a great question. On the surface, it won't tell the interviewer anything about which design patterns you know, which ORMs you use, whether you can write FizzBuzz without resorting to hard-coding all of the lines, or even whether you know that while (*s++ = *d++); will copy a string.

However, I found it revealing on both sides. Here's a guy who probably grew up hacking on a computer that his parents bought him "for schoolwork" rather than someone who got into programming because VB looked like it could be lucrative. He probably writes code for fun when he's not at work. In short, he's probably been a coder for most of his life and loves doing it. He's probably someone you could learn a thing or two from and will enjoy working with.

Unfortunately, now that your computer choices are basically limited to an IBM-compatible PC running one of 3 different operating systems, this question is becoming more and more obsolete.

share|improve this answer
    
Not many people mention the Tandy anymore I take it. –  Crazy Eddie Jul 3 '11 at 8:40
add comment

I am a web-application developer. So, when-ever I go for interview, I am asked this question

Why do we need sessions?

Anyone here, have been asked a similar question.

share|improve this answer
add comment

I onced got the question,

"Tell me any development based mistake you done, what was it?"

The question completely popped me. I nearly started laughing because it was so far away from my mindset. I develope for making things work, not to remember my mistakes. I ended up with no answer on this question. Which of course was a bad sign.

An experienced developer without one single mistake in the luggage. Well, that would ring warning bells to who? I mean, who haven't deployed the test connnectionstring or forgot the test string "Mamals can eat" on the GUI?

So, word of my, have some old mistakes in mind, preferably one with a little touch of humour.

share|improve this answer
add comment

My favorite interview question was "Design an application for a ping-pong tournament."*

From that start it turned into a series of questions that I was really into. Like, I asked if it was a web application, or desktop, or some other platform (web app). Then I asked if it's a real ping-pong tournament or a virtual simulation (a real tournament). And so on.

Once I gathered a bunch of additional information, then I started drawing out functional requirements (eg. the app behaves differently for players, spectators, and referees) and planning what objects would be involved and how they relate. Once I drew a block diagram on the board he decided I'd answered the question well and we moved on to another topic.

It was a great question because it started off fairly vague and had a lot of meat to it for him to evaluate/me to show off how I would design an application.

*yes I realize that's not a question, you know what I mean.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.