Coding Tests in Interviews
I had the opportunity to give a technical interview the other day where I asked the programmer to write a routine that counts the number of bits in a byte. [ Update: I actually asked to count the number of 1 bits in a byte. ] He could choose the language or even use psuedo-code if he wanted. The candidate grew nervous and said he couldn't do it without the development environment. I said it was a single function coding test and I do not expect perfect code, but he simply refused to do it.
I like the approach of seeing how a candidate thinks and operates, and this is the reason for coding a single function. The candidate expressed a background of working extensively with binary data, so I threw out an example that should have been comfortable for him. I've been wondering if I approached it improperly, but I really can't see how I could have made this any easier/better - short of “Hello World”.