0
0
Expressframework~20 mins

Microservice communication basics in Express - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
๐ŸŽ–๏ธ
Microservice Communication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
๐Ÿง  Conceptual
intermediate
2:00remaining
Understanding synchronous vs asynchronous communication

Which statement correctly describes the difference between synchronous and asynchronous communication in microservices?

ASynchronous communication waits for a response before continuing, while asynchronous communication does not wait and proceeds immediately.
BSynchronous communication never waits for a response, asynchronous always waits for a response.
CAsynchronous communication requires both services to be online at the same time, synchronous does not.
DSynchronous communication uses message queues, asynchronous uses direct HTTP calls.
Attempts:
2 left
๐Ÿ’ก Hint

Think about whether the sender waits for the receiver to reply before moving on.

โ“ Architecture
intermediate
2:00remaining
Choosing communication method for microservices

You have two microservices: one handles user authentication and the other processes payments. Which communication method is best when the payment service must confirm user identity before processing?

AUse synchronous HTTP calls so the payment service waits for authentication response before proceeding.
BUse asynchronous messaging with a message queue to send user identity and wait for confirmation.
CUse asynchronous event broadcasting without waiting for any response.
DUse direct database access by the payment service to check user identity.
Attempts:
2 left
๐Ÿ’ก Hint

Consider if the payment service needs immediate confirmation before continuing.

โ“ scaling
advanced
2:00remaining
Scaling microservices with asynchronous communication

Which benefit does asynchronous communication provide when scaling microservices?

AIt requires all services to be tightly coupled, improving coordination.
BIt forces all services to process requests in a strict order, reducing complexity.
CIt allows services to handle requests independently without waiting, improving throughput and resilience.
DIt eliminates the need for message brokers or queues.
Attempts:
2 left
๐Ÿ’ก Hint

Think about how asynchronous communication affects service independence and load handling.

โ“ tradeoff
advanced
2:00remaining
Tradeoffs of using message queues in microservices

What is a common tradeoff when using message queues for microservice communication?

AGuaranteed real-time responses but no fault tolerance.
BImproved decoupling and reliability but increased complexity and potential message delays.
CNo need for service discovery but requires synchronous calls.
DSimpler architecture but no support for retrying failed messages.
Attempts:
2 left
๐Ÿ’ก Hint

Consider what message queues add and what challenges they introduce.

โ“ estimation
expert
2:00remaining
Estimating message queue capacity for microservices

You expect 10,000 requests per minute between two microservices communicating asynchronously via a message queue. Each message is about 1 KB. What is the minimum required throughput of the message queue in MB per second?

AApproximately 1.67 MB/s
BApproximately 0.017 MB/s
CApproximately 16.7 MB/s
DApproximately 0.17 MB/s
Attempts:
2 left
๐Ÿ’ก Hint

Calculate total KB per minute, convert to MB, then divide by 60 seconds.