You are not a compiler

Original author: You are not a compiler!
  • Transfer
At conferences, gifts are often given out at stands. Usually you need to solve some problem.

Innocent puzzle

Some of the tasks involve solving a puzzle with code, such as this:

What will be the result of executing the following code:

public class Sum {
    public static void main(String[] args) {
        System.out.println(0123 + 3210);

  1. 3293
  2. 3333
  3. This code does not compile
  4. This code leads to an error IllegalArgumentException
  5. None of the above

My usual reaction is to leave the booth immediately, or, if time permits, type the code on the laptop to see the result (or search on Google). You can blame me for being lazy, but I prefer to introduce myself as an expert in time management.

Simple but useless

The only advantage of this approach is that anyone can evaluate the answers if he has the correct answers. And it's all.

In addition, this kind of puzzles do not say anything. This would not be a problem if such puzzles did not go beyond the exhibition stands as “funny” games. Unfortunately, such things are beginning to be used everywhere for screening candidates for employment or certification.

In both cases, you should evaluate your abilities, and the simplest solution is to see just a test questionnaire with several answer options. Of course, if a person does not have access to the IDE or Google, then this becomes a difficult task. But what is verified in the above example? Knowledge of a very specific situation that occurs with certain parameters. This is a specific use, which in any case I would forbid to use in my projects for the same reason: this is an exceptional situation! And I do not want such situations to occur in my code.

Another example

Here is another problem that you may encounter:

What is the correct method signature service()in the class javax.servlet.http.HttpServlet?

  1. public void service(ServletRequest, ServletResponse)
  2. public void service(HttpServletRequest, HttpServletResponse)
  3. public int service(ServletRequest, ServletResponse)
  4. public int service(HttpServletRequest, HttpServletResponse)
  5. protected void service(ServletRequest, ServletResponse)
  6. protected void service(HttpServletRequest, HttpServletResponse)
  7. protected int service(ServletRequest, ServletResponse)
  8. protected int service(HttpServletRequest, HttpServletResponse)

Such questions do not test anything but the ability to remember part of the functionality of the core IDE or JavaDoc documentation.

Note. In fact, the full title of this article should be "You are not a compiler, not a runtime, or documentation."

Key issue

There is not a single evidence of a positive correlation between the correct answers to the above questions and the real ability to apply the abilities that these tests should evaluate. Is there an alternative? Yes. You don’t need to check insignificant pieces of knowledge, but you need to check exactly what you want to evaluate under the same conditions, including IDE, documentation, Google and so on.

  • Want to evaluate how a candidate handles reading code? Let him read his own code - or similar code if your secret.
  • Want to evaluate how a candidate writes code? Let him write the code, for example, fix an already fixed bug.

The same goes for certification.

Of course, the disadvantage of such a solution is that it takes time. Time to prepare the material. Time to analyze the results. Time for an interview.

Is this feasible? Unfortunately for those who consider this a utopia, such a system already exists. The best example is Java EE Enterprise Architect . Although at the first stage you need to pass a test with several possible answers, the other stages include completing tasks as in the present project and writing an appropriate essay.

Another example is more personal. I work as a lecturer in a number of higher educational institutions. In some courses, I evaluate students by giving them the task: to develop a very small application. The task is given in the form of specifications, as is customary in the world of business analytics.


For the good of our industry, let's stop pretending that puzzles have any value other than fun puzzles to entertain with colleagues. We need to think more about the consequences of hiring a bad professional than the time we spend evaluating a candidate’s abilities. There are alternatives, use them. Or scoop up the consequences.

Also popular now: