Styntax Error

1. What is Spring Boot ?

Sprint boot is a Java-based spring framework used for Rapid Application Development (to build stand-alone microservices).It simplifies the setup and development process by providing defaults and opinions out of the box. It has extra support of auto-configuration and embedded application servers like tomcat, jetty, etc.

2. What are the advantages and main features of Spring Boot ?

It is easy to understand and develop spring applications.
Spring Boot is nothing but an existing framework with the addition of an embedded HTTP server and annotation configuration which makes it easier to understand and faster the process of development.
Increases productivity and reduces development time.
Minimum configuration.
We don’t need to write any XML configuration, only a few annotations are required to do the configuration.
Key features of Spring Boot:
Auto-configuration: Automatically configures Spring application based on the dependencies you add.
Standalone: Create standalone Spring applications without needing a separate web server.
Opinionated Defaults: Provides default configurations to reduce development time.
Embedded Server: Includes embedded servers like Tomcat and Jetty etc.
Production Ready: Provides metrics, health checks, and externalized configuration.

3. How does Spring Boot simplify development?

Spring Boot simplifies development by,
Providing pre-configured templates
Reducing boilerplate code
Auto-configuring the application based on the dependencies
Including an embedded server
All these things make it easier to run applications.

4. What are key components of Spring Boot ?

Spring Boot auto-configuration.
Spring Boot CLI.
Spring Boot starter POMs.
Spring Boot Actuators

5. What is Spring Boot Starter ?

A Spring Boot Starter is a set of convenient dependency descriptors you can include in your application. For example, spring-boot-starter-web includes all the dependencies needed to create a web application.

6. Why Spring Boot over Spring ?

There are some points which spring boot offers but spring does not:
Starter POM.
Version Management
Auto Configuration
Component Scanning
Embedded server
InMemory DB
Actuators

7. What is the starter dependency of the Spring boot module ?

Spring boot provides numbers of starter dependency, here are the most commonly used
Data JPA starter.
Test Starter.
Security starter.
Web starter.
Mail starter.
Thymeleaf starter.

8. How does Spring Boot works ?

Spring Boot automatically configures your application based on the dependencies you have added to the project by using annotation. The entry point of the spring boot application is the class that contains @SpringBootApplication annotation and the main method.
Spring Boot automatically scans all the components included in the project by using @ComponentScan annotation.

9. What is Spring Boot’s role in Microservices ?

Spring Boot makes it easier to develop and deploy microservices by providing embedded servers and simplifying configuration with properties. Additionally, it integrates well with Spring Cloud for service discovery, load balancing, and distributed configuration.

10. What does the @SpringBootApplication annotation do internally ?

The @SpringBootApplication annotation is a convenience annotation that combines @Configuration, @EnableAutoConfiguration, and @ComponentScan with their default attributes. Spring Boot enables the developer to use a single annotation instead of using multiple. It marks the main class of a Spring Boot application. But, as we know, Spring provided loosely coupled features that we can use for each annotation as per our project needs.

11. What is the purpose of using @ComponentScan in the class files ?

Spring Boot application scans all the beans and package declarations when the application initializes. You need to add the @ComponentScan annotation for your class file to scan your components added to your project.

12. How does a spring boot application get started ?

Just like any other Java program, a Spring Boot application must have a main method. This method serves as an entry point, which invokes the SpringApplication run method to bootstrap the application.

13. How do you integrate Kafka with Spring Boot ?

To integrate Kafka with Spring Boot, you can use the spring-kafka dependency. Then, configure Kafka properties in application.properties and use @KafkaListener to listen to Kafka topics.

14. What is Dependency Injection in Spring Boot ?

Dependency Injection is a design pattern used to implement IoC (Inversion of Control). It allows the creation of dependent objects outside of a class and provides those objects to a class in various ways (constructor, setter method, or field injection).