Java Interview Que
Java Interview Que
1. Core Java:
Theory Questions:
Practical Questions:
1. Write a program to demonstrate method overloading and method overriding.
2. Write a Java program to implement multithreading using Runnable interface.
3. Implement a Java program that uses exception handling to manage a divide-by-zero error.
4. Write a Java program to read data from a file using BufferedReader.
5. Write a program to create a custom exception and demonstrate its usage.
2. Advance Java:
Theory Questions:
1. What is JDBC and what are the different types of JDBC drivers?
2. Explain the concept of servlets. How do servlets handle HTTP requests?
3. What is the difference between GET and POST methods in HTTP?
4. How does the session management work in Java EE?
5. Explain the role of JSP in Java web applications.
6. What is the Model-View-Controller (MVC) architecture and how is it implemented in Java?
7. Explain the concept of connection pooling in Java.
8. What are the types of elements with Java Server Pages (JSP)?
9. Explain the Life Cycle of a servlet.
10. What are some of the advantages of using JSP?
11. How does JSP work?
12. What is JSTL?
13. What are JSTL Core tags used for?
14. What are Implicit JSP Objects?
Practical Questions:
1. Write a Java program to connect to a MySQL database using JDBC and retrieve data.
2. Create a simple Java Servlet that handles GET and POST requests.
3. Develop a basic login system using JSP and Servlets.
4. Create a CRUD application using JDBC for interacting with a MySQL database.
3. Spring Framework:
Theory Questions:
1. What is Spring Framework? What are its main features?
2. Explain the concept of Dependency Injection (DI) in Spring.
3. What is Spring Bean? Explain its lifecycle.
4. What are the different types of autowiring in Spring?
5. What is Spring AOP (Aspect-Oriented Programming)? Give a use case for AOP.
6. How does Spring handle transaction management?
7. Explain the difference between @Component, @Service, @Repository, and
@Controller annotations.
8. What is the role of ApplicationContext in Spring?
9. What are the bean scopes available in Spring?
10. What is autowiring and name the different modes of it?
11. What are the limitations of autowiring?
Practical Questions:
1. Create a Spring application that demonstrates Dependency Injection using @Autowired.
2. Implement a Spring-based application with CRUD operations using JdbcTemplate.
3. Demonstrate how to configure transaction management in Spring.
4. Create a simple Spring AOP example using the @Aspect annotation.
4. Hibernate Framework:
Theory Questions:
Practical Questions:
1. Create a simple Hibernate application that performs CRUD operations on a MySQL database.
2. Write a program to demonstrate One-to-Many mapping in Hibernate.
3. Implement Hibernate with second-level caching using EHCache.
4. Configure and use Hibernate Query Language (HQL) to retrieve data.
5. Spring Boot:
Theory Questions:
6. REST API:
Theory Questions:
Practical Questions:
7. Microservices:
Theory Questions:
1. What are microservices and how do they differ from monolithic architectures?
2. What issues are generally solved by spring clouds?
3. Write main components of Microservices.
4. What are the main benefits of using a microservice architecture?
5. Explain the role of API Gateway in a microservice architecture.
6. What is service discovery in microservices and how is it implemented?
7. How do microservices handle inter-service communication?
8. What is circuit breaker pattern and how is it implemented in microservices?
Practical Questions: