Spring Boot Introduction — Concept Check
Questions on Spring Boot Introduction. Spring Boot is an opinionated framework that eliminates boilerplate Spring configuration through auto-configuration, embedded servers, and production-ready defaults.
Questions in this quiz
8 questions on Spring Boot Introduction — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.You have a Spring Boot application with `spring-boot-starter-web` on the classpath. What is automatically configured?
- ADispatcherServlet and Jackson
- BOnly DispatcherServlet
- CNeither DispatcherServlet nor Jackson
- DOnly Jackson
2.A developer runs `java -jar app.jar --debug`. What should they expect to see?
- AA CONDITIONS EVALUATION REPORT
- BA list of all application beans
- CA stack trace of all exceptions
- DOnly error logs
3.You override the `DataSource` bean in your Spring Boot application. What happens to the auto-configured `DataSource`?
- AIt is ignored but still loaded
- BIt is not used due to @ConditionalOnMissingBean
- CIt is used alongside the custom bean
- DIt causes a bean conflict error
4.A new developer believes deploying a WAR file is necessary for Spring Boot apps. What is the correct approach?
- AUse a WAR with embedded Jetty
- BPackage as a JAR with embedded server
- CDeploy a WAR to an external Tomcat
- DDeploy a JAR to an external server
5.What is the purpose of the `@SpringBootApplication` annotation in a Spring Boot application?
- AOnly scans for components
- BOnly configures the application context
- COnly enables auto-configuration
- DCombines @Configuration, @EnableAutoConfiguration, and @ComponentScan
6.A developer sets `spring.profiles.active=prod` in `application.properties`. Which file overrides the base configuration?
- Aapplication-dev.yml
- Bapplication-prod.yml
- Capplication.yml
- Dapplication.properties
7.How can you check which auto-configurations are applied in a Spring Boot application without modifying the code?
- AUse the Actuator endpoint GET /actuator/conditions
- BInspect the JAR manifest
- CCheck the application.properties file
- DReview the Maven POM file
8.What happens if you run `java -jar app.jar --server.port=9090`?
- AThe server ignores the port and uses 8080
- BThe server starts on a random port
- CThe server starts on port 9090
- DThe application fails to start