Unless you have very long interviews, it is very difficult to have a candidate write a substantial amount of code.  I think an interview can reliably deal with this by showing the interviewee a code sample and asking them about it. This code sample can not be a simple HelloWorld program.  It needs to compile correctly and have runtime, various style problems, and good coding practices problems.  These problems need to be at different skills levels to decipher. This code sample would be printed out and given to the interviewee.  Ask them to circle the problems and give them 5-10 minutes.  The interviewer would look at the various items that are circled.  The interviewer would ask why the interviewee circled a particular item and then ask how the interviewee would fix it. Take the following code for example:

public class CodeTest {
  public String getString() {
    String theimportantstring = null;

    if (theimportantstring.isEmpty()) {
      theimportantstring = "something very important  ";
      theimportantstring.toUpperCase();
      theimportantstring.trim();
      return theimportantstring;
    } else {
      theimportantstring = "something slightly different but very important     ";
      theimportantstring.toUpperCase();
      theimportantstring.trim();
      return theimportantstring;
    }
  }
}

This gives a very brief example.  I think the code sample should be between 30-50 lines of code, but it gives the general idea.  This code compiles but have various problems with it.  First, it will give a NullPointerException when run.  This is a straightforward issue in the code.  There are other more subtle problems.  There are no comments.  The variables name switch from CamelCase to all lowercase.  There is copying and pasting in the method. Depending on the level of issues found a general assumption about an interviewee’s code quality can be ascertained.  The amount of time spent is not significant and the interviewer can get an idea of the interviewee’s programming knowledge by how they would fix the issue.

Are you ready to upgrade your skills and become a Data Engineer?

Take the next step and sign up for my newsletter. I share exclusive material that you won’t find anywhere else.

Material like when I started my Big Data journey I thought I’d never interview at Google. Now I’ve lost count of how many times I’ve turned down Google. I knew I was a world-class engineer, but I could never demonstrate it during my job searches and interviews.

You have Successfully Subscribed!

Share This