0
0
Microservicessystem_design~20 mins

Service discovery concept in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Service Discovery Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary role of service discovery in microservices?

In a microservices architecture, what is the main purpose of service discovery?

ATo manage user authentication and authorization
BTo store user data securely in a database
CTo monitor the health of a single service only
DTo enable services to find and communicate with each other dynamically without hardcoding addresses
Attempts:
2 left
💡 Hint

Think about how services know where to send requests when their locations can change.

Architecture
intermediate
1:30remaining
Which component typically acts as the service registry in service discovery?

In a microservices system, which component is responsible for keeping track of all available service instances?

AService registry
BAPI gateway
CDatabase
DLoad balancer
Attempts:
2 left
💡 Hint

This component holds the list of active services and their locations.

scaling
advanced
2:00remaining
How does service discovery help when scaling microservices horizontally?

When multiple instances of a microservice are added to handle more load, how does service discovery assist?

AIt requires manual configuration of each new instance's address
BIt duplicates the database to match the number of instances
CIt automatically updates the registry with new instances so clients can find them without manual changes
DIt disables older instances to avoid conflicts
Attempts:
2 left
💡 Hint

Think about how new service instances become discoverable without manual intervention.

tradeoff
advanced
2:00remaining
What is a tradeoff of using client-side service discovery compared to server-side?

Client-side and server-side service discovery are two common patterns. What is a key tradeoff when using client-side discovery?

AClients handle more complexity but reduce load on central components
BClients have less control over routing decisions
CIt requires no service registry at all
DIt eliminates the need for load balancing
Attempts:
2 left
💡 Hint

Consider who manages the discovery logic and the impact on system components.

estimation
expert
2:30remaining
Estimate the number of service registry updates per minute in a system with 100 microservice instances, each registering every 30 seconds.

Assuming each of the 100 microservice instances sends a heartbeat or registration update every 30 seconds, how many updates does the service registry receive per minute?

A100 updates per minute
B200 updates per minute
C50 updates per minute
D300 updates per minute
Attempts:
2 left
💡 Hint

Calculate how many updates each instance sends per minute and multiply by the number of instances.