Tuesday, May 15, 2007

Make Your Junior Developer Interviewees Cry

Long ago I was asked (while interviewing for my first development job) to implement the following panic-inducing algorithm in the course of an hour or so during an interview (i.e., sit down at a computer and get it to work - not just whiteboard + handwaving):

For an arbitrary arithmetic expression string with nested parentheses, parse it and compute the answer. (Note: Google has this built in to their search engine interface - if you type "((2 + 6) / 4) * .01" it will give you the correct answer. Wouldn't be surprised if they ask this programming question to interviewees as well.)

It's a good test of whether or not you've got someone who's a very promising candidate or not, especially if they'll be doing something in the area of compilers/interpreters. Tests string manipulation, state, recursion (probably they'll try that approach) and is long enough to get a feel for their style.

No comments: