Prepare Interview

Exams Attended

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address
Check our LIVE MOCK INTERVIEWS

Spring Boot Interview Questions and Answers

Experienced / Expert level questions & answers

Ques 1. What is DevTools in Spring Boot?

Spring Boot DevTools helps you to increase the productivity of the developer. So, you do not require to redeploy your application every time you make the changes. It allows the developer to reload changes without the need of restarting of the server.

Is it helpful? Add Comment View Comments
 

Ques 2. What are the essential components of Spring Boot?

The important components of Spring Boot are:
  • Spring Boot Starter
  • Spring Boot autoconfiguration
  • Spring Boot Actuator
  • Spring Boot CLI

Is it helpful? Add Comment View Comments
 

Ques 3. What is spring-boot-starter-parent?

It is a special starter which makes Gradle or Maven dependency-management easy by adding jars to your classpath.

Is it helpful? Add Comment View Comments
 

Ques 4. How to enable HTTP/2 supports in Spring Boot?

User can enable HTTP/2 support by using server.http2.enabled configuration property. 

Is it helpful? Add Comment View Comments
 

Ques 5. What is a Spring Boot Actuator?

Spring Boot Actuator allows you to monitor and manage your application when you want to push it for the production. It helps you to control your application by using HTTP endpoints.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Is it helpful? Add Comment View Comments
 

Ques 6. Explain Spring Boot Admin.

Spring Boot admin is a community project which helps you to manage and monitor your Spring Boot applications.

Is it helpful? Add Comment View Comments
 

Ques 7. Explain Spring CLI.

Spring CLI is used for writing in Groovy Spring Boot application, which helps you to concise code.

Is it helpful? Add Comment View Comments
 

Ques 8. What are embedded containers support by Spring?

Spring Boot support the main three embedded containers:
  1. Tomcat
  2. Jetty
  3. Undertow.
By default, it uses Tomcat as an embedded container.

Is it helpful? Add Comment View Comments
 

Ques 9. Explain thymeleaf in Spring Boot.

Thymelaf is a server-side Java template engine for a web application. It helps you to bring elegant natural templates to your web application.

<dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

Is it helpful? Add Comment View Comments
 

Ques 10. What is a shutdown in the actuator?

A shutdown is an endpoint that helps application to be shut down properly. This feature is not enabled by default.
However, you can use it by setting command: management.endpoint.shutdown.enabled=true in your application.properties file.

Is it helpful? Add Comment View Comments
 

Ques 11. Is it possible to replace or override the Embedded Tomcat server in Spring Boot?

Yes, it is possible to replace the Embedded Tomcat with any other servers by using the starter dependencies. For that, you can use spring-boot-starter-jetty or as a dependency for according you to your need.

Is it helpful? Add Comment View Comments
 

Ques 12. Can you disable the default web server in the Spring Boot application?

Yes, we can disable the default web server by using application.properties to configure the web application type.

Is it helpful? Add Comment View Comments
 

Ques 13. How do you Add, Filter to an application?

There are three methods to add filter to Spring Boot application:
  1. By implementing Filter interface.
  2. Using FilterRegistrationBean.
  3. Using MVC controller.

Is it helpful? Add Comment View Comments
 

Ques 14. What is the use of profiles in Spring Boot?

Profiles are used to separate various parts of your spring application configuration and make it only available in certain environments.

Is it helpful? Add Comment View Comments
 

Ques 15. What is LiveReload in Spring Boot?

LiveReload is a spring-boot-devtools module that includes LiveReload server to trigger a browser refresh when a resource is changed. LiveReload server extensions are available freeware for Firefox, Chrome, and Safari.

Is it helpful? Add Comment View Comments
 

Ques 16. What are the major benefits of spring Externalized Configuration?

Externalized Configuration helps to work with the same code in different environments. Developers can use YAML files, properties files, command-line arguments, and environment variables to externalize configuration.

Is it helpful? Add Comment View Comments
 

Ques 17. What do you mean by hot-swapping in Spring Boot?

It is a way to reload the changes without restarting Tomcat, or Jetty server. Eclipse and Many other IDEs support bytecode hot swapping. If you make any changes that don’t affect the method signature, it should reload without side effect.

Is it helpful? Add Comment View Comments
 

Ques 18. How to handle exception in Spring Boot.

Spring Boot provides a very useful way to handle exceptions using @ControllerAdvice annotation.

Is it helpful? Add Comment View Comments
 

Ques 19. What is mean by spring batch?

Spring Boot Batch provides code reusability which is important when working with large numbers of records, including transaction management, logging, skipping, job processing statistics, and job restarts.

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-batch</artifactId>
</dependency>

Is it helpful? Add Comment View Comments
 

Ques 20. Explain CORS in Spring Boot?

CORS stands for Cross-Origin Resource Sharing is a  mechanism implemented by browsers and helps users to authorize cross-domain requests. This mechanism serves as an alternative to less secure and less powerful hacks of the kinds of IFrame or JSONP.

Is it helpful? Add Comment View Comments
 

Ques 21. How can you set active profile in Spring Boot?

Follow the following methods to set an active profile in Spring Boot.
  • Pass this profile as an argument when you launch the Spring Boot application (java -jar -Dspring.profiles.active=dev Sample-1.0-SNAPSHOT.jar).
  • Set active the active profile in application.properties file (spring.profiles.active=dev).

Is it helpful? Add Comment View Comments
 

Ques 22. List out some of the Spring Boot Starters.

Different Spring Boot Starters are as follows:
  • Security
  • Parent
  • web
  • Thymeleaf
  • Freemarker

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

Related differences

NodeJS vs Spring BootSpring vs Spring BootSpring MVC vs Spring Boot

Related interview subjects

JUnit interview questions and answers - Total 24 questions
Spring Framework interview questions and answers - Total 53 questions
Java Design Patterns interview questions and answers - Total 15 questions
Java 17 interview questions and answers - Total 20 questions
Core Java interview questions and answers - Total 306 questions
Tomcat interview questions and answers - Total 16 questions
Apache Wicket interview questions and answers - Total 26 questions
Java Applet interview questions and answers - Total 29 questions
JAXB interview questions and answers - Total 18 questions
JMS interview questions and answers - Total 64 questions
Log4j interview questions and answers - Total 35 questions
Struts interview questions and answers - Total 84 questions
RMI interview questions and answers - Total 31 questions
Apache Camel interview questions and answers - Total 20 questions
JDBC interview questions and answers - Total 27 questions
Java 11 interview questions and answers - Total 24 questions
JPA interview questions and answers - Total 41 questions
EJB interview questions and answers - Total 80 questions
GWT interview questions and answers - Total 27 questions
Kotlin interview questions and answers - Total 30 questions
Glassfish interview questions and answers - Total 8 questions
Google Gson interview questions and answers - Total 8 questions
Java 21 interview questions and answers - Total 21 questions
JSP interview questions and answers - Total 49 questions
J2EE interview questions and answers - Total 25 questions
Apache Tapestry interview questions and answers - Total 9 questions
Java Swing interview questions and answers - Total 27 questions
Java Mail interview questions and answers - Total 27 questions
Hibernate interview questions and answers - Total 52 questions
JSF interview questions and answers - Total 24 questions
Java 8 interview questions and answers - Total 30 questions
Java 15 interview questions and answers - Total 16 questions
JBoss interview questions and answers - Total 14 questions
Web Services interview questions and answers - Total 10 questions
RichFaces interview questions and answers - Total 26 questions
Servlets interview questions and answers - Total 34 questions
Java Beans interview questions and answers - Total 57 questions
Spring Boot interview questions and answers - Total 50 questions
©2023 WithoutBook