Programmers and software developers must undergo a series of tests and trials during their interview process before they are judged worthy. During a phone screen you typically get questions that test your basic knowledge of Windows, C# and .NET Framework, and if you pass that stage you are invited for an in-person interview. During that interview, at least one person on the development team will ask you to go to the whiteboard and write some code. Joel on Software has some pretty good guidelines on what sort of code a candidate will write.
It's a great technique for detecting if the person really is a coder/programmer and not a poser. (Or, as one of my college professors once said, to weed out the Spicolis.) Whenever my company is hiring someone, myself or someone on my team will make the candidate perform this coding exercise.
However, when I am the candidate, I look forward to whiteboard coding about as much as a trip to the dentist. I actively dread the moment when someone says, go to the whiteboard and write some code. I feel a certain pain in my mind, akin to that dreaded pinch when the dentist injects Novocain into my mouth. When I arrive at the whiteboard, my mind goes blank. My knees feel weak. I feel as if I suddenly belong in the marketing group. Only I'm not thin or attractive enough to work in marketing.
Therefore, to overcome this fear, I've started collecting all kinds of interview whiteboard coding examples, and will share them with you here. Most of the code you will see here is not the code I wrote during my interview. But even if the interview went well or it was a disaster, I went home and tried to write the code when I was more relaxed.
I review these examples before going into a new interview. I don't memorize the code per se; I do remember the general pattern of the solution and stumble through it on the whiteboard.
I'll be writing several articles in the weeks ahead, but this post will keep an index of all whiteboard code, which will be written in C:
Interview Coding: Fibonacci sequence
Interview Coding: Reversing a Singly Linked List in C



Leave a comment