Wednesday, May 30, 2007

How to write bad code using 1000 gnomes

A very long hallway has 1000 doors numbered 1 to 1000; all doors are initially closed. One by one, 1000 people go down the hall: the first person opens each door, the second person closes all doors with even numbers, the third person closes door 3, opens door 6, closes door 9, opens door 12, etc. That is, the n th person changes all doors whose numbers are divisible by n . After all 1000 people have gone down the hall, which doors are open and which are closed?

How many times you had an interview in which you were given questions like this one?
And how many times you have an interview in which you were asked to solve real problems the development in the hiring company had?

Which hiring company would you like better?

Developers are smart people, don't expect them to take you seriously if you throw logic riddles at them instead of really testing their programming skills.
Let the interviewee solve actual problems - a good developer will enjoy the challenge and will show it.

(The title of the post is based on the hebrew version of the riddle above, in which "people" were replaced by "gnomes" or "dwarves". I wonder if this tell you something about the Israeli culture)

No comments: