J2EE Interview Questions: How to Survive a Javalanche

j2eeinterviewquestionsHerein lies a classic dilemma.  J2EE is one of the safest, most secure web developing languages available.  But!  It is extremely challenging to learn.  Even a specialist can have a difficult time effectively communicating his or her fluency.   Emerging successfully from an interview laden with J2EE questions is never going to be a walk in the park—unless you happen to be the father of the Java language himself, James Gosling.  But for all the Gosling wannabes, there are two primary categories to which you should direct your focus: learning to efficiently communicate the fundamentals of J2EE, and preparing yourself for the more common questions an expert can expect to face.

Don’t be fooled by the simplicity of these initial questions.  They are the foundation on which interviewers will build more and more complex queries.  If you start to see the interviewer go in a certain direction (the ins and outs of Hibernate, for example), use that to your advantage by anticipating the questions to follow.  The worst thing that can happen is to be caught off guard by an easy question, thereby causing the rest of your beautiful response-architecture to lean precariously à la the Tower of Pisa.  Whatever your skill level, don’t forget the essentials of interviewing: be prepared, get a good night’s sleep, and give your confidence a boost by showing up in style.

Are you familiar with J2EE?  Great.  What is it?

J2EE is the second version of Java-based web development language; it stands for Java 2 Enterprise Edition.  J2EE is one of the safest, most secure platforms that allow you to create multi-tiered web-based applications.  The platform itself has three components: a set of services, application programming interfaces (APIs), and protocols.  J2EE is an ideal environment for building or running enterprise software, and it allows you to run network and web services, too.

What are the components of the J2EE application?

  • Client Components (application clients and applets)
  • Web Components (JavaServer Pages and Java Servlets)
  • Business Components (Enterprise JavaBeans)
  • Resource Adapter Components

Tell me more about application clients and applets.

An application client is a first-tier client component with access to certain APIs.  An “application client module” contains class files, a deployment descriptor, and it is packaged as a JAR file.  An “application client container” is simply a container that supports application client components.

Applets characteristically execute in web browsers with Java Plugins, but they can execute anywhere that supports the applet programming model.  As with an application client container, an “applet container” is one that supports applet programming.

You mentioned deployment descriptors.  Please expand on them.

All four components of the J2EE application have deployment descriptors, which are simply .xml files that describe how the component, module or application should be deployed (which in turn have appropriate security settings, specific container options, and configuration requirements).

You also mentioned JAR files.  What are the differences between these and EAR and WAR files?

Structurally, JAR, EAR and WAR files are the same.  They all implement zip-jar compression, but each is designed to serve a different purpose.  In addition, servlet containers, enterprise applications, application servers, etc. process each type of file differently.

  • JAR files (.jar) contain generic libraries, resources, classes, and accessory files.
  • WAR files (.war) contain files necessary to develop web applications, i.e. JSP, HTML, Javascript.  In the WAR context, a web application is a single group of files, classes, resources and JAR files packaged and accessed through one servlet.
  • EAR files (.ear) contain the enterprise modules of the application.  Simply put, it’s a JAR file with an .ear extension (Enterprise ARchive file).  This means that, similar to WAR files, EAR files are a collection of classes, resources, JAR files and web applications.  An application with all of its modules attaches is delivered as .ear.  This way, when multiple modules are deployed, it happens simultaneously and comprehensibly.

Let’s change gears.  What’s a thin client?

A thin client is just like it sounds: it’s a lightweight interface to an application.  Operations are trimmed from thin clients.  These include query databases, complex executions, and contact with legacy applications.

What is JAXP?

JAXP stands for Java API for XML Processing.  XML data can be analyzed and authenticated via JAXP.  It provides standard services (determination, compression, discovery, creation) using three basic interfaces:

  • Document Object Model (DOM)
  • Simple API for XML (SAX)
  • Streaming API for XML (StAX)

What is JAAS?

JAAS (pronounced “jazz”) is an acronym for Java Authentication and Authorization Service.  Essentially, JAAS strengthens the security for J2EE applications that require authentication and authorization modules.  Whereas previous authentications contained code origin information, JAAS extends the verification vectors by adding a marker about who runs the code.


Now that you know a few of the basics (and understand how a clever interviewer will use a progression of questions to coax you into the deep, dark depths of J2EE), let’s look at some of the other topics you can expect to encounter.  If you are at all proficient at J2EE, these will serve as a template for review.  On the other hand, if you wrote an exceptional cover letter and managed to score an interview that’s just a wee bit over your head, you might seriously consider brushing up on Java.

  • What are container services?
  • What do Enterprise JavaBean components contain?
  • What is the difference between Session Bean and Entity Bean?
  • What is Backing Bean?
  • What is bean-managed persistence?  Bean-managed transaction?
  • What is Hibernate?
  • What are the core interfaces of Hibernate?
  • Why do we use it?
  • What are some of the disadvantages of using Hibernate?
  • What is HQL?
  • What is JTA and JTS?
  • What is ActionError?
  • What is ActionForm?
  • What is ActionMapping?
  • What is Spring?
  • What are the benefits of Spring Framwork?
  • How about a code example for a lifestyle interface in Spring?

Please note that these are only a sampling to get you started.  No doubt you will want to do a comprehensive review of J2EE before throwing on your favorite sweater vest.  Have a history of bombed interviews?  Be proactive in changing your luck.  Figure out how to get hired once and for all.  May the spirit of James Gosling be with you, and good luck!