0
0
Microservicessystem_design~20 mins

Health checks in containers in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Health Check Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Purpose of Liveness and Readiness Probes

In container orchestration systems like Kubernetes, what is the main difference between a liveness probe and a readiness probe?

ALiveness probes check if the container is alive and should be restarted if failed; readiness probes check if the container is ready to accept traffic.
BLiveness probes check network connectivity; readiness probes check disk space availability.
CLiveness probes verify CPU usage; readiness probes verify memory usage.
DLiveness probes are used only during startup; readiness probes are used only during shutdown.
Attempts:
2 left
💡 Hint

Think about what happens when a container is unhealthy versus when it is not ready to serve requests.

Architecture
intermediate
2:00remaining
Designing Health Checks for a Microservice

You have a microservice that depends on a database and a cache. Which health check design best ensures the service is only marked ready when both dependencies are available?

AUse no health checks and rely on external monitoring tools.
BImplement a readiness probe that checks connectivity to both the database and cache before marking the service ready.
CUse only a liveness probe that checks if the service process is running.
DImplement a readiness probe that checks only the database connectivity.
Attempts:
2 left
💡 Hint

Consider what readiness means for a service that depends on multiple components.

scaling
advanced
2:00remaining
Impact of Health Checks on Auto-Scaling

How can improperly configured health checks affect the auto-scaling behavior of a containerized microservice?

AIf health checks fail frequently, the orchestrator may kill and restart containers unnecessarily, causing scaling instability.
BHealth checks have no effect on auto-scaling since scaling depends only on CPU usage metrics.
CHealth checks speed up scaling by automatically increasing container memory limits.
DImproper health checks cause the orchestrator to ignore scaling policies and keep the number of containers fixed.
Attempts:
2 left
💡 Hint

Think about what happens when containers are repeatedly marked unhealthy.

tradeoff
advanced
2:00remaining
Tradeoffs in Health Check Frequency

What is a key tradeoff when choosing how often to run health checks on containers?

AHealth check frequency does not affect system performance or reliability.
BLess frequent health checks reduce resource usage but cause containers to restart unnecessarily.
CFrequent health checks improve container startup time but reduce security.
DMore frequent health checks detect failures faster but increase resource usage and network traffic.
Attempts:
2 left
💡 Hint

Consider the balance between responsiveness and overhead.

estimation
expert
3:00remaining
Estimating Health Check Load in a Large Cluster

You manage a cluster with 1000 containers. Each container runs a health check every 10 seconds, and each check sends a 1 KB request and receives a 1 KB response. Estimate the total network bandwidth used by health checks per minute.

AApproximately 2000 KB per minute
BApproximately 200 KB per minute
CApproximately 20000 KB per minute
DApproximately 200000 KB per minute
Attempts:
2 left
💡 Hint

Calculate requests per minute and multiply by request and response size.