0
0
Microservicessystem_design~20 mins

High cohesion in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
High Cohesion Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is high cohesion important in microservices?

In microservices architecture, why do we aim for high cohesion within each service?

AIt allows services to share databases easily, reducing data duplication.
BIt makes each service responsible for a single, well-defined task, improving maintainability and scalability.
CIt forces all services to depend on each other, increasing integration complexity.
DIt reduces the number of services by combining unrelated functionalities.
Attempts:
2 left
💡 Hint

Think about how grouping related tasks affects service clarity and updates.

Architecture
intermediate
2:00remaining
Identifying high cohesion in microservice design

Which of the following microservice designs shows the highest cohesion?

AA service that manages orders and also sends marketing emails.
BA service that handles user authentication, payment processing, and product catalog updates.
CA service dedicated only to managing user profiles and preferences.
DA service that handles inventory updates and customer support tickets.
Attempts:
2 left
💡 Hint

Look for the service that groups closely related responsibilities.

scaling
advanced
2:30remaining
Impact of high cohesion on microservice scaling

How does high cohesion in microservices affect the ability to scale the system?

AIt allows scaling only the entire system together, increasing resource use.
BIt prevents scaling because services are too tightly coupled internally.
CIt requires scaling all services simultaneously to maintain consistency.
DIt enables scaling individual services independently based on their specific load.
Attempts:
2 left
💡 Hint

Think about how focused responsibilities affect resource allocation.

tradeoff
advanced
2:30remaining
Tradeoffs of enforcing very high cohesion in microservices

What is a potential downside of enforcing very high cohesion in microservices?

AIt can lead to too many small services, increasing deployment and management overhead.
BIt causes services to share too much data, risking data corruption.
CIt forces unrelated functionalities into one service, reducing clarity.
DIt eliminates the need for service communication, reducing flexibility.
Attempts:
2 left
💡 Hint

Consider what happens if you split responsibilities too finely.

component
expert
3:00remaining
Designing a highly cohesive microservice for an e-commerce platform

You need to design a microservice for an e-commerce platform that handles product inventory. Which set of responsibilities best ensures high cohesion?

AManaging product stock levels, updating inventory after sales, and handling supplier restock requests.
BProcessing customer payments, sending marketing emails, and managing product stock levels.
CHandling supplier restock requests, managing user reviews, and updating product descriptions.
DManaging product stock levels, processing customer payments, and sending order confirmation emails.
Attempts:
2 left
💡 Hint

Focus on grouping tasks that relate directly to inventory management.