(Note for non-programmers: this is a very easy task.)
(Note 2: Pseudocode is not real code with formal syntax; it’s just jotting down how code’s going to work.)
So this guy interviews today, seems nice and possibly adequate. According to him, his strength is VB.NET, and although 95% of our stuff is C#, I don’t sweat someone learning a new language syntax.
Towards the end of the interview, my colleague gave him the programming question above. After stammering for a few seconds, the guy explained, “Well, you know, pseudocode was one of the first classes I took, and I can’t really remember back that far.” While I tried to prevent myself from bursting, my colleague suggested he write out the code in Visual Basic, since that was supposed to be his strength. The shirking candidate claimed he couldn’t write the function without looking in a reference book.
At that moment, I felt like saying “Interview over, time for our next contestant.” However, my co-worker went on to explain the solution, which would use a loop to print out all the numbers. “A loop. You know, a for loop?” he asked. The candidate muttered, “Oh, a for loop…”, obviously with no knowledge of what it was (who knows, he may have been thinking it was a “4 loop”.)
This guy seems pretty sharp, and I thought he’d easily write the function we asked for. He knew what he wanted to do, but couldn’t remember the math operator to do it. “Mod? Square root?”, he muttered.
After a few minutes he came up with this bloat, where he rolled out his own test for mod equalling 0. He almost got the function right. As a point of comparison, the function can be done in C# in 5 lines, 7 if you count the braces.
We reminded him of what the mod operator does, and had a chuckle over it. I told him that if we hired him, I’d frame his solution above his desk. Er, cubicle.