ADP Important Questions and Answers
ADP Important Questions and Answers
1:- Advantages of Spring Boot: Spring Boot simplifies development with embedded
servers, auto-configuration, reduced boilerplate code, and production-ready features
like metrics and monitoring.
3:- Difference between loosely coupled and tightly coupled system: Loosely
coupled systems allow components to operate independently and be replaced without
significant changes, while tightly coupled systems have interdependent components
that require simultaneous changes.
5:- List the tools required to develop Spring Boot applications: Required tools
include IDE (IntelliJ IDEA, Eclipse), Maven/Gradle, JDK, and optionally, Docker,
Postman, and a version control system like Git.
6:- Define Maven and explain its advantages: Maven is a build automation tool for
Java projects that manages dependencies, builds, and provides project management
tools.
7:- Define Spring Initializr and list its steps to create a Spring Boot application:
Spring Initializr is a web-based tool to create Spring Boot projects. Steps include
selecting project settings (language, dependencies, etc.) and generating a project.
8:- What do you mean by minimal value production?: This could mean delivering a
minimum viable product (MVP) or a basic functional application that provides value to
users early on.
9:- Define Spring Boot Starter: Spring Boot Starters are dependency descriptors that
bundle commonly used libraries for specific functionalities, such as
spring-boot-starter-web for web applications.
10:- Spring Boot Starter Web, Spring Boot Starter JPA, and Spring Boot Starter
Actuator: These starters add dependencies for web (REST), JPA (database), and
actuator (monitoring) functionalities, respectively.
14:- How to change the port number of an embedded server in Spring Boot: Set
server.port in application.properties (e.g., server.port=8081).
17:- Why field injection is discouraged?: Field injection can make testing and
maintaining code more difficult, as dependencies are not injected through constructors,
making them less visible and harder to mock.
19:- Define lazy initialization & how it affects the bean initialization: Lazy
initialization delays the creation of beans until they are first needed, reducing startup
time.
20:- Suitable example of the use of autowired annotation to inject dependency:
@Autowired can be used to inject a service, like @Autowired private UserService
userService;, to use within a controller.
21:- Explain with a suitable diagram, bean life cycle: The Spring Bean lifecycle
involves instantiation, dependency injection, initialization, post-processing, and
destruction.
23:- Briefly explain Spring Boot entry class: The entry class contains the main
method annotated with @SpringBootApplication and is the starting point for Spring Boot
applications.
25:- Difference between Spring boot framework and Spring framework: The Spring
Framework is a comprehensive framework for Java applications, offering extensive
configurations. Spring Boot builds on Spring, simplifying development by providing
pre-configured setups, embedded servers, and reduced boilerplate, enabling faster
deployment of Spring-based applications.
26. Discuss the importance of pom.xml file: The pom.xml file in Maven projects is
crucial as it manages dependencies, configurations, and plugins. It ensures build
automation, specifies project metadata, and resolves library conflicts, streamlining
project setup and maintenance in Java development.