December 17, 2006

How to pass a contemporary technical interview (in Java)

Last week I found myself on both sides of technical interviewing. I was interviewed by a potential customer and I interviewed on the phone a couple of potential colleagues (one of whom was even a probable candidate for going on H1B next year). As someone who has spent considerable time this year in preparation for interviews and actually passing them I believe I am qualified to share a piece of advice with those of you who are to be interviewed in a year or so (fashionable technologies tend to change periodically).

Personally, I am quite ambivalent about this kind of technical interviews. On the one hand, the goal is to merely ensure that a candidate really knows the stuff he pretends to know according to his CV. Taking into account that most of modern Java development is mostly Web-related the technologies in question are pretty straightforward, hardly conceptually challenging and can be mastered at home at least in the scope of passing an interview. I find this a little bit humiliating because it closely reminds a school - there are standard questions, there are right answers and the amount of your experience, ingenuity or other abilities is generally of little importance.

On the flip side, one after one people with degrees in CS and up to ten years of experience come to the interview and fail to properly address issues covered in every second book. Not to mention the curious fact that they frequently lie about even basic knowledge of particular buzzwords. My favorite examples are UML (oh come on, if you are lazy enough to know the four relation types used on class diagrams just efface it from your CV, do not leave me in doubt of your qualification by stumbling on trivial questions) and databases (enumeration of multiple DBs raises a red flag - are you really aware of any obscure vendor-specific features of at least one of them?). Every single dude includes them into his CV and to my utter surprise I witnessed way to many interviews where candidates were found wanting in those areas.

In my personal experience, I have talked about such technologies as EJB much more than I actually worked with but it was not awfully stretching to read a couple of books on the subject to understand the technology. So when I meet people who worked with J2EE and Java for a couple of years and are totally unaware of EJB types or do not have any idea about O/R mapping (Scott Ambler is still as much an authoritative source as he was 6 years ago when I was learning the ropes) I wonder whether they are really motivated self-starters or at least competent engineers interested in things beyond immediate needs.

So today I am on a mission. I want to help you look professional during your next interview - and chances are you will likely be even more knowledgeable than the interviewer who will be impressed enough to compose a eulogy disguised as an interview report to his management :) It does not require a stint in NASA's JPL or GOOG - just a couple of months of thoughtful reading. Let me introduce you the list of books I found to be helpful above average.

J2SE
  • The Java Programming Language - this single book covers basically everything concerning the language in the scope of a typical interview (even watered down discussions of class loaders and garbage collectors). You want regret learning this one by heart when you asked one day about Writer vs InputStream (sic! :) ) or Serializable vs Externalizable (the need for readResolve() anybody?)
  • Core Java 2 Volume I, Volume II - a few chapters are really good at covering a lot in just a few pages, especially Multithreading and Collections (Volume II Chapters 1, 2)
  • Java Concurrency in Practice - I believe this is all the rage this year - just look at the list of authors. I have already read it twice and I am relishing the idea of doing it once more. It will blow you away and totally confuse mere mortals among your interviewers. You will never see concurrent development in Java the way you used to.
J2EE
  • Mastering EJB - It was good years ago, it is in a perfect shape in its 3d edition. As a bonus, you will multiple useful digressions (e.g. transactions - from models to isolation levels)
  • Core J2EE Patterns - before invention of such frameworks as Spring the enterprise Java foray was in a real mess. This book discusses details of the props used to keep an unwieldy J2EE application afloat. Your DTOs will not be any more object-oriented but you will definitely know how to engage an EJB Facade through a Business delegate if you have a Service Locator.
Presentation tier
  • SCWCD Exam Study Kit - if you are a server-side developer shunning UI like me you will find this book helpful once you really need to know the basics of Java presentation tier. Sundry useful facts about JSP and Servlet are packed into a neat sequence in one relatively compact volume. Whether it is redirect() vs forward(), GET vs POST, servlet lifecycle or web.xml structure, JSP scopes or JSTL tags - you will be well equipped in a matter of a few days.
  • Struts in action - learn quite an outdated but still popular framework in a couple of days. The knowledge of the architecture and key classes (Action/ActionForm/ActionMapping) will frequently suffice.
  • JavaServer Faces in Action - in my opinion JSF is the only Java-Web-UI technology which belongs to the OO world and deserves some attention. This book is a nice one to get started.
Business logic tier
  • Spring in action - in a sense Spring is more than an IoC container or a Web/MVC framework. This is my personal favorite - small, well structured, convenient and unit tests-friendly. If you have time and J2EE experience it does not hurt to read the original thoughtful discussion of EJB vs Spring.
O/R Mapping
  • Hibernate in action - read it and you will be familiar with both O/R mapping concepts and one of their finest incarnations on the market. A really nice book.
DB
  • Expert Oracle database architecture - in my professional life Oracle has always been the database of choice in complex systems. Undoubtedly there are numerous books out there but I really admire the explanation of Oracle locking/concurrency/multiversioning/transactions in chapters 6-8. It clarifies a few moot points of critical importance to application developer and highlights how different Oracle is from the rest of the pack in this respect.
As I am not really into UI development so I do not suggest anything on client-side scripting. I believe this kind of knowledge will improve your interview score only marginally anyway. More or less anything on JavaScript/Ajax will do.