Kate Gregory's Blog
Wednesday, 01 December 2010
C++ Interview Whiteboard problem
Lately there's been quite a lot of interest on programmers.se about
, and specifically the "coding at the whiteboard" part of the interview. It came up in a discussion of
, in one about
"testing" your whiteboard code
, and in one about
question 11 of the Joel test
I ask candidates to code at the whiteboard. I ask an intensely simple question, because I am mostly testing for things other than the actual code the person writes. I know, however, that there are places that actually want you to tackle reasonably challenging problems. I came across
this blog entry
(who edits The Architecture Journal, writes architecture columns, and is committed to native C++big time) that walks you through a C++ whiteboard problem that is decidedly non-trivial. What I found interesting is that he starts his "thinking aloud" the same way I would, but then when I would start writing something that worked for valid input, he first started to set out examples of invalid input. And when he wrote the code, it starts by rejecting various categories of invalid input before processing anything. It's cool to see someone thinking differently from me.
One thing really struck me. He spends over a page on the signature of his method - why he called it rtoi, why it returns an unsigned int, why its argument is const, whether it should take a unicode string or not, why an STL string and not a char*. See how much these problems reveal about a person? That kind of care and precision is not something you can discover by asking a person "how important is it to you that a method signature is chosen with care? Can you give me some examples of naming methods you have done?" Coding in a job interview is about so much more than syntax. Are you prepared for the whiteboard?
Seen and Recommended
Wednesday, 01 December 2010 21:59:11 (Eastern Standard Time, UTC-05:00)
Comments are closed.
© Copyright 2018 Kate Gregory
Theme design by
newtelligence dasBlog 2.3.9074.18820
| Page rendered at Saturday, 15 December 2018 04:00:21 (Eastern Standard Time, UTC-05:00)
On this page....
Pluralsight Free Trial
Click Start a FREE 10-Day trial
Home - Gregory Consulting Limited
Visual C++ on MSDN
Office 12 and VSTO
Seen and Recommended
Visual Studio 11
Visual Studio 2008
Visual Studio 2010
Visual Studio 2013
Visual Studio 2015
Visual Studio 2017