Spring Boot Interview Questions and Answers
(Fresher Level)
1. What is Spring Boot?
Spring Boot is a framework built on top of the Spring Framework used to create standalone,
production-ready Java applications quickly with minimal configuration.
2. What are the advantages of Spring Boot?
Faster development, minimal configuration, embedded servers, easy dependency management,
and microservice-friendly architecture.
3. Difference between Spring and Spring Boot?
Spring requires manual configuration and external servers, while Spring Boot provides auto
configuration and embedded servers with minimal setup.
4. What is Auto Configuration?
Auto Configuration automatically configures Spring applications based on the dependencies
present in the project.
5. What does @SpringBootApplication do?
It is a combination of @SpringBootConfiguration, @EnableAutoConfiguration, and
@ComponentScan.
6. What is @RestController?
It is used to create RESTful web services and returns data directly as JSON instead of a view.
7. Difference between @Controller and @RestController?
@Controller returns a view (HTML page), while @RestController returns data such as JSON or
XML.
8. What is Dependency Injection?
Dependency Injection is a design pattern where objects are provided to a class instead of the class
creating them.
9. What is @Autowired?
@Autowired is used to automatically inject dependencies into Spring-managed beans.
10. What is @Component?
It marks a class as a Spring Bean so that Spring can detect and manage it.
11. What is @RequestMapping?
It maps HTTP requests to handler methods in controllers.
12. What is @GetMapping?
It is a shortcut annotation used to handle HTTP GET requests.
13. What is @PostMapping?
It is used to handle HTTP POST requests when sending data to the server.
14. What is @PathVariable?
It is used to extract values from the URI path.
15. What is @RequestParam?
It is used to read query parameters from the URL.
16. What is Spring Data JPA?
Spring Data JPA simplifies database operations using JPA repositories and reduces boilerplate
code.
17. What is JpaRepository?
It is an interface that provides built-in CRUD operations for database entities.
18. What is Hibernate?
Hibernate is an ORM framework used to map Java objects to database tables.
19. What is ORM?
Object Relational Mapping (ORM) maps Java classes to database tables.
20. What is Spring Boot Starter?
Spring Boot Starters are dependency descriptors that simplify dependency management.
21. What is Embedded Server?
Spring Boot includes embedded servers like Tomcat, Jetty, or Undertow so applications can run
without external servers.
22. What is [Link]?
It is a configuration file used to define application settings such as server port and database
configuration.
23. What is Spring Boot Actuator?
Actuator provides production-ready features like monitoring, metrics, and health checks.
24. What is Microservices Architecture?
It is an architectural style where applications are divided into small independent services
communicating through APIs.
25. How does Spring Boot run an application?
The application starts from the main method using [Link](), which initializes the
Spring context and embedded server.