0
0
HLDsystem_design~20 mins

Health check endpoints in HLD - 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
1:30remaining
Purpose of Health Check Endpoints

What is the primary purpose of a health check endpoint in a distributed system?

ATo provide detailed logs of system errors to developers
BTo manage database schema migrations automatically
CTo allow external systems to verify if a service is running and responsive
DTo store user authentication tokens securely
Attempts:
2 left
💡 Hint

Think about what external systems need to know to decide if a service is healthy.

Architecture
intermediate
2:00remaining
Designing a Health Check Endpoint

Which design best describes a simple health check endpoint that returns HTTP 200 OK only if the service and its database are reachable?

AEndpoint checks service status and database connectivity, returns HTTP 200 OK if both are healthy, else HTTP 503
BEndpoint returns HTTP 200 OK without checking any dependencies
CEndpoint returns HTTP 500 Internal Server Error if the service is healthy
DEndpoint only checks database connectivity and ignores service status
Attempts:
2 left
💡 Hint

Consider what components must be healthy for the service to be considered healthy.

scaling
advanced
2:30remaining
Scaling Health Check Endpoints in Microservices

In a microservices architecture with hundreds of services, what is the best approach to efficiently perform health checks without overwhelming the system?

AEach service only checks its own health and ignores dependencies
BEach service performs health checks on all other services synchronously on every request
CDisable health checks to reduce network traffic
DUse a centralized health aggregator that periodically polls each service's health endpoint asynchronously and caches results
Attempts:
2 left
💡 Hint

Think about reducing load and avoiding synchronous calls across many services.

tradeoff
advanced
2:30remaining
Tradeoffs in Health Check Endpoint Complexity

What is a key tradeoff when designing a health check endpoint that performs deep checks (e.g., database, cache, external APIs) versus a simple ping check?

ADeep checks increase response time and risk false negatives, while simple checks may miss critical failures
BSimple checks provide detailed error logs, deep checks do not
CDeep checks always improve performance, simple checks cause system crashes
DDeep checks reduce network traffic, simple checks increase it
Attempts:
2 left
💡 Hint

Consider the balance between thoroughness and speed.

estimation
expert
3:00remaining
Estimating Load on Health Check Endpoints

A service has 100 instances behind a load balancer. The load balancer performs health checks every 10 seconds. Each health check request consumes 5ms CPU time on the instance. Estimate the total CPU time spent per second on health checks across all instances.

A5 ms per second
B50 ms per second
C500 ms per second
D1000 ms per second
Attempts:
2 left
💡 Hint

Calculate how many health checks happen per second and multiply by CPU time per check.