0
0
Microservicessystem_design~20 mins

Environment-based configuration in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Environment Config Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why use environment-based configuration in microservices?

In a microservices system, why is environment-based configuration important?

AIt removes the need for any configuration management tools.
BIt allows each microservice to have different settings for development, testing, and production without changing code.
CIt forces all microservices to share the same configuration regardless of environment.
DIt makes microservices slower because they must read config files every time they run.
Attempts:
2 left
💡 Hint

Think about how settings like database URLs or API keys change between environments.

Architecture
intermediate
2:00remaining
Best practice for storing environment configs in microservices

Which approach is best for storing environment-specific configuration in a microservices architecture?

AHardcode all configs inside the microservice source code for consistency.
BKeep configs in a shared database that all microservices query on every request.
CStore configs in environment variables injected into each service container at runtime.
DUse local config files inside each microservice image that never change.
Attempts:
2 left
💡 Hint

Consider security, flexibility, and ease of updates without rebuilding images.

scaling
advanced
2:30remaining
Scaling environment configuration management for many microservices

You have 50 microservices deployed across multiple environments. What is the best way to manage environment-based configuration at scale?

AStore configs in a shared file system accessed by all microservices.
BManually update environment variables on each microservice host for every environment.
CEmbed all configs inside each microservice image to avoid external dependencies.
DUse a centralized configuration service that microservices query at startup or on config change events.
Attempts:
2 left
💡 Hint

Think about automation, consistency, and reducing manual errors.

tradeoff
advanced
2:00remaining
Tradeoff of using environment variables vs config files in microservices

What is a key tradeoff when choosing environment variables over config files for environment-based configuration in microservices?

AEnvironment variables are easier to inject but harder to version control compared to config files.
BConfig files are always more secure than environment variables.
CEnvironment variables require rebuilding the microservice image for every change.
DConfig files cannot be encrypted while environment variables can.
Attempts:
2 left
💡 Hint

Consider how changes are tracked and managed in source control.

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

You have 100 microservices deployed in production. You plan to update a shared environment variable used by 60 of them. How many microservices will need to be restarted or reloaded to apply the new config?

A60 microservices need restart or reload to pick up the new environment variable.
BAll 100 microservices need restart because environment variables are global.
CNone need restart because environment variables update automatically at runtime.
DOnly 1 microservice needs restart since it can broadcast the change.
Attempts:
2 left
💡 Hint

Think about how environment variables are loaded by processes.