Tim\'s picture      Blogging Ottinger (tim)

2007-February-27

FizzBuzz

Filed under: Life

Wow. I read an article at Coding Horror stating that a lot of programming job candidates cannot write code at all. No kidding? I used to do a lot of interviewing at some of my previous jobs, and I usually had a great group of candidates. We were a little harsh on programming puzzles and could have gone more gently, I suppose. We had good candidates and hired the best of them (or so I think).

I remember one guy who was given a bit of code to read and the question was “what does this code do?”. I remember his answer, “it’s C, so it could do anything at all. There is no way to tell without firing up the debugger.” I thought it was the worse answer I’d ever heard. The problem was a two-or-three line example. I remember that guy being hired against my recommendation because of talents other than programming, and maybe that turned out okay. I don’t recall.

But just in case someone asks, here’s some python:

for number in range(100):
    value = \"\"
    if number%3==0: value += \"Fizz\"
    if number%5==0: value += \"Buzz\"
    print value or number

Maybe it’s not elegant, but it is a program.

Comments »

The URI to TrackBack this entry is: http://tottinge.blogsome.com/2007/02/27/fizzbuzz/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome | Theme designs available here