0
0
Microservicessystem_design~20 mins

gRPC for internal communication in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
gRPC Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why choose gRPC over REST for internal microservice communication?

Consider a system where multiple microservices communicate internally. Which of the following is the main advantage of using gRPC instead of REST for this internal communication?

AgRPC only supports synchronous communication, which simplifies service design.
BgRPC uses HTTP/2 which allows multiplexing multiple requests over a single connection, reducing latency.
CgRPC requires no schema definition, so services can evolve independently without coordination.
DgRPC messages are always human-readable JSON, making debugging easier than REST.
Attempts:
2 left
💡 Hint

Think about how network efficiency and protocol features affect communication speed and resource use.

Architecture
intermediate
2:00remaining
Designing service discovery with gRPC in microservices

You have multiple microservices communicating via gRPC. Which approach best supports dynamic service discovery to handle scaling and failures?

ALet clients broadcast requests to all possible service instances and accept the first response.
BHardcode all service IP addresses in client configurations to avoid runtime lookups.
CUse a centralized service registry where services register their addresses; clients query this registry before making gRPC calls.
DUse DNS round-robin with static IPs for all services without any registry.
Attempts:
2 left
💡 Hint

Think about how services can find each other reliably when instances change dynamically.

scaling
advanced
2:00remaining
Handling high load with gRPC streaming in microservices

Your microservice needs to send a continuous stream of updates to clients using gRPC. What is the best way to handle backpressure and avoid overwhelming clients?

AImplement client-side flow control by using gRPC's built-in flow control mechanisms to regulate message rates.
BSend all updates as fast as possible and rely on clients to buffer messages.
CUse multiple parallel gRPC streams per client to increase throughput without flow control.
DSwitch to REST polling instead of streaming to avoid backpressure issues.
Attempts:
2 left
💡 Hint

Consider how gRPC supports managing message flow between sender and receiver.

tradeoff
advanced
2:00remaining
Tradeoffs of using gRPC with Protocol Buffers vs JSON over HTTP for internal APIs

Which of the following is a correct tradeoff when choosing gRPC with Protocol Buffers over JSON/HTTP for internal APIs?

AgRPC does not support streaming, so JSON/HTTP is better for real-time data.
BgRPC with Protocol Buffers is easier to debug with plain text messages compared to JSON.
CJSON/HTTP APIs are faster than gRPC because JSON parsing is simpler than Protocol Buffers decoding.
DgRPC with Protocol Buffers offers better performance and smaller message size but requires strict schema management.
Attempts:
2 left
💡 Hint

Think about message size, speed, and schema requirements.

estimation
expert
3:00remaining
Estimating capacity for gRPC internal communication in a microservice system

You have 100 microservice instances communicating via gRPC. Each instance sends 50 requests per second to 10 other instances. Each request message is 2KB and response is 3KB. Estimate the total network bandwidth needed for gRPC communication in Mbps.

AApproximately 200 Mbps
BApproximately 80 Mbps
CApproximately 120 Mbps
DApproximately 300 Mbps
Attempts:
2 left
💡 Hint

Calculate total messages per second and multiply by message sizes, then convert bytes to bits and to Mbps.