Checkpoint: Production APIs
advanced25 min readLesson 146 of 169
Prove you can contract-check, validate, and keep serving when dependencies wobble.
Write code that answers these three questions for a real service:
- When input is bad, does the client get every problem in one envelope-shaped answer — with no internals leaked on 5xx?
- When load spikes, does the limiter throttle by the injected clock, not by wall-clock luck?
- When a dependency is down, does readiness say so without crashing?
The challenge below combines 2 and 3: a readiness probe whose checks are
injected zero-arg callables. A check that raises is a dependency that is down —
that must mark the service not ready (and appear as false), never crash
the probe and never count as healthy.