Sunday, May 13, 2007

My Fizz Buzz interview question

So there has been some "buzz" about the interview question that sets the bar for any entry level programmer. (forgive the pun)

I have my own entry level programming problem I have developed over many years of interviewing:

"Write the code in your favorite language (or pseudo-code) to remove all items from a list that a contained in another list."

I give them concrete lists so we can talk about the implementation:

List 1 = A, B, C, D, E, F
List 2 = C, E, F

Sounds easy enough but candidates almost always start with a loop over List 1 with an inner loop or lookup in list 2. Then, any normal programmer realizes the errors in their ways and say's oh crap, I'll be screwing up my iterator or index over list 1 if I modify list 1. It's interesting to watch as they try to come to a solutions. You would be surprised how many can not make a leap to a solution.

I get statements such as "Oh, man I've done this before" and then they never come to a solution.

Better candidates always ask questions such as what data structures would they be stored in and how large could the sets become? Is performance a factor? Do I memory limitations. The poor developers never make it to a solution. This is the true sign of an experienced developer.

But it's important that they give you a solution that works. I don't take the intelligent discussions around the problem as confirmation that they are a good developer. I want developers on my team that are good thinkers as well as can get things done.

I debated if I should post my version of the "Fizz Buzz" question here but my traffic on my blog is almost non-existent. I guess it's because either I don't have anything interesting to say or I don't blog enough.

Whatever....