This post is the part of our Interview Questions series and.In this post, we will discuss some of the commonly asked Spring Boot Interview Questions during a job interview.
Refer to Spring Boot Tutorial for more detail about Spring Boot.
Spring Boot is an opinionated framework for building and running Spring applications.Spring Boot is not a framework for writing applications, think of Spring Boot as a tool which can do these initial tasks for us automatically.
While working on big enterprise projects involving several frameworks, it is very complex to handle all configurations and making sure required dependencies are in place.Spring Boot focuses on developer productivity by providing smart auto configuration modules and handling all configurations and dependencies for us.
Read What is Spring Boot for more detail.
XML configurationsfor your project.
Maven POMto simplify your configuration.
Spring Boot Starters are the set of convenient dependency descriptors which can be easily included in any level of application.These starters work as a bootstrapping process for the Spring related technologies, we no longer need to worry about the dependencies and they will be automatically managed by Spring Boot Starters.
The starters contain a lot of the dependencies that you need to get a project up and running quickly and with a consistent, supported set of managed transitive dependencies.To summarize, Spring Boot Starters are just JAR files used by Spring Boot for auto-dependency.
Read Spring Boot Starters for more detail.
For a complete list, read Spring Boot Starters List
No, Spring Boot has limited to Spring based application only.
There are multiple options to create Spring Boot application.We can use any of the following approaches
Read Building an Application with Spring Boot for detail.
Spring Boot Initilizr is a Spring Boot tool to bootstrap Spring Boot or Spring Applications very easily. Spring Initializr is also integrated with all major Java IDEs along with CLI.
This is achievable by Spring Boot Dev Tools module.it’s a powerful tool for the development.It helps developers to shorten the development cycle and enable easy deployment and testing during the development.
To enable this feature, add the following dependency to Maven
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency> </dependencies>
Read Spring Boot Dev Tools for different features of Dev Tools.
Spring Boot advocate convention over configuration.Spring Boot externalize application configurations through application.properties file.These properties work as default values for Spring Boot application.
To override these default values, Spring Boot provides following options.
application.propertiesfile in the classpath for overriding specific properties for Spring Boot.
application.ymlfile in the classpath for overriding specific properties for Spring Boot.
e.g. Server HTTP port default to 8080 in the default
application.properties file.To change this port to 9090, add below entry in the custom
Spring Boot includes support for the following embedded containers
Use the right “Starter” to configure the embedded container.
In this article, we discussed some the commonly asked Spring Boot Interview Questions during a job interview.If you are preparing for your next interview, read our post on Spring Interview Questions.