Spring boot Flashcards

1
Q

What is the primary purpose of Spring Boot?

A

Simplified Spring application setup.
(Exp.: While Spring Boot can be used in various contexts like microservice development, its chief aim is to streamline the configuration and deployment of Spring applications.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which embedded server does Spring Boot provide by default for web applications?

A

Apache Tomcat
(Exp.: Spring Boot offers an embedded Apache Tomcat server out of the box, allowing web applications to be easily run without external server setups.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What role do “starters” play in Spring Boot?

A

They provide a set of default dependencies for specific tasks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which file format cannot be used to configure properties in Spring Boot?

A

.json

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which annotation activates Spring Boot’s auto-configuration?

A

@SpringBootApplication
(Exp.: The @SpringBootApplication annotation encompasses several annotations, including @EnableAutoConfiguration, which activates Spring Boot’s auto-configuration feature.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does Spring Boot decide whether to autoconfigure a specific feature?

A

Based on classes available in the classpath

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does Actuator in Spring Boot provide?

A

Production-ready features like health checks and metrics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

To externalize Spring Boot’s configuration, where can properties be specified?

A

application.properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the purpose of spring-boot-starter-parent?

A

It provides useful Maven defaults.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you specify a specific port number for your Spring Boot application?

A

By adding server.port= in the application.properties file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the primary advantage of using Spring Boot?

A

Rapid Development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does Spring Boot simplify database configurations?

A

By using conventions for data source URLs and drivers
(Exp.: Spring Boot uses convention over configuration, which means it provides sensible defaults (e.g., default data source URLs and drivers) but allows them to be overridden if needed.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of these is a benefit of using Spring Boot?

A

Reduces boilerplate code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the primary purpose of @SpringBootApplication annotation?

A

A combination of component scanning, autoconfiguration, and Spring Boot’s configuration.
(Exp.: @SpringBootApplication is a convenience annotation that includes @Configuration, @EnableAutoConfiguration, and @ComponentScan.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which annotation is specifically used to indicate that a class provides Bean definitions?

A

@Configuration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the primary function of @Conditional annotation in Spring Boot?

A

To specify that a component should only be configured under specific circumstances

16
Q

Which Spring annotation is used to create RESTful web services using Spring MVC?

A

@RestController

17
Q

Which Spring annotation is used to handle HTTP POST requests?

A

@PostMapping

18
Q

Which starter dependency is used to develop web applications or Restful web services?

A

spring-boot-starter-web

19
Q
A