0
0
Spring Bootframework~20 mins

application.yml alternative in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Spring Boot Config Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Alternative to application.yml for configuration in Spring Boot
Which file can be used as a direct alternative to application.yml for defining configuration properties in Spring Boot?
Asettings.json
Bconfig.xml
Capplication.properties
Dconfig.yaml
Attempts:
2 left
💡 Hint
Think about the default property file format supported by Spring Boot besides YAML.
component_behavior
intermediate
1:30remaining
Behavior difference between application.yml and application.properties
What is a key difference in how Spring Boot processes application.yml compared to application.properties?
AYAML supports hierarchical data structures natively, properties file uses dot notation for nesting
BYAML files are ignored if properties file exists
CProperties file supports lists natively, YAML does not
DProperties files require explicit type declarations, YAML does not
Attempts:
2 left
💡 Hint
Consider how nested configuration is represented in each format.
📝 Syntax
advanced
2:00remaining
Correct syntax for list in application.properties
How do you define a list of values for a property named app.servers in application.properties?
Aapp.servers=server1,server2,server3
Bapp.servers=[server1, server2, server3]
C
app.servers:
  - server1
  - server2
  - server3
Dapp.servers=server1;server2;server3
Attempts:
2 left
💡 Hint
Think about how lists are represented in properties files.
🔧 Debug
advanced
2:00remaining
Why does Spring Boot ignore my application.properties file?
You have both application.yml and application.properties in your Spring Boot project. You update application.properties but changes are not reflected at runtime. What is the most likely reason?
Aapplication.properties must be renamed to config.properties to be recognized
BSpring Boot gives priority to application.yml over application.properties by default
Capplication.properties is only loaded if application.yml is missing
DSpring Boot requires a command line flag to enable properties file loading
Attempts:
2 left
💡 Hint
Consider the order in which Spring Boot loads configuration files.
state_output
expert
2:30remaining
Resulting property value with multiple config files
Given these files in a Spring Boot project:

application.yml:
server:
port: 8080

application.properties:
server.port=9090

What port will the embedded server run on?
AApplication fails to start due to conflicting configs
B9090
CDefault port 8080 is used ignoring both files
D8080
Attempts:
2 left
💡 Hint
Remember the precedence rules of Spring Boot configuration files.