Spring Boot
Interview Questions
1. What is Spring Boot?
-
Spring Boot is a Spring module which provides RAD (Rapid Application Development) feature to Spring framework.
-
It is used to create stand alone spring based application that you can just run because it needs very little spring configuration.
2. What are the advantages of Spring Boot?
- Create stand-alone Spring applications that can be started using java -jar.
- Embed Tomcat, Jetty or Undertow directly. You don’t need to deploy WAR files.
- It provides opinionated ‘starter’ POMs to simplify your Maven configuration.
- It automatically configure Spring whenever possible.
3.What are the features of Spring Boot?
- Web Development
- SpringApplication
- Application events and listeners
- Admin features
4.How to create Spring Boot project using Spring Initializer?
It is a web tool which is provided by Spring on official site. You can create Spring Boot project by providing project details.
5.How to create Spring Boot project using boot CLI?
we can download from the official site of Spring Framework.
6.What are the Spring Boot Annotations?
The @RestController
is a stereotype annotation. It adds @Controller
and @ResponseBody
annotations to the class. We need to import org.springframework.web.bind.annotation package in our file, in order to implement it.
7.What is Spring Boot dependency management?
-
Spring Boot manages dependencies and configuration automatically. You don’t need to specify version for any of that dependencies.
-
Spring Boot upgrades all dependencies automatically when you upgrade Spring Boot.
8.What are the Spring Boot properties?
- Spring Boot provides various properties which can be specified inside our project’s application.properties file.
- These properties have default values and you can set that inside the properties file.
- Properties are used to set values like: server-port number, database connection configuration etc.
9.What are the Spring Boot Starters?
-
Starters are a set of convenient dependency descriptors which we can include in our application.
-
Spring Boot provides built-in starters which makes development easier and rapid.
-
For example, if we want to get started using Spring and JPA for database access, just include the spring-boot-starter-data-jpa dependency in your project.
10.What is Spring Boot Actuator?
- Spring Boot provides actuator to monitor and manage our application.
- Actuator is a tool which has HTTP endpoints.
- when application is pushed to production, you can choose to manage and monitor your application using HTTP endpoints.