Spring Boot Setup — Concept Check
Questions on Spring Boot Setup. Spring Boot eliminates boilerplate setup through auto-configuration and starter dependencies. A production-ready app can be running in under 5 minutes with the right project structure.
Questions in this quiz
8 questions on Spring Boot Setup — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer adds a new dependency to the pom.xml but forgets to specify its version. What will happen?
- AThe build will fail due to missing version.
- BMaven will automatically fetch the latest version.
- CThe dependency will use a default version from spring-boot-dependencies BOM.
- DThe application will crash at runtime.
2.You have a Spring Boot application with @SpringBootApplication in a sub-package. What must you do to ensure all components are scanned?
- AMove @SpringBootApplication to the root package.
- BUse XML configuration to specify package scanning.
- CAdd a @ComponentScan annotation with basePackages.
- DNo action needed; Spring Boot scans all packages by default.
3.A developer wants to switch from Maven to Gradle for a Spring Boot project. What is a key consideration?
- AGradle requires manual version management for dependencies.
- BGradle can also use Spring Initializr for project setup.
- CGradle does not support Spring Boot starter dependencies.
- DGradle builds are inherently slower than Maven builds.
4.In a Spring Boot project, you notice that the application is not picking up the application-prod.yml configuration. What might be the issue?
- AThe application is not running in production mode.
- BThe file is not in the resources directory.
- CSpring Boot does not support YAML files.
- DThe YAML file is incorrectly formatted.
5.A developer adds spring-boot-starter-data-jpa to the project. What components are automatically configured?
- ANone, manual configuration is needed
- BOnly Hibernate
- CSpring Data JPA only
- DHibernate and Spring Data JPA
6.What is the role of the spring-boot-maven-plugin in a Spring Boot application?
- ATo build an executable JAR
- BTo manage dependency versions
- CTo initialize the application context
- DTo configure the classpath
7.A developer sees that Tomcat is not starting in a Spring Boot application. What could be a reason?
- AThe application.yml file is missing.
- BThe project is using Gradle instead of Maven.
- CThe main class is not annotated with @SpringBootApplication.
- Dspring-boot-starter-web is missing from dependencies.
8.Which file in a Spring Boot project is responsible for managing dependency versions?
- Aapplication.yml
- Bpom.xml
- Cspring-boot-dependencies BOM
- Dspring-boot-starter-parent