I ask this question after reading this post http://news.ycombinator.com/item?id=1840774 [My Favorite Engineering Interview Question(skife.org)]<p>I didn't find any similar question in HN after a quick search in google, so please give your favourite interview question.
I "stole" this question from a friend, who may not have invented it either but cultural/language barriers aside [1] I'll often ask something like:<p>* Larry Wall wrote "We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris." Pick one of these three "virtues" and tell me about a time you exhibited it.<p>[1] - Some less-than-perfectly-fluent English speakers are unfairly thrown by this question, it has a lot of relatively obscure vocabulary, and then layers irony on top. BTW, even among native English speakers the single most common response is "what is hubris"?<p>Also, a standard although not necessarily favorite general interview question I use (technical or not) is something like:<p>* Suppose we brought you on board at Firm X and found that you were doing an excellent job. What kinds of things could we do to reward you?<p>followed by:<p>* No job lasts forever. What sorts of things do you think would make you want to leave Firm X eventually?
For windows based web development:
How would you create a web page that said "Hello World"?<p>It the answer is not <i>start notepad (I'll accept Notepad+), type in Hello World and save it as .htm or .html and put it on a webserver</i> then for most of the places I have done interviewing for over the years they have missed the first requirement, get it done as easily and quickly as you can.<p>I fully appreciate that this varies massively by company, and I would want to know that the person can answer certain levels of technical questions but finding people who don't overcomplicate problems is hard, finding people who learnt recursion at university or as another commentator mentioned, can define polymorphism is actually not that hard.
programming: "how would you take a word list and partition it into sets of anagrams?". touches on some very basic data structures and algorithms, shows that the candidate is at least familiar with arrays and hashes and knows when to use which. it's amazing how many people don't get it, even when given an hour to do it on an actual computer.<p>design (with the aid of a whiteboard): how would you go about writing a call-graph explorer? start with the high level pieces and go into more detail as asked.<p>algorithms: "there are data structures that make tradeoffs between various operations (give examples). can you design one that has O(1) insert and O(1) extract-minimum, with everything else running in as much time as you like?"<p>if you're asking about my favourite question i've been asked, it was "given a set of numbers from 0 to 2^n-1, with one missing, how would you find the missing number in one pass through the set and using at most n bits of extra storage" (took me embarrassingly many tries to get it, but it was a satisfying question to solve)
A technical question, or a question in a tech job interview?<p>Non-technical:
What are you passionate about? (This can tell you a lot about someone.)<p>Technical:
How would you solve problem x? (Where x is an actual problem we have had to solve working on our application. Relevancy is important and cuts through the 99 common interview questions fluff).
My favorite programming question to ask is:
Write a function that given an integer n returns the number 1 to n in random order<p>I find this is a good mix of not too trivial but not overwhelming, I don't expect people to come up with the fastest possible algorithm on the spot. If they code the naive solution, that's OK if it makes sense and they can describe the performance characteristics. Then we'll talk over the algorithm and I lead them to something better and see how the conversation develops.
If I interview Java programmers I always start with letting them write a method to reverse a String on the whiteboard. ~30% fail, for the others it's an easy warmup. I then ask how much memory this method consumes and if they could think of a better way to do it if this were C and not Java. This leads to the concept of immutability of Strings and you now can have a discussion on why the Java folks chose to make String immutable in the first place...
Well... the answer to that question really depends upon what set of technologies the applicant is approaching the position with. One question, however, that seems to always tell a lot about the person being interviewed is: "You are asked to mentor a new developer, fresh out of school. What habits/best-practices, language-specific and general, have you learned through your years of working that you feel should be offered to the new hire?"
Not my favorite, but interesting:<p>You are given two eggs and a hundred story building. You need to tell me, using as few drops as possible, what the highest floor you can drop an egg from and it won't break.
I understand they are trying to get an idea that i have a very basic knowledge of programming, but, this has been a pretty good gauge on the quality of a company.<p>"Define polymorphism."