Spring Boot is a popular framework built on top of the Spring Framework, designed to simplify the
development of production-ready applications. It minimizes configuration and provides built-in
functionalities for creating standalone, web-based, or microservice applications. Below is a guide to
Spring Boot interview preparation, categorized for ease:
Core Concepts
1. What is Spring Boot?
o How does Spring Boot differ from the Spring Framework?
o What are the main features of Spring Boot?
o Why is Spring Boot called an opinionated framework?
2. Spring Boot Annotations:
o What is the purpose of @SpringBootApplication?
o Explain the difference between @Component, @Service, and @Repository.
o What is the use of @RestController vs. @Controller?
o Explain the significance of @ConfigurationProperties.
3. Spring Boot Configuration:
o What is the difference between [Link] and [Link]?
o How do you define custom properties in Spring Boot?
o How can you set up environment-specific configurations?
4. Embedded Servers:
o What is an embedded server in Spring Boot?
o What are the default embedded servers provided by Spring Boot?
o How do you switch the embedded server (e.g., from Tomcat to Jetty)?
Dependency Injection and Beans
1. Dependency Injection:
o What is dependency injection in Spring Boot, and how does it work?
o Explain the difference between field injection, setter injection, and constructor
injection.
2. Bean Lifecycle:
o What are the scopes of beans in Spring Boot?
o How do you define a bean using Java configuration?
3. Profiles:
o What are Spring Profiles? How do you use them?
o How can you activate a profile in Spring Boot?
Web Development
1. Spring Boot REST API:
o How do you create a RESTful API in Spring Boot?
o Explain the difference between @GetMapping, @PostMapping, and other mapping
annotations.
o How do you handle path variables and query parameters in Spring Boot?
2. Exception Handling:
o What is the purpose of @ExceptionHandler and @ControllerAdvice?
o How do you create a global exception handler in Spring Boot?
3. Thymeleaf:
o What is Thymeleaf, and how is it integrated with Spring Boot?
o What are some common use cases for Thymeleaf?
Spring Data and Database Integration
1. Spring Data JPA:
o What is Spring Data JPA? How is it used in Spring Boot?
o What are the differences between CrudRepository, JpaRepository, and
PagingAndSortingRepository?
o How do you write custom queries in Spring Data JPA?
2. Database Configuration:
o How do you configure a database connection in Spring Boot?
o What is the difference between [Link] and [Link]?
3. Transaction Management:
o How do you enable transaction management in Spring Boot?
o What is the role of the @Transactional annotation?
4. Flyway and Liquibase:
o What are Flyway and Liquibase?
o How are they used for database versioning in Spring Boot?