How-to Interview Java Coders
Interviewing to me is definitely a trained skill that you have to practice with. Your goal is to extract as much information from the candidate so that you can make a useful recommendation. If you get too little information then your recommendation will contain more of a risk.
Each candidate that is interviewed is a different person and thus each interview is slightly different. For example: A candidate directly out of college will be asked different questions then a person with 10 years in the industry.
Regardless of the person, if they are wanting work as a professional programmer then they need to know a few of the basics. For the most part, it comes down to communication. When you interact with other programmers you have a basic vocabulary that is used. If the candidate doesn't have that vocabulary, then communication between the candidate and the other developers will be hindered.
I also am a strong believer that if you are going to work in the industry, you should at least have a basic understand of the underlying workings of a computer. Thus my questions are more general, yet still technical.
So this is my personal interviewing technique. One thing to note is that I try very hard to not ask trivia questions. These questions are things like "What does transient mean?". Guess what, I can look it up if I need it. I'm much more interested in if the candidate has a good solid base to grow with.
The first thing I hit on is what is a bit and a byte. From there I ask the primative types in Java and their sizes. The sizes question shouldn't be difficult if the candidate understands basic memory storage. Simply start with byte and work your way up, increasing the power of two each time.
Directly following this is a discussion about Data Structures. Remember your old friends (Map,Set,List,Array,Tree,Graph,Stack,Queue)? Hopefully you can name a couple of these, explain what makes each of them special, and have an example of when to use them. Oh, and a good side discussion regarding the equals() and hashcode() methods is good here as well.
Next is basic OO terminology. This is that vocabulary I discussed above. Polymorphism, encapsulation, interface, inheritance, overloading, overriding, pass by referrence, object, class, abstract class. If you don't know these then how can you a)communicate with your co-workers and b)create object-oriented software?
After OO I look at the resume and determine if they have database experience and if they are comfortable answering database questions. If yes then I would discuss primary keys, relationships, common database problems, and joins.
To round off the technical portion of the interview I discuss software designing. Things like coupling, cohesion, design patterns, tiered architecture. Usually I also go through a modelling question as well to see what types of behavior and attributes the candidate can come up with. The modelling question has been an item of hot debate with the team and we have yet to find a question that we are happy with.
My final technical interviewing requirement is asking the candidate to code. What? Code at an interview for a job that requires coding? That's crazy! The sad fact is that I have never been asked to code at any interview I've gone through. Would you hire a knife throwing juggler without seeing him or her juggle? NO! So why do we allow people to code without seeing them, well, code?
It doesn't take long to come up with some sort of coding exercise that can be written on the board or a piece of paper. Yikes! No IDE for help? Well, yeah, see the idea is that the exercise shouldn't really need an IDE. It should be simple enough to finish in 5 min, yet hard enough to get some sort of information from it. Currently the "Write a function to reverse a string" question has been working well.
If the candidate passes the technical portion of the interview, then it is onto Step 2, the soft skills interview.
Posted at 11:50PM Jun 20, 2006 by Aaron in Java | Comments[19]





Guess what? I can look that up too. It's trivia, but at a lower level.
Posted by Rufus on June 21, 2006 at 08:11 PM CDT #
Posted by Aaron Korver on June 21, 2006 at 08:37 PM CDT #
Posted by namehere on June 22, 2006 at 02:06 AM CDT #
Posted by Rufus on June 22, 2006 at 09:02 AM CDT #
Posted by Fred Garvin on June 22, 2006 at 11:26 AM CDT #
String is new StringBuffer("string").reverse().toString();
probably spread over a couple of lines.
Unless there is a very good reason to duplicate core functionality you shouldn't do it.
Of course you may need to do this *ALOT*, in which case you would probably implement something yourself, but then again you may wish to consider your string storage mechanism, but that's probably a completely different question.
Posted by David Hutchinson on June 22, 2006 at 01:09 PM CDT #
Rufus -- You really do need to know the number of bits. I'm not saying you have to consciously worry about it every day. But it is the foundation of our profession. Would you expect a Chef to not know about salt? Or a Banker to not know about pennies?
Fred -- If there is time we may use a more involved programming exercise. We have also experimented with giving an exercise and asking the candidate to complete it BEFORE the interview.
David -- StringBuffer is syncronized, so it tends to be a bit slower. I'll be posting a quick run down of just a few ways to reverse a string and the performance of each. Stay tuned.
Posted by Aaron Korver on June 22, 2006 at 06:51 PM CDT #
But I agree it's not something to bring up in a first interview, but if a candidate is going to be working with serialization, they need to be aware of it, because if they aren't, how are they going to know to look it up?
Improving on David's suggestion, you can reverse a String without synchronization in Java 5 with:
new StringBuilder("string").reverse().toString();
Converting a String to a byte[] or a char[] and reversing the array in Java is wrong because a character may be longer than a byte or char. Doing so would indicate a candidate is unaware of Unicode and i18n issues.
Don't get me wrong, I think your outline for an interview is good and covers all the important things. What I struggle with when interviewing is the technical details. If I'm interviewing someone for a senior Java job, I want to make sure they really know the language, but you don't want to lose someone because they got a bit of detail wrong. Coming up with a coding task that can do than and fit into a hour is very hard and something I'm still working on.
Posted by Miles Barr on June 25, 2006 at 02:39 PM CDT #
Posted by jmalon on June 26, 2006 at 06:52 PM CDT #
For someone who places a lot of value on communication, your ability to correctly spell leaves a lot to be desired. Just two examples: "canidate" and "inheiratance".
Written communication is as important as its oral counterpart, wouldn't you agree?
Posted by Wagner on June 26, 2006 at 07:28 PM CDT #
Posted by pcdinh on June 26, 2006 at 08:44 PM CDT #
pchinh -- I agree that you interview someone out of college in a slightly different manner than an experienced programmer. However, they should still know the basics.
Posted by Aaron Korver on June 26, 2006 at 11:12 PM CDT #
Posted by Sven Bange on June 27, 2006 at 01:04 AM CDT #
I feel, if someone can clear elimentry questions he/she would be an okay programmer but may not develop into an skilled developer.
We try to see the problem solving skills and learning ability.
Posted by Shilpa on June 27, 2006 at 09:12 AM CDT #
trivia, if the acceptable grown-up answer
is "I'd look it up" and is not met with "ha-ha-
you-don't-know-the-length-of-Ritchie's-beard"). Open-ended ones ("How would you go about
designing X") are still concrete. Provided
that you cut the interviewee some slack for
being nervous under pressure of an interview,
these certainly beat HR-type questions of
"How do you interact with a team?" (I am
not saying the answer to that is meaningless
at all; but the posing of the question is :).
Posted by DEBEDb on June 27, 2006 at 09:27 AM CDT #
Posted by 155.140.122.227 on June 27, 2006 at 02:44 PM CDT #
Detailed technical skills can be improved via work/project and using code review tools such as PMD, FindBugs...
In case you dont know what underlying mechanism sit under reserving a string, dont worry, open a textbook and you can find it easily or search an API that serve it. But you dont know how that information system work and how to read and implement that sequence diagram, forget it, you are fired.
As you may know, I may not know about how my internal body work, I run well. With a little luck , I can be a good athlete ;)
@Shilpa: I feel, if someone can clear elimentry questions he/she would be an okay programmer but may not develop into an skilled developer.
I disagree. There is no connection between a skilled developer and those having very detailed basic knowledge on computer science. Ok, you may know the low level knowlegde on bit and byte manipulation, so what is the next? Are you ensure that you can produce good code when develop a user management system with Servlet 2.4? No clue.
Posted by pcdinh on June 27, 2006 at 04:24 PM CDT #
Sure, but not without seeing them throw a knife.
Posted by Dave Newton on June 27, 2006 at 08:34 PM CDT #
Also, knowing about how a Servlet works is just an extension on the building blocks of bits and bytes. Thus with a good solid foundation, anything can be built. The opposite arguement fails though, just because someone is an expert in say Struts, does not mean that they can produce good JDBC code.
@Dave I thought saying "Knife juggling juggler" would be redundant ;-)
The reason we don't have them work with the IDE is this...which IDE? Maybe they don't know Eclipse? Does this mean we should not hire them? The whiteboard becomes the least common denominator.
Posted by Aaron Korver on June 28, 2006 at 09:56 AM CDT #