Java + Spring Boot + Database: Complete Topic Guide with Questions
Core Java
OOP Concepts
Basic Level Questions:
- What is inheritance in Java?
- Define encapsulation with example.
Medium Level Questions:
- Difference between abstract class and interface?
- What is polymorphism and where is it used?
Hard Level Questions:
- How does Java achieve runtime polymorphism?
- Explain Liskov Substitution Principle in OOP.
Collections Framework
Basic Level Questions:
- What is ArrayList in Java?
- How do you iterate a List?
Medium Level Questions:
- Difference between HashMap and TreeMap?
- What is the role of Comparable interface?
Hard Level Questions:
- Implement a custom comparator and sort a complex object.
- Explain fail-fast vs fail-safe iterator.
Spring Boot
Spring Boot Core
Basic Level Questions:
- What is Spring Boot?
- Explain @RestController annotation.
Medium Level Questions:
- How does Spring Boot autoconfiguration work?
- What is the role of application.properties?
Java + Spring Boot + Database: Complete Topic Guide with Questions
Hard Level Questions:
- Customize Spring Boot starter and auto-config.
- Explain the Spring Boot application lifecycle.
Spring Data JPA
Basic Level Questions:
- What is an Entity in JPA?
- How do you define a primary key?
Medium Level Questions:
- Explain the difference between CrudRepository and JpaRepository.
- How do you define OneToMany relationship?
Hard Level Questions:
- Write a complex custom JPQL query.
- Explain Lazy vs Eager loading with example.
Database
SQL Basics
Basic Level Questions:
- What is a primary key?
- Define the use of SELECT statement.
Medium Level Questions:
- Difference between INNER JOIN and LEFT JOIN?
- What is a view and how is it used?
Hard Level Questions:
- Write a query using nested subqueries.
- Explain normalization with examples.
JDBC & ORM
Basic Level Questions:
- What is JDBC?
- How to connect Java to MySQL?
Medium Level Questions:
Java + Spring Boot + Database: Complete Topic Guide with Questions
- How to use PreparedStatement?
- Difference between Statement and PreparedStatement?
Hard Level Questions:
- Explain Connection Pooling.
- Design a transaction-safe JDBC application.