🔗 REST API Engineering — interview questions
11 questions. Filter by what the role asks for; open one for the six layers of the answer. The course is where the answers come from.
11 of 11
01What's the difference between a safe HTTP method and an idempotent one, and why does POST need special handling that PUT doesn't?HTTP semanticseasy0-2y02Why shouldn't a Spring MVC controller return a JPA entity directly from a REST endpoint?API designmedium0-2y03How does @Valid on a request body actually trigger validation, and why does a @RequestParam need @Validated instead?Validationmedium0-2y04What's wrong with Spring Boot's default error response, and how does RFC 9457 Problem Details fix it?Error handlingmedium3-5y05Why does offset pagination return duplicate or missing rows under concurrent writes, and how does keyset pagination avoid it?Paginationmedium3-5y06How would you design an Idempotency-Key mechanism for a POST /charges endpoint so a retried request can't double-charge a customer?Idempotencyhard3-5y07Compare token bucket and sliding-window-counter rate limiting. Which would you reach for on a public API, and why?Rate limitinghard5-8y08How do ETags and conditional requests actually save work, and what's the difference between a strong and a weak validator?Cachingmedium5-8y09URI versioning, header versioning, or media-type versioning — how do you choose, and what does each cost you operationally?Versioninghard5-8y10How do you keep an OpenAPI spec from lying about your API, and what's the real difference between a schema diff and a consumer-driven contract?API contractssenior8+y11Two identical POST requests carrying the same Idempotency-Key arrive at the same instant on two different instances. Walk through why wrapping the check-then-insert in a database transaction doesn't prevent a double-charge, and what does.Idempotencysenior8+y