Writing code in interviews – The Guerrilla Guide to Interviewing – Joel on Software
Some signs of a good programmer: good programmers have a habit of writing their { and then skipping down to the bottom of the page and writing their }s right away, then filling in the blank later. They also tend to have some kind of a variable naming convention, primitive though it may be… Good programmers tend to use really short variable names for loop indices. If they name their loop index CurrentPagePositionLoopCounter it is sure sign that they have not written a lot of code in their life. Occasionally, you will see a C programmer write something like if (0==strlen(x)), putting the constant on the left hand side of the == . This is a really good sign. It means that they were stung once too many times by confusing = and == and have forced themselves to learn a new habit to avoid that trap.

And yes, the next day after I posted this article I get an interview with the “reverse a string in place” question. And try to do it with pointer arithmetic. And completely screw it up because I didn’t brush up on my pointer arithmetic.
The correct solution.
char *str_rev(char *p_str)
{
char tmp, *front = p_str, *back = p_str;
assert(p_str != NULL);
while (*back) {
back++;
}
back–;
while (back > front) {
tmp = *back;
*back = *front;
*front = tmp;
back–;
front++;
}
return p_str;
}
[...] Joel has another great post on phone interviews. He focuses on asking questions on programming skills and office politics, with an emphasis on putting forth incorrect assertions and seeing if the interviewee pipes up. “Smart programmers have a certain affinity for the truth, and they’ll call you on it.” He also gives a list of good interview questions like how to design a program for playing Monopoly. This isn’t his first time talking about interviewing, he also gave some good tips in his Guerrilla Guide to Interviewing. It happens all the time: we get a resume that everyone thinks is really exciting. Terrific grades. All kinds of powerful-sounding jobs. Lots of experience. Speaks seventeen languages. And saved over 10,000 kittens! [...]
Nice site actually. Gone to my favourites. Thanks for creation.