Q1
Q1 What is the primary feature of Spring Boot?
Simplifies data access
Automates code generation
Simplifies project setup
Enhances UI design
Q2
Q2 Which build tool is used by Spring Boot?
Maven
Ant
Gradle
CMake
Q3
Q3 What does the @SpringBootApplication annotation do?
Enables JDBC
Configures a web application
Declares a configuration class
Starts a Spring context
Q4
Q4 How does Spring Boot handle configuration?
Through YAML files
Through properties files
Through XML files
Manually via code
Q5
Q5 What embedded servers does Spring Boot support?
Jetty
Tomcat
Undertow
Netty
Q6
Q6 Which module of Spring Framework is the foundation for Spring Boot?
Spring MVC
Spring Core
Spring AOP
Spring ORM
Q7
Q7 Spring Boot is best suited for creating what type of applications?
Batch applications
Web applications
Enterprise applications
Desktop applications
Q8
Q8 What is the advantage of the Spring Boot Actuator?
Managing app profiles
Enhancing app security
Monitoring and managing app
Application logging
Q9
Q9 How can you externalize configuration in a Spring Boot application?
Using Java files
Using environment variables
Using XML files
Using property files
Q10
Q10 What role does Spring Boot DevTools play?
Improving build speed
Automatic restart
Code generation
Dependency management
Q11
Q11 What annotation is used to define a Spring Boot application’s main class?
@SpringApplication
@EnableAutoConfiguration
@SpringBootConfiguration
@SpringBootApplication
Q12
Q12 If a Spring Boot application fails to start due to a port conflict,
what is the typical solution?
Change the port in the properties file
Reinstall Spring Boot
Update Spring dependencies
Change the server
Q13
Q13 What is the purpose of the application.properties file in a Spring Boot application?
To configure the application's properties
To store application resources
To manage external dependencies
None of the above
Q14
Q14 How does Spring Boot allow overriding default configurations?
Using external properties files
Using command-line arguments
Using environment variables
All of the above
Q15
Q15 Which annotation is used to specify the location of the application.properties file in a Spring Boot application?
@PropertySource
@ConfigurationProperties
@Value
@SpringBootApplication
Q16
Q16 What is the purpose of the @ConfigurationProperties annotation in a Spring Boot application?
To map properties from external sources to JavaBean properties
To enable Spring's auto-configuration
To define application-specific properties
None of the above
Q17
Q17 How can you specify a custom location for the application.properties file in a Spring Boot application?
Using the spring.config.location property
Using the @PropertySource annotation
Using the @ConfigurationProperties annotation
Using the @Value annotation
Q18
Q18 What is the purpose of the @ConditionalOnProperty annotation in Spring Boot?
To conditionally enable or disable beans based on the presence or value of a property
To specify the order in which beans are initialized
To define properties for conditional auto-configuration
None of the above
Q19
Q19 How can you access a property from the application.properties file in a Spring Boot application?
Using the @Value annotation
Using the Environment object
Using the @PropertySource annotation
Using the @ConfigurationProperties annotation
Q20
Q20 How can you define a custom configuration property class in Spring Boot?
By creating a Java class and annotating it with @ConfigurationProperties
By creating a Java interface and implementing the PropertySource interface
By using the @Configuration annotation
By using the @Value annotation
Q21
Q21 How can you load additional application properties from an external YAML file in a Spring Boot application?
By using the @PropertySource annotation with the value attribute set to the YAML file path
By using the @Value annotation with the YAML file path
By using the @ConfigurationProperties annotation with the YAML file path
By using the @ImportResource annotation with the YAML file path
Q22
Q22 If a Spring Boot application fails to start due to a missing property in the application.properties file,
what is the solution?
Add the missing property to the application.properties file
Restart the application
Reinstall Spring Boot
None of the above
Q23
Q23 What should you check first if changes to application.properties are not reflecting in your Spring Boot application?
The file is located in the correct directory
The properties are correctly named
The application is restarted after changes
The file has the correct file permissions
Q24
Q24 What is a common cause of a Spring Boot configuration issue where a specific bean is not being injected as expected?
Incorrect bean definition in the context
Conditional annotations blocking bean creation
Incorrect profile settings activated
Missing component scanning configuration
Q25
Q25 Which annotation is primarily used for building RESTful web services in Spring Boot?
@RestController
@Controller
@Repository
@Service
Q26
Q26 What is the purpose of the @PathVariable annotation in Spring Boot?
To extract values from the URI
To inject query parameters into method parameters
To manage session attributes
To handle form submissions
Q27
Q27 How can you specify a request body in a Spring Boot REST controller method?
Using @RequestBody
Using @RequestHeader
Using @RequestParam
Using @ModelAttribute
Q28
Q28 In REST API design, what HTTP method is most commonly used to update resources?
GET
POST
PUT
DELETE
Q29
Q29 What feature of Spring Boot simplifies the addition of links to RESTful services dynamically?
Spring HATEOAS
Spring Data REST
Spring Web MVC
Spring Cloud
Q30
Q30 Which annotation configures the base URI for a controller in a Spring Boot REST API?
@RequestMapping
@BaseMapping
@WebServlet
@BasePath