Does Java Puzzlers make Good Interview Questions?

Intent of my Blog

Recently i wrote an blog entry on one of the java puzzlers that was asked to me in an interview.I received some of the comments which said this is unfair to ask java puzzlers in an interview.So i thought of writing an blog which discusses whether java puzzlers make good interview questions or not.

Does Java Puzzlers make Good Interview Questions?

I think before answering this question that should we ask java puzzlers in an interview or not we need to define some guidelines about what makes a good interview question. And if java puzzlers fit within those guidelines then we can ask the them in an interview.I am giving my personal point of view please add in your comments if you think something different.

Guideline for a Good Technical Interview Question

  1. Question should be How not what = Should be Practical which means that Interviewer should not ask the definition of some term or concept the interview question should be such that it discusses  practical application of concept.Asking how has the advantage that interviewer gets the correct feedback about interviewee that interviewee actually understand the concept.
  2. Question should be on simpler concepts = Asking a difficult question doesn’t make an interview question good.In my personal opinion interview question should be about the concepts which a developer normally use. You can vary the difficulty level of question depending upon position you are hiring but the concept should be simple.For example you can ask questions on overriding which can be simple or difficult but the concept of overriding is such that every java developer should know.
  3. Question can be Extended =  A good interview question should be such that you can build your interview on that question which means that if you ask a question on overriding you can start with the easier question and then build your interview by asking questions that increases in difficulty.
  4. Question should not be specific to API = The question that i mentioned in my post was good but it was specific to the HashSet remove method arguments. Let me explain, when you create an hashset  like HashSet<Short> s = new HashSet<Short>() you might expect that when you are doing s.remove(i-1) should remove only short objects but when you take a look at the remove method it takes Object .This is something specific to api which  most of the developers might not know. So asking such a question becomes useless.
  5. Question should provide a learning point = A good interview question should provide a value add to the interviewee. It might be possible that interviewee knows everything which is great and you can hire him/her. But even if he/she doesn’t know the answer they can at least  learn a good technical point.

Does java puzzlers fit these guidelines?

In my view java puzzler fit some of the guidelines:-

  1. All Java Puzzler are about How not What so java puzzlers can provide interviewer the practical understanding of the interviewee.
  2. Java Puzzlers are about simpler concepts but the Puzzlers are not simple because they discuss the trap or corner cases of the API. You can use these concepts for interviews but the questions are very specific to api and most of the times should not be asked in interview.
  3. Java Puzzlers can be extended but again because they are not easy most of the times you will not get the correct answer.
  4. Java Puzzlers are specific to API and they require very good understanding of java api.
  5. Java Puzzlers definitely provide a learning value to interviewee because these questions touches the corner cases  of the api which normally developers doesn’t know.


In my view you can ask some of the java puzzlers in an interview as java puzzlers definetly provide a value. Sometimes you should only take a concept and build you question on that and sometime take the whole question. If you think the java puzzler you are asking is difficult and a normal developer who hasn’t read java puzzlers book can’t answer please dont make that question a decider question means your decision to hire a person should not be based only on  java puzzler. Java Puzzlers are definetly very good questions and you should use them wisely in interview.

These are some of my view points. Please share your also.

3 thoughts on “Does Java Puzzlers make Good Interview Questions?”

  1. “Question should provide a learning point” — why? This is not the purpose of a job interview. I suggest that the most important characteristic is “An answer to the question should provide useful information about whether the candidate is suitable for the job.” That, after all, is the purpose of an interview, right?

    When judged against this criterion, I’d argue “Puzzlers” are among the worst sort of questions to ask in an interview. Few puzzlers ever crop up in day-to-day Java coding (for example, when was the last time you wrote code that used short integers?) Further, puzzlers are designed to be deceptive: the code is carefully contrived so that it looks like it clearly does one thing, but actually behaves differently due to some hairy corner case in Java. It’s not at all clear to me that you learn anything about a candidate’s suitability if they solve, or fail to solve, one.

    1. When i say “Question should provide a learning point” i mean that the candidate should at least learn something from the interview for example there are some java puzzlers around autoboxing and unboxing problems so if you ask the interviewee question regarding these and if interviewee don’t know about the problems autoboxing and unboxing can cause this can be one of the learning point for them.I am not saying that java puzzlers should be the deciding factor in the interview but they can at least enrich someone knowledge about java.
      Yes you are right that purpose of interview is to find the suitable person for the job but if you help interviewee learn something new whats the harm.You can also see how interviewee approach the java puzzlers.

  2. Same reasons, different conclusions.

    “How and not What” – Java Puzzlers are not about the “how”, at least not in the form of “What will be printed from this code”. Maybe if phrased “this code prints XYZ because ABC occurs. Can you elaborate” is better.

    Simpler concept – Java Puzzlers are not about simple concepts, they’re about tricks and hard-to-get points. If main-stream Java was really that complex, it wouldn’t have survived this long.

    Extended – well, yes. That’s the point I’ve made in the original comment (thanks for the reference btw).

    Not specific to API – Disagree with you about this. I rather like questions specific to an API, but I’ll also explain the API, then ask questions about the API design itself. I don’t presume knowledge about APIs though.

    Learning point – why? I agree that good questions offer a learning point, but that’s a by-product, not a goal.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: