0
0
Microservicessystem_design~20 mins

Environment configuration in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
πŸŽ–οΈ
Environment Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why use environment variables in microservices?

In a microservices system, why is it best practice to use environment variables for configuration?

AThey allow each service to have different settings without changing code.
BThey force all services to share the same configuration values.
CThey automatically encrypt sensitive data without extra setup.
DThey make the code run faster by caching configuration.
Attempts:
2 left
πŸ’‘ Hint

Think about how you can change settings without touching the code.

❓ Architecture
intermediate
2:00remaining
Centralized configuration management in microservices

Which architecture best supports managing environment configurations centrally for many microservices?

AUse a centralized config server that microservices query at startup or runtime.
BEach microservice reads its own local config file stored inside its container.
CHardcode all configuration values in the microservices source code.
DStore configuration in a shared database that microservices update frequently.
Attempts:
2 left
πŸ’‘ Hint

Think about a single place to update configs that all services can access.

❓ scaling
advanced
2:30remaining
Scaling environment configuration for hundreds of microservices

You have hundreds of microservices deployed across multiple environments (dev, staging, prod). What is the best approach to scale environment configuration management?

AStore all environment variables in each service’s container image to avoid external dependencies.
BUse a hierarchical configuration system with environment-specific overrides and a centralized config store.
CManually update environment variables on each server hosting the microservices.
DUse a single flat configuration file shared by all microservices regardless of environment.
Attempts:
2 left
πŸ’‘ Hint

Consider how to manage differences between environments and many services efficiently.

❓ tradeoff
advanced
2:00remaining
Tradeoffs of storing secrets in environment variables

What is a key tradeoff when storing sensitive secrets (like API keys) in environment variables for microservices?

AThey automatically rotate secrets without manual intervention.
BEnvironment variables are encrypted by default, so no extra security is needed.
CThey cannot be changed without rebuilding the microservice container image.
DThey are easy to use but can be exposed if the host system is compromised or logs environment data.
Attempts:
2 left
πŸ’‘ Hint

Think about what happens if someone gains access to the server or logs.

❓ estimation
expert
3:00remaining
Estimating configuration update impact in a microservices system

You have 200 microservices using a centralized config server. You plan to update a common environment variable used by 150 services. What is the best estimate of the impact on the system?

AAll services will lose connectivity temporarily during the update.
BAll 200 services will restart automatically to apply the new config immediately.
COnly the 150 services using the variable need to reload or restart to apply the change.
DNo services will be affected until the centralized config server is restarted.
Attempts:
2 left
πŸ’‘ Hint

Consider which services actually use the changed variable and how config updates propagate.