Untitled Lesson
Skill Matrix
UNLOCK NODES BY LEARNING NEW TAGS.
What is the practical difference between a liveness check failing versus a readiness check failing in an orchestrated environment like Kubernetes?
💻 Code Challenge | +75 XP
Implement /health/live and /health/ready endpoints where readiness checks a database connection with a 2-second timeout, and the process reports not-ready immediately upon receiving SIGTERM.
A Kubernetes deployment keeps restarting healthy, slow-starting pods during normal deploys. Reorder the steps to diagnose and fix the probe misconfiguration.
Task: Reorder the blocks in logical sequence to solve the problem.
A.D.A. Interface
Adaptive Didactic Assistant

Pascual Vila
Frontend Instructor // Code Syllabus
The Error //
Implementing a health check that unconditionally returns 200 OK regardless of actual application state
// Wrong: no actual signal
app.get("/health", (req, res) => res.sendStatus(200));
// Correct: verifies what actually matters
app.get("/health/ready", async (req, res) => {
res.sendStatus(await db.ping() ? 200 : 503);
});The Solution //
This provides zero real signal to the orchestrator or load balancer — an instance that has completely lost its database connection still reports itself as perfectly healthy, so traffic keeps being routed to (or the instance is never restarted despite) a genuinely broken service. A meaningful health check must actually verify the critical dependencies it relies on.
The Error //
Querying a dependency inside a health check with no timeout of its own
// Wrong: no bound on how long this can hang
await db.query("SELECT 1");
// Correct: strict, short timeout independent of the check
await db.query("SELECT 1", { timeout: 2000 });The Solution //
If the dependency being checked (like a database) is slow rather than fully down, an unbounded check can hang the health endpoint itself indefinitely — turning the health check into an additional point of failure, and potentially causing the orchestrator's own probe to time out in a way that behaves unpredictably.