Tools / Monitoring and Observability Interview Questions
What is a health check endpoint and what should it return?
A health check endpoint is an HTTP endpoint — typically /health, /healthz, or /actuator/health — that exposes the current health status of a service. Load balancers, orchestrators like Kubernetes, and monitoring systems poll this endpoint to determine whether the service is ready to receive traffic.
There are two distinct types of health checks that should be implemented separately:
Liveness probe: Answers the question "Is the application alive or should it be restarted?" It should only check whether the process is responsive — not whether its dependencies are healthy. If the liveness probe checks the database and the database goes down, Kubernetes would restart every pod unnecessarily, causing a cascading failure.
Readiness probe: Answers the question "Is the application ready to serve traffic?" This is where dependency checks belong. If the application cannot connect to its database, it should return a non-200 response here, and the load balancer will stop routing requests to it until it recovers.
A good health check response includes: overall status (UP/DOWN/DEGRADED), individual component statuses (database, cache, downstream services), response time of each dependency check, and optionally version information. Spring Boot Actuator's /actuator/health endpoint follows this structure natively and aggregates individual health indicators.
Health checks should be fast (under 100 ms) and should not perform expensive operations — otherwise the health check itself becomes a bottleneck under load.
More Related questions...