Implement FastAPI CRUD endpoints from skeletons
Credit GenieSoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's ability to implement RESTful CRUD endpoints with FastAPI, focusing on API contract consistency, HTTP status codes and idempotency, input validation and exception handling, and unit testing.
Given a FastAPI project with two working endpoint functions (create and read) and shared Pydantic models, implement the remaining update and delete endpoints to complete CRUD. Requirements: a) match the existing request/response schemas and status codes; b) preserve idempotency and return 404 vs 204 appropriately; c) validate inputs and handle exceptions; d) write unit tests for all four endpoints; e) explain how you would approach this if you have never used FastAPI before, by leveraging the existing endpoints as templates and the framework documentation.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.