Jan 21, 2013

Top 20+ Java EE interview questions and answers that experienced Java developers must know

Java Interview Questions and Answers

1-5 for experienced developers 6-10 for experienced developers 11-16 for experienced developers 17-20 for experienced developers

If you are an interviewer -- it really pays to ask well rounded questions to judge the real experience of the candidate as opposed to just relying on the number of years.

If you are an interviewee -- You have no control over what questions will be asked in Java job interviews, but there are a few Java interview questions that are very frequently asked in job interviews, and it really pays to prepare for those questions. Here are a few such questions. This is based on some of my recent interviews. Brushing up on these answers will boost your success rate in Java job interviews.

The focus is on judging your experience and technical strength. So, go through your resume and reflect back on your hands-on experience. Many of these answers will also serve you well in selling your technical strengths to open ended questions like -- tell me about yourself? , why do you like software development?, when reviewing others' work, what do you look for?, what was your most significant accomplishment?, etc

Q1. Can you describe the high level architecture of the application that you had worked on recently? or Can you give a 100 feet bird's eye view of the application you were involved in as a developer or designer?

A1. The purpose is to judge your overall experience. Here are a few links that will prepare for this most sought-after question, especially for the experienced professionals.
  • 3 to n-tier enterprise Java architecture, the MVC-2 design pattern, the distinction between physical and logical tiers, and the layered architecture.The logical tiers shown in the diagrams for the above link are basically layers, and the layers are used for organizing your code. Typical layers include Presentation, Business and Data – the same as the traditional 3-tier model. But when  talk about layers, we’re only talking about logical organization of code. Physical tiers however, are only about where the code gets deployed and run as war, ear or jar. Specifically, tiers are places where layers are deployed and where layers run. In other words, tiers are the physical deployment of layers.
  • high level architectural patterns and the pros and cons of each approach. Discusses a number different architectual styles like MVC, SOA, UI Component, RESTful data composition, HTML data composition, Plug-in architecture, and Event Driven Architecture (EDA). Also, covers a sample enterprise architecture, which is a hybrid of a number of architectural styles.
  • Single page web design. A single rich web page loading different sections (e.g tabs) of the page by making different ajax calls to relevant RESTful web services to get the JSON data to render the relevant sections.
  • Understanding of various types of application integration styles. Enterprise applications need to be integrated with other systems, and this post covers different integration styles like sharing the same database, feed based, RPC style (e.g. web services), and exchanging JMS messages.

Q2. How would you go about deciding between SOAP based web service and RESTful web service?
A2. Web services are very popular and widely used to integrate disparate systems. It is imperative to understand the differences, pros, and cons between each approach. Recently, I have been asked these questions very frequently, here is the answer that discusses the pros and cons of SOAP vs. RESTful web services in detail.  

Q3.How will you go about ensuring that you build a more robust application? or How do you improve quality of your application?
A3. This question is very popular with the interviewers because they want to hire candidates who write good quality application. Here are some useful links to prepare for this question.
Q4. What are some of the best practices regarding SDLC? Have you worked in an agile development environment? Did you use test driven development and continuous integration?

Q5: Can you write code? How would you go about implementing .....?
A5:  You will be asked to write a small function or a program. The interviewer will be looking for things like
  • How well you analyze the requirements and the solution? Ask relevant questions if the requirements are not clear. Think out loud so that the interviewer knows that how you are approaching the problem.The approach is more important that arriving at the correct solution.
  • List all possible alternatives.
  • Write pseudo code.
  • Write unit tests.
  • Where required, brainstorm with the interviewer.
  • Find ways to improve your initial solution. Talk through thread safety and best practices where applicable.
Here are some links to popular coding questions and answers.
  • Java coding interview questions and answers:. Covers a number of coding questions with answers. These are some of the popular coding interview questions like reversing a string, calculating the Fibonacci number, recursion vs iteration, equals versus ==, etc.
Coding Questions and Answers worth brushing up on, especially before the screening written tests.
Q. Can you write Java code to compute a collection of numbers supplied to it? The computation could be addition, subtraction, etc. Use recursion to compute the numbers. Here are some requirements to take into considerations.

1. It should be flexible enough to convert from Recursion to iteration if required.
2. Computation will initially be "addition", but should be extendable to multiplication, subtraction, etc.
3. Should handle integers and floating point numbers.
4. Make use of generics.

A. Java coding with recursion and generics

Q. The SimpleDateFormatter and DecimalFormatter are not thread-safe. How will you use them in a thread-safe manner?
A. Using the ThreadLocal class as demonstrated in this tutorial.

Q. If Java did not have its own Map or Set implementation, how will you go about implementing your own?
A. Covered in detail with diagrams and code in "Core Java Career Essentials" book.

Java Interview Questions and Answers

1-5 for experienced developers 6-10 for experienced developers 11-16 for experienced developers 17-20 for experienced developers

Labels: , ,


Anonymous Dana Dame said...

I know Core Java and servlet concepts very well but in the interview point of i could not expose my knowledge. This interview questions are very helpful for interview and as well as to improve my technical skills. Thank you..

3:21 PM, August 09, 2013  
Anonymous JM said...


Thank you for the great post, I assembled some technical questions in my blog that can be helpful for your readers. Please take a look here :

Thanks again.

8:52 PM, September 06, 2013  
Anonymous Jen Finalserva said...

thanks a lot for nice post.

2:51 PM, September 12, 2013  
Blogger Mohamed Shimran said...

Very helpful :)

Ultimate Programming Tutorials

1:47 PM, October 16, 2013  
Anonymous Anonymous said...

I like this Post:-)

12:58 AM, November 24, 2013  
Anonymous Saliha Ali said...

Thanks Alot, Your post is awesome, Really helped me alot ..

4:24 AM, December 01, 2013  
Anonymous Sneha said...

Thanks :)

4:52 PM, January 15, 2014  
Blogger SANYHN A said...

Nice blog.. different approach for preparing for interviews.. Thanks !!

8:00 AM, March 01, 2014  
Blogger Kumar Bhatia said...

Good set of interview questions in java. I also provide basic questionnaire on my website –

12:08 AM, April 29, 2014  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home