APIs
APIs: multiple-choice review
Six questions that cut across the whole track. Each one mirrors a review decision on a real public API — not a definition to recite, but a place where one weak link load-bears the next.
Confirm you can trace the cascade end to end: how resource modeling sets up honest status codes, how status codes drive client retries, how pagination and the OpenAPI contract keep both correct under load, and where protocol and rate limits fit.
A team modeled POST /chargeCard instead of a payments resource. Months later they get duplicate charges. What is the root link in the cascade?
Which statement best captures why the HTTP status code is a contract, not decoration?
An endpoint returns a 2M-row list, browsed live, using OFFSET/LIMIT, and deep pages are getting slow and occasionally skip rows. Best structural fix?
A deploy renamed the error envelope field from `message` to `detail` and tightened a status enum. CI was green and clients broke in production. What was missing, and which changes were the problem?
A teammate wants the public API to be gRPC because benchmarks show ~77% lower latency, ~10x smaller messages, and higher throughput. How should a senior reason about it?
A retry storm at peak turns into an outage: tens of thousands of duplicate writes per second hit the database. Which control would have contained it, and how should it behave?
The track is one chain, not a checklist. Resource modeling (nouns, non-CRUD actions as sub-resources) decides whether status codes can be honest; status codes are a machine-readable retry contract (201/409/429, Idempotency-Key on unsafe writes, Retry-After on throttles); cursor pagination keeps large/live reads flat and stable; spec-first OpenAPI with a CI break diff stops silent drift; versioning evolves additively and bumps only on real breaks with a Sunset policy; protocol is an orthogonal axis (REST at the edge, gRPC internal); and rate limits with 429 + Retry-After keep a retry storm from becoming an outage. Review the cascade, because each link load-bears the next.