interview-questions

What is your solution to the FizzBuzz problem?

See here Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". Disclaimer: I do realize this is easy, and I understand the content of the Coding Horror post ...

Identifying passionate programmers

I'm hiring a programmer, how can I differentiate the good programmers from those good programmers who have a real passion for their work ?...

How do I interview a senior developer without pissing him off?

I'm a mid/seniorish level developer myself. I've interviewed many junior level developers, fresh out of college looking for their first job. So I've read up on things like Joel's Guerrilla Guide to interviewing - http://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html and I agree that it's a great way to structure that in-pers...

Interview Questions for an Intern

I have a potential intern coming in tomorrow for his second interview. Following Joel Spolsky's advice from "Smart & Get Things Done" this is where we get a little technical and make sure the kid can do the things he says he can do. We are a ASP.NET, C# (1.1 - 3.5) shop that uses XHTML/CSS, jQuery, SQL Server 2000/2005 primarily for ou...

Reverse "ON" bits in a byte..

I was reading Joel's book where he was suggesting as interview question: Write a program to reverse the "ON" bits in a given byte. I only can think of a solution using C. Asking here so you can show me how to do in a Non C way (if possible) ...

What questions should be asked to a potential future employer during an interview for a programming position?

I'm going to start interviewing again over the next couple of months. I'm about three years out of school, got some good programming experience under my belt that I can boast about, and finally feel like I can call some of the shots. A question that has been bouncing around in my head for awhile is what are the best questions I should ...

What is the best interview question?

What is the best interview question you have ever been asked? ...

What is the worst interview question?

What is the absolutely worst job interview question that you've been asked? What did you answer? Did you get the job? ...

What is the worst interviewee answer?

Following this question, what is the worst interview answer you've gotten from an interviewee in a technical interview? ...

Expression Evaluation and Tree Walking using polymorphism? (ala Steve Yegge)

This morning, I was reading Steve Yegge's: When Polymorphism Fails, when I came across a question that a co-worker of his used to ask potential employees when they came for their interview at Amazon. As an example of polymorphism in action, let's look at the classic "eval" interview question, which (as far as I know) was brough...

Interview question on C# and VB.net similarities/differences

I have been a VB.net developer for a few years now but I am currently applying to a few companies that use C#. I have even been told that at least one of the companies doesn't want VB.net developers. I have been looking online trying to find real differences between the two and have asked on crackoverflow. The only major differences ar...

What interview question weeds out 'bad' applicants?

We have a list of the best interview questions people have been asked and the worst interview question you've been asked but what question do you believe sorts the chaff from the wheat? One you've been asked, one you've asked or one you wish the co-worker from hell had been asked. There's no magic bullet but is there one question you t...

How do you answer the "Why do you want to work here?" interview question?

Is it better to answer it focusing on why the company is good, or how the job will affect you personally? (ie: by gaining experience and growing) Also, I never feel I answer correctly when they tell me to "tell them about myself", what should one focus on? ...

Your feeling about 'brainteaser'-based interviews

...either as interviewer and/or interviewee! I know lots of people are against them. I'm quite fond of brainteasers (math/CS-based, and I certainly prefer those which don't require any specialized knowledge). In my line of work, 'problem solving' is quite an important requirement when looking for new hires and I think brainteasers can...

How do I write a sort worse than O(n!)

I wrote an O(n!) sort for my amusement that can't be trivially optimized to run faster without replacing it entirely. [And no, I didn't just randomize the items until they were sorted]. How might I write an even worse Big-O sort, without just adding extraneous junk that could be pulled out to reduce the time complexity? http://en.wi...

Practical programming test in interview

I have been invited to do a second interview for a company recruiting for a software engineer. This interview will consist of a 45 minute programmatic test on a laptop followed by a whiteboard presentation on the solution. This position is Java/J2EE based so I'm assuming (hoping) the test will be implemented using Java. Have you ever do...

Best algorithm to test if a linked list has a cycle

What's the best (halting) algorithm for determining if a linked list has a cycle in it? [Edit] Analysis of asymptotic complexity for both time and space would be sweet so answers can be compared better. [Edit] Original question was not addressing nodes with outdegree > 1, but there's some talk about it. That question is more along the ...

Finding a single number in a list

What would be the best algorithm for finding a number that occurs only once in a list which has all other numbers occurring exactly twice. So, in the list of integers (lets take it as an array) each integer repeats exactly twice, except one. To find that one, what is the best algorithm. ...

Properties of good coding interview questions?

A lot of coder interviews involve asking a brainteaser-ish / cleverness-inspired algorithmic puzzle. I can see how this can help measure intelligence, quick-thinking, and an ability to communicate. And, frankly, I love brainteasers. But maybe you want to hire someone for skills besides quick-thinking and cleverness -- such as an abili...

How do you rotate a two dimensional array?

Inspired by Raymond Chen's post, say you have a 4x4 two dimensional array, write a function that rotates it 90 degrees. Raymond links to a solution in pseudo code, but I'd like to see some real world stuff. [1][2][3][4] [5][6][7][8] [9][0][1][2] [3][4][5][6] Becomes: [3][9][5][1] [4][0][6][2] [5][1][7][3] [6][2][8][4] Update: Nick'...