0
0
Spring Bootframework~20 mins

Project structure walkthrough in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Spring Boot Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the purpose of the 'src/main/resources' folder in a Spring Boot project?
In a typical Spring Boot project, what kind of files do you place inside the 'src/main/resources' folder?
AJava source code files that contain the main application logic.
BTest source code files for unit and integration tests.
CConfiguration files, static assets, and templates used by the application.
DCompiled class files generated after building the project.
Attempts:
2 left
💡 Hint

Think about where you keep files like application.properties or HTML templates.

component_behavior
intermediate
2:00remaining
What happens if you place a Java class outside 'src/main/java' in a Spring Boot project?
Consider a Java class placed in 'src/test/java' instead of 'src/main/java'. What is the effect on the Spring Boot application?
AThe class will only be compiled and used during testing, not in the main application runtime.
BThe class will be included in the main application build and run normally.
CThe class will cause a build failure due to incorrect folder placement.
DThe class will be ignored completely and not compiled or used anywhere.
Attempts:
2 left
💡 Hint

Think about the difference between main and test source folders.

📝 Syntax
advanced
2:00remaining
Which folder should you place your Spring Boot controller classes in for proper component scanning?
Given a Spring Boot project with base package 'com.example.app', where should controller classes be placed to be detected automatically?
Acom.example.app.services inside 'src/main/resources'
Bcom.example.controllers outside the base package
Ccom.example.app.controllers inside 'src/test/java'
Dcom.example.app.controllers inside 'src/main/java'
Attempts:
2 left
💡 Hint

Controllers must be inside the base package or its subpackages.

🔧 Debug
advanced
2:00remaining
Why does Spring Boot fail to find your application.properties file?
You placed your application.properties file in 'src/main/java' instead of 'src/main/resources'. What will happen when you run the app?
AThe application will crash with a FileNotFoundException.
BSpring Boot will fail to load the properties file because it only looks in 'src/main/resources'.
CThe application.properties file will be ignored but no error will occur.
DSpring Boot will load the properties file without any issues.
Attempts:
2 left
💡 Hint

Where does Spring Boot expect configuration files to be?

lifecycle
expert
2:00remaining
What is the role of the 'META-INF' folder inside 'src/main/resources' in a Spring Boot project?
You find a 'META-INF' folder inside 'src/main/resources'. What is its typical purpose in a Spring Boot application?
AIt holds metadata files like 'MANIFEST.MF' that describe the packaged jar.
BIt stores static web assets like CSS and JavaScript files.
CIt contains compiled Java bytecode for the application.
DIt contains test reports generated after running tests.
Attempts:
2 left
💡 Hint

Think about what metadata about the jar or application might be stored.