« Amazon Favorite Items Widget | Home | Another Widget: Twitter »

Cool Coding/Interview Questions

By Jacob Cohen | March 1, 2007

I just came across the “FizzBuzz” problem for the first time on a blog entry called “Why Can’t Programmers.. Program?”. This is a pretty cool question, especially because it can easily be asked over the phone and a reasonable answer could be given over the phone.

I’m going to start collecting a set of problems like these, that are well-defined, and small enough that anyone should reasonably be able to write a solution to one of them in a couple minutes using any of the languages listed on their resume.

It’s also mildly interesting that there are so many poor solutions to the problem in the comments to the article. I think many of these are due to not reading the problem definition closely enough, because they are just printing out “Fizz” and “Buzz” and omitting the number itself when it isn’t divisible by either 3 or 5.

Topics: General, Tech |

2 Responses to “Cool Coding/Interview Questions”

  1. Brad Murphy Says:
    March 27th, 2008 at 8:57 am

    Hi Jacob,

    Did you ever follow through on your idea to identify several more simple, but elegant questions like FizzBuzz for assisting the interview process?

    -brad

  2. Jacob Cohen Says:
    March 27th, 2008 at 9:31 pm

    I haven’t found many, but I haven’t been looking too hard.

    Here are a few I have used in the past:

    - Implement a transposition cipher using row-order and column-order traversal of a 2d array.
    - Reverse the order of words in a sentence (ditched this because a lot of other interviewers use it).
    - Generate the first N prime numbers (this is even more widely asked).

Comments

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word