Interviewing - Reading code
Interviews - reading code
When I do interviews, I always get developers to read some code, and talk about it - almost as a code review process. I get asked why I do this, and don’t get developers to actually write code during an interview - I mean that I what developers are actually paid to do isn’t it?
Why read code?
Actually, I find that, as developers, we tend to spend more of our time actually reading code that we do writing code. Whenver we are actually going to write new code, fix a bug, or write some documenation, as part of this process we are continually reading code. A person being interviewed can memorise some code writing exercies (there are only so many - think FizzBuzz, a sorting algorithm, or being told the problem by a recruiter), but being thrown in to some random code can only really be prepared for by spending time reading and writing code - i.e. doing the job that I am interviewing for.
We sometimes ask some SQL type questions, as another area of the interview. In this, we sometimes ask candidates to write a basic select statement. The number of people who are so flustered in an interview situation and are unable to write this simple statement is surprisignly large. So if we threw in writing .NET code too, my view is that we would be just missing some good candidates as some people just get so stressed in an interview that they miss the simple ideas. When reading code, candidates seem to be put at ease, and tend to answer questions, which leads to further discussions, and I think this gets a better result for both the candidate and the interviewer.
Reading code is also more efficient in an interview than writing code. In a 90 minute interview, after introductions, role and company discussions, and a quick run through the CV, there is about half an hour to look at some actual code. Getting a candidate to read code, means I can get through more concepts and ideas to examine the candidate than I could if I was making the candidate write code.
Is that all?
The code reading section of the interview is not the only thing that I am looking for during the interview. Cultural fit is important, as is having a can do type of attitude. I find that reading code is a part of the puzzle.
How do I get better?
Reading code is a skill, and like any skill, it needs practising. I find the best way to practice is to have some form of side project on the go, and be updating it, and improving it, to make it something that you are proud of. This also has the advantage that you now have some nice code that you can add a link to your GitHub in your CV, and I can see that you can write nice code too. Also, spend some time looking at some open source libraries that you are interested in.
If you are already a developer, then conducting code reviews will really help too, and you can question the author to get answers as to why thay have done something the way they have.
For more information, check out: