0
0
Microservicessystem_design~20 mins

Circuit breaker pattern in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Circuit Breaker Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary purpose of the circuit breaker pattern in microservices?

Imagine you have many small services talking to each other. Sometimes one service might be slow or broken. What does the circuit breaker pattern mainly help with?

AIt balances the load evenly across all service instances.
BIt encrypts the communication between microservices for security.
CIt prevents a failing service from being called repeatedly to avoid system overload.
DIt automatically restarts failed services to recover them.
Attempts:
2 left
💡 Hint

Think about how to stop repeated failures from making things worse.

Architecture
intermediate
2:00remaining
Which component is responsible for tracking failures in a circuit breaker implementation?

In a circuit breaker, one part counts how many times a service call fails. Which component does this?

AThe API gateway encrypts failure data for security.
BThe load balancer tracks failures to redirect traffic.
CThe service registry keeps failure counts for each service.
DThe failure counter inside the circuit breaker monitors failed calls.
Attempts:
2 left
💡 Hint

Focus on the part that decides when to open the circuit.

scaling
advanced
2:00remaining
How does the circuit breaker pattern help improve system scalability under high load?

When many users use a system, some services might slow down or fail. How does the circuit breaker help the system handle more users smoothly?

ABy stopping calls to failing services, it frees resources to serve healthy requests faster.
BBy duplicating requests to multiple services to increase throughput.
CBy caching all responses to avoid calling services again.
DBy automatically adding more service instances when failures occur.
Attempts:
2 left
💡 Hint

Think about how stopping bad calls helps the system breathe.

tradeoff
advanced
2:00remaining
What is a key tradeoff when setting the failure threshold in a circuit breaker?

Choosing how many failures trigger the circuit breaker is tricky. What is the main tradeoff?

AA low threshold may cause false alarms; a high threshold may delay failure detection.
BA low threshold causes data loss; a high threshold causes data duplication.
CA low threshold increases network traffic; a high threshold reduces security.
DA low threshold improves caching; a high threshold slows down encryption.
Attempts:
2 left
💡 Hint

Think about reacting too quickly versus too late.

estimation
expert
3:00remaining
Estimate the maximum number of failed requests allowed before the circuit breaker opens, given these parameters:

A circuit breaker is configured with a failure threshold of 5 failures within a 1-minute window. If the service receives 100 requests per minute and 4% of requests fail, how many failed requests will occur before the circuit breaker opens?

A1 failed request
B5 failed requests
C4 failed requests
D20 failed requests
Attempts:
2 left
💡 Hint

Calculate 4% of 100 requests, then compare to threshold.