Java Application & Web Developer Interview Guide
1. Core Java
Q: What is the difference between JDK, JRE, and JVM?
A: JDK (Java Development Kit) is used for development, JRE (Java Runtime Environment) is used
to run Java applications, and JVM (Java Virtual Machine) executes bytecode.
Q: What are the main OOP principles?
A: Encapsulation, Inheritance, Polymorphism, and Abstraction.
Q: What is the difference between == and equals()?
A: '==' compares object references, while equals() compares object content.
2. Exception Handling
Q: What is the difference between checked and unchecked exceptions?
A: Checked exceptions are checked at compile-time (e.g., IOException), while unchecked
exceptions occur at runtime (e.g., NullPointerException).
Q: What is the purpose of finally block?
A: It executes important cleanup code (like closing resources) whether or not an exception occurs.
3. Collections Framework
Q: What is the difference between List, Set, and Map?
A: List allows duplicates and preserves order, Set doesn’t allow duplicates, and Map stores
key-value pairs.
Q: What is the difference between HashMap and Hashtable?
A: HashMap is not synchronized and allows null keys, while Hashtable is synchronized and doesn’t
allow null keys.
4. JDBC (Database Connectivity)
Q: What are the main steps to connect Java with a database?
A: Load driver, create connection, create statement, execute query, process results, and close
connection.
Q: What is PreparedStatement?
A: It’s a precompiled SQL statement that improves performance and prevents SQL injection.
5. Servlets & JSP
Q: What is a Servlet?
A: A Java class that handles HTTP requests and responses in a web application.
Q: Difference between doGet() and doPost()?
A: doGet() is used for fetching data and parameters appear in the URL, while doPost() is used for
sending data securely.
Q: What are JSP directives?
A: Directives provide global information like <%@ page %>, <%@ include %>, and <%@ taglib %>.
6. Spring Boot
Q: What is Spring Boot?
A: It’s a framework that simplifies Spring-based application development using auto-configuration
and embedded servers.
Q: What is dependency injection?
A: A design pattern where the framework manages object creation and dependencies
automatically.
Q: What is a REST controller in Spring Boot?
A: A class annotated with @RestController that handles RESTful web requests and returns data as
JSON or XML.
7. REST API
Q: What is REST?
A: Representational State Transfer — an architectural style for designing networked applications
using HTTP methods like GET, POST, PUT, DELETE.
Q: What is the difference between PUT and POST?
A: POST creates a resource, while PUT updates an existing one.
8. SQL & Database
Q: What is the difference between INNER JOIN and LEFT JOIN?
A: INNER JOIN returns matching rows from both tables; LEFT JOIN returns all rows from the left
table even if there’s no match.
Q: How do you prevent SQL injection?
A: Use PreparedStatements or parameterized queries instead of concatenating SQL strings.
9. HR & Behavioral Questions
Q: Tell me about yourself.
A: Briefly introduce your background, technical skills, and recent project experience related to Java
and web development.
Q: Describe a challenge you faced in a project.
A: Mention a real-world issue (like debugging or API errors), how you solved it, and what you
learned.