I have written a lot of posts for java interview questions, this is a placeholder for all those posts. You can bookmark this post and come again in future to see the new additions.
Java Interview Questions
Core Java is the starting point of any Java interview. Whether you are fresher or experienced in java, having a strong grip on Core Java is very important to clear the interview. This article lists down some of the commonly asked core java interview questions with answers.
Java 8 was a major release with many new features such as Lambdas, Functional interfaces, Streams, Date Time API etc. This is a must have if you are going to any java interview because it’s always good to be aware of latest language changes.
I recently wrote another article as part-2 of java 8 interview questions, please go through this too.
Collections are core components of Java programming language and hence widely used in interview questions. The post contains 40 questions on java collections to make sure all the topics are covered and help you in impressing your interviewer.
I also recommend to check out java collections tutorial to have a deep knowledge of Collections in java.
Everybody uses String and usually java interview starts with some tricky questions on Java String. This post contains 21 questions with detailed answers for String in java.
Multithreading and Concurrency is a hot topic in java interviews. Whether you are new to Java or an expert, its good to have good knowledge on Threads in java and this post covers 30+ interview questions for Java Threads.
I also recommend you to read Java Thread Tutorial to gain good knowledge on Threads.
Exception Handling is one of the tricky area and Java provides a robust and object-oriented approach for exception handling. There are Exception, Error and Throwable at the root of Exception Handling. I have seen so many guys who are confused in checked, un-checked and runtime exceptions. Here you will go through a list of 15 questions entirely related to Exception Handling in Java.
You should know about java virtual machine, runtime environment and java compiler. A post dedicated to explain these and list out their differences.
If you consider yourself an expert in java, be prepared to face some questions on Java Classloader. A comprehensive post providing detailed explanation of different types of java classloaders, how and when we should write our own classloaders with example programs.
Abstract classes and interfaces are used in java for providing contract but what is the difference between them and when should we use interface over abstract class and vice versa is a great design question and asked a lot in java interviews. This post provides all the differences between abstract class and interface and when should we use interface over abstract class and vice versa. The post also explains how to use abstract class and interface both in conjunction to create a flexible design for providing contract for subclasses. I also recommend to read java abstract class and interface in java tutorials.
One of the mostly asked question is why java doesn’t support multiple inheritance and why should we prefer composition over inheritance. A post with detailed explanation of multiple inheritance and issues with inheritance that make composition a better approach.
Some tricky questions to test your programming skills, also check out java tricky code snippets.
Java 7 catch block has been improved to catch multiple exceptions in a single block, a good improvement for making our catch block code small when we needed to catch a lot of exceptions.
JVM runtime memory is divided into heap memory and stack memory. An important article explaining the difference between Heap and Stack memory through program. I recently published a YouTube video too, make sure to watch that for better understanding.
This is one of the most confusing question about java programming language. Some say it’s pass by value and somewhere you will read that it’s pass by reference. Then again behaviour changes for primitive types or Objects parameters? Read this out to clear this confusion once and for all. This is one of the favorite question asked by java interviewers.
If you are working on Enterprise applications, I am sure that JDBC API is a part of it. JDBC API provides database connectivity for relational databases, such as MySQL and Oracle.
This article go through a collection of 40+ interview questions related to JDBC API from basic Connection to DataSource to Connection Pooling. It will help you in interviews for questions related to JDBC API and how to effectively use it.
If you are new to JDBC or you have a lot of experience, I would still suggest you to go through JDBC Tutorial to make sure you have covered all the core parts of it.
Servlets are one of the hot topics of Java Enterprise Edition interview questions. This post contains a list of 50 servlet interview questions with answers in detail. A must have bookmarked post because I will keep on adding more questions in future.
JSP is the integral part of Java EE and if you are giving interview for web developer, then having good knowledge of JSP technology is very important. This post contains a list of 35 JSP interview questions with answers. Please make sure to bookmark it because I will be keep on adding more to the list in future.
Struts2 is one of the modern Java Web Application framework. This article contains a list of 30 questions that covers most of the important components of Struts2 framework.
Spring Framework is most widely used Java EE framework. It’s built on core principles of “Dependency Injection” and “Aspect Oriented Programming”. This post contains more than 45 questions related to Spring Framework, Dependency Injection, Spring AOP, Spring JDBC, Spring MVC Framework and some common tasks such as file uploading, localization etc. A good post to go through before any Java EE interview.
Web services are very popular these days because they are language and platform independent. It’s easy to create SOAP and REST based web services. This post will help you learn about web services and related interview questions. Then there are questions with detailed answers for Java Web Services.
More than 50 questions on JSF-2 with detailed answers, go through them as a refresher on JSF framework.
Hibernate is the best java based ORM tool in the market. It’s used a lot in most of the enterprise applications to overcome the shortcomings of JDBC. One of the best part with hibernate is the flexibility of configuration using XML, JPA annotations as well as through code. So it’s always a plus point to have Hibernate in your resume. Whether you are experienced with hibernate or newbie, these questions will help you in interview and impress your interviewer.
Java EE Interview Questions
Scala is famous programming language that provides functional programming in Java. I have written three successive posts too that you can go though for scala interview preparation.
- Scala intermediate interview questions
- Scala intermediate and advanced interview questions
- Scala advanced interview questions
For clearing an interview, only technical knowledge is not enough. You will have to go through common job interview questions such as your last company experience, why you are looking for change etc. This is a post with 40 job interview questions that are asked in almost all the interviews.