Bird
Raised Fist0
Microservicessystem_design~20 mins

Config server pattern in Microservices - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Config Server Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary benefit of using a Config Server in microservices?

Consider a system with multiple microservices. What is the main advantage of introducing a Config Server pattern?

ACentralizes configuration management, allowing dynamic updates without redeploying services.
BImproves database query performance by caching configuration data locally.
CAutomatically scales microservices based on configuration changes.
DEncrypts all network traffic between microservices to enhance security.
Attempts:
2 left
💡 Hint

Think about how configuration changes are managed across many services.

Architecture
intermediate
1:30remaining
Which component is essential in a Config Server architecture to notify microservices of configuration changes?

In a Config Server pattern, how do microservices learn about configuration updates without polling continuously?

AA database trigger that updates service code automatically.
BA load balancer that redirects traffic to updated services.
CA message broker or event bus that pushes change notifications to services.
DA firewall that blocks outdated configuration requests.
Attempts:
2 left
💡 Hint

Think about how systems communicate asynchronously to inform about changes.

scaling
advanced
2:00remaining
How does a Config Server pattern help scale microservices efficiently?

When the number of microservices grows rapidly, what role does the Config Server play in scaling configuration management?

AIt reduces configuration duplication by serving a single source of truth, minimizing overhead during scaling.
BIt automatically provisions new microservices with default configurations without human intervention.
CIt caches all configurations locally on each microservice to avoid network calls entirely.
DIt replaces the need for service discovery by embedding configuration in DNS records.
Attempts:
2 left
💡 Hint

Consider how managing many copies of configuration can become inefficient.

tradeoff
advanced
2:00remaining
What is a potential drawback of using a Config Server pattern in microservices?

While Config Server centralizes configuration, what is a common tradeoff or risk introduced by this pattern?

AIt forces all microservices to use the same programming language.
BIt creates a single point of failure if the Config Server is not highly available.
CIt requires each microservice to maintain its own local configuration copy permanently.
DIt eliminates the need for environment-specific configurations.
Attempts:
2 left
💡 Hint

Think about what happens if the central configuration source becomes unreachable.

estimation
expert
2:30remaining
Estimate the approximate number of configuration requests per minute to a Config Server in a system with 500 microservices, each refreshing config every 5 minutes.

Assuming each of the 500 microservices requests configuration from the Config Server exactly once every 5 minutes, how many requests per minute does the Config Server handle?

A2500 requests per minute
B50 requests per minute
C500 requests per minute
D100 requests per minute
Attempts:
2 left
💡 Hint

Calculate total requests per 5 minutes, then divide by 5 to get per minute.

Practice

(1/5)
1. What is the main purpose of the Config Server Pattern in microservices architecture?
easy
A. To manage database connections for microservices
B. To centralize configuration management for multiple microservices
C. To handle user authentication and authorization
D. To balance load between microservices

Solution

  1. Step 1: Understand the role of configuration in microservices

    Each microservice needs configuration settings like URLs, credentials, and feature flags.
  2. Step 2: Identify what the Config Server Pattern provides

    The pattern centralizes these settings in one place, so all microservices can fetch consistent configs.
  3. Final Answer:

    To centralize configuration management for multiple microservices -> Option B
  4. Quick Check:

    Config Server Pattern = Centralized config [OK]
Hint: Config Server centralizes configs, not user or load tasks [OK]
Common Mistakes:
  • Confusing config management with authentication
  • Thinking it manages database connections
  • Assuming it balances load
2. Which of the following is the correct way for a microservice to fetch configuration from a Config Server?
easy
A. Microservice sends HTTP requests to Config Server to get configs
B. Microservice reads local config files only
C. Microservice uses database queries to fetch configs
D. Microservice uses message queues to receive configs

Solution

  1. Step 1: Identify communication method with Config Server

    Config Server usually exposes REST APIs for microservices to request configs.
  2. Step 2: Match options with typical Config Server usage

    HTTP requests are the standard way; local files, DB queries, or message queues are not typical for config fetching.
  3. Final Answer:

    Microservice sends HTTP requests to Config Server to get configs -> Option A
  4. Quick Check:

    Config Server uses HTTP requests [OK]
Hint: Config Server serves configs via HTTP, not local files or DB [OK]
Common Mistakes:
  • Assuming configs come from local files only
  • Thinking configs are fetched via database queries
  • Confusing message queues with config delivery
3. Consider this simplified flow:
1. Microservice starts
2. Requests config from Config Server
3. Config Server returns config
4. Microservice uses config to connect to DB

What happens if the Config Server is down when the microservice starts?
medium
A. Microservice connects to DB without any config
B. Microservice automatically generates default config and continues
C. Microservice uses cached config or fails to start if none available
D. Microservice waits indefinitely for Config Server to respond

Solution

  1. Step 1: Understand Config Server availability impact

    If Config Server is down, microservice cannot fetch fresh config at startup.
  2. Step 2: Consider typical microservice behavior

    Most microservices cache last known config or fail to start if no config is available.
  3. Final Answer:

    Microservice uses cached config or fails to start if none available -> Option C
  4. Quick Check:

    Config Server down = use cache or fail [OK]
Hint: Microservices rely on cached config if Config Server is unreachable [OK]
Common Mistakes:
  • Assuming microservice generates default config automatically
  • Thinking microservice connects without config
  • Believing microservice waits forever
4. A developer notices that after updating configuration in the Config Server, microservices do not reflect changes immediately. What is the most likely cause?
medium
A. Microservices cache old config and need refresh or restart
B. Config Server failed to save the new config
C. Microservices do not support external config fetching
D. Network issues prevent microservices from reaching Config Server

Solution

  1. Step 1: Analyze why config changes are not reflected

    Microservices often cache configs to avoid frequent calls to Config Server.
  2. Step 2: Identify common cause for stale configs

    Without refresh or restart, microservices keep using cached old configs.
  3. Final Answer:

    Microservices cache old config and need refresh or restart -> Option A
  4. Quick Check:

    Config changes need refresh to apply [OK]
Hint: Config changes require microservice refresh to apply [OK]
Common Mistakes:
  • Assuming Config Server did not save changes
  • Thinking microservices ignore external configs
  • Blaming network without checking cache
5. You are designing a Config Server for a large microservices system with hundreds of services. Which approach best ensures scalability and security?
hard
A. Embed configs inside each microservice and update by redeploying services
B. Use a single database table for all configs without encryption
C. Store configs in a public Git repository without access control
D. Use a centralized Config Server with versioned configs, secure access, and caching at clients

Solution

  1. Step 1: Consider scalability needs

    Centralized Config Server with versioning and caching reduces load and supports many services efficiently.
  2. Step 2: Consider security best practices

    Secure access and encryption protect sensitive configs; public repos or unencrypted DB tables are unsafe.
  3. Final Answer:

    Use a centralized Config Server with versioned configs, secure access, and caching at clients -> Option D
  4. Quick Check:

    Scalable & secure config = centralized + versioning + security [OK]
Hint: Centralize configs with security and caching for scale [OK]
Common Mistakes:
  • Embedding configs in services causes redeploy overhead
  • Using public repos exposes sensitive data
  • Storing unencrypted configs risks security breaches