Pull to refresh

Top Spring Boot Interview Questions

This list has top 10+ spring boot interview questions and answers for Java developers.

1) What is Spring Boot?


Spring Boot is basically a Spring module. It provides RAD feature. RAD stands for Rapid Application Development.

This framework is used to create stand alone spring based application.

These are ready to run applications. Unless Spring, it does not need a lot of configuration.

2) List some features of Spring Boot?


  1. Admin features
  2. Application events and listeners
  3. SpringApplication
  4. Web Development

3) What are the advantages of Spring Boot?


Spring Boot creates stand-alone Spring applications. These can be started using java -jar.
It has internal embedded servers like Tomcat, Jetty etc. This framework has automatic configuration feature.

We do not need to explicitly deploy WAR files.

The configurations are simplified in Spring Boot as it has multiple starter packages to help.

4) What are the ways to create Spring Boot application using Maven?



There exists four ways, we can create Spring Boot applications. Those are mentioned below:

There are multiple approaches to create Spring Boot project. We can use any of the following approach to create application.

  1. Spring Maven Project
  2. Spring Boot CLI
  3. Spring Initializr
  4. Spring Starter Project Wizard

5) What is Spring Boot Annotation and Why they are used?


Annotations are widely used in Spring Boot. These are used to define some property or behavior to any method or class.

Some Examples of Spring Boot annotations are:


6) What are Spring Boot properties and why they are used?


Spring Boot has many properties and these properties can be specified in application.properties file of our project.

These properties have default values and you can set that inside the properties file.

Spring Boot Properties are used to change specific values like:

  • server-port number
  • database connection configuration etc.

7) Explain the term 'thymeleaf' and How to use it?


thymeleaf is a server side Java template engine used for web application.

The main goal of this engine is to bring natural templates for spring boot web applications.

It can be easily integrated with the Spring Framework.

thymeleaf is ideally used for HTMl 5 applications.

8) Explain @RestController annotation?


It is a stereotype annotation.

This annotation automatically and implicitly adds the Controller and @ResponseBody annotations to the annotated class.

This annotation is available under package — org.springframework.web.bind.annotation.

In order to use it, we need to import it into our class.

9) Explain Spring Vs Spring Boot?


Spring is a java based web application framework.
This framework provides many tools and libraries.
It can be used to create a complete customized web application.

However, Spring Boot is a sub module of Spring framework. We can say its built upon Spring framework.
It is basically used to creating ready to run applications.
It also has additional features and it requires very less configurations.

10) Explain @RequestMapping annotation in Spring Boot?


This annotation is used for providing routing information to the application.

@RequestMapping annotation tells the Spring framework that which HTTP request should map to which method.

This annotation is available under package — org.springframework.web.annotation.

In order to use it, we need to import it into our class.

11) Explain Spring Data?


Spring Data is used for making the use of relational and non-relational databases in applications very easy.

It also helps in cloud-based data service and other data access technologies as well.

It basically ease the accessing of data while retaining the data in its original form.

Thanks for Reading!
Tags:
Hubs:
You can’t comment this publication because its author is not yet a full member of the community. You will be able to contact the author only after he or she has been invited by someone in the community. Until then, author’s username will be hidden by an alias.