roadmap
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
Explain how FastAPI turns type hints into validation, dependency injection and generated docs. Covers Pydantic models, async execution, SQLAlchemy persistence, security and deployment.
392 of 392 questions in your plan: 0 known, 0 in progress, 0 due, 0 skipped, 392 new. 0 cut, outside your plan.
FastAPI comes up in Python backend loops and, more and more, in AI and ML engineering loops, where it is the usual way a model ends up behind an HTTP endpoint. Interviewers seldom set aside a separate FastAPI round. The framework surfaces inside a take-home review or the technical conversation that follows one, where the interviewer opens your submission and asks why each piece works.
Three mechanisms carry most of those conversations. One is the split between def and async def path operations: a plain function runs in a thread pool, a coroutine on the event loop, so a single blocking call inside an async def handler stalls every request the process serves. Another is the dependency graph behind Depends: when a dependency with yield runs its cleanup, why one used twice in a request runs once, how app.dependency_overrides replaces it in a test. The last is the validation boundary: why a malformed body never reaches your handler and returns a 422, and why Optional[int] with no default is still a required field in Pydantic v2.
Depth is what separates the levels. Early on, the decorator and the response it produces are enough. A middle or senior candidate is expected to trace the path underneath: annotations read once when the route is registered, a model compiled into a validator, and a request crossing the ASGI server, the middleware stack and the dependency resolver before your function sees it.
The plan opens below the framework, on the annotations it reads. Forward references, unions with None and Annotated come first because FastAPI parameters are declared with them, and get_type_hints explains how the framework turns a string annotation back into a type, and why one that names something outside the module's namespace cannot be resolved.
The framework itself follows, then Pydantic studied apart from FastAPI: coercion against strict mode, validators, serialization, settings and what changed from version 1. Putting Pydantic after the framework is deliberate; by then you know which of its behaviors every request passes through.
Async execution comes after those two modules, once async def handlers are familiar. It goes below FastAPI into Python's event loop, where a coroutine suspends at each await, and reaches the cost of blocking code inside it, the reason a plain def handler is sent to a thread pool instead.
SQLAlchemy follows the async stretch because its asyncio extension leans on it: a relationship a synchronous session would load on first access raises an error under AsyncSession instead, and the cause only makes sense once you know where the loop waits. The library is taught on its own terms, from the engine and the session to Alembic migrations, while the framework module keeps how FastAPI hands one session to each request.
The closing stretches surround a running service. OpenAPI is read as a specification after FastAPI has generated one for you, and its security schemes lead into JWT and OAuth2. Testing has no module of its own: the in-process client and overridden dependencies sit in the framework's testing branch. Deployment ends on ASGI and the worker models that decide how many event loops serve your traffic.
Developers coming from Spring, ASP.NET Core or Express already know what a router, a middleware chain and an injected dependency are for; what they lack is the Python underneath. Move study order off by frequency and onto by topics, then give the hours to the type-hint opening, the two framework modules and async execution. Flask and Django developers have the opposite gap: Python is familiar, the event loop often is not. When the interview is close, the library and specification modules after the framework are where the page's filters save the most time: an importance range cut down to must know leaves only their essentials, and a level range matching the posting drops the questions pitched above or below it. For a model-serving role, put the async, streaming and worker questions first; they decide whether an inference endpoint survives load. The plan teaches one ORM through its own API, not persistence in general. Ideas every mapper shares, such as the unit of work, N+1 selects and lazy loading, belong to the [Backend Developer roadmap](/roadmaps/backend), together with the request lifecycle and middleware theory any web framework has to answer. When work outgrows `BackgroundTasks` and needs a worker process of its own, the [Celery roadmap](/roadmaps/celery) picks it up. Python beyond typing and asyncio, from the data model to generators and decorators, belongs to the [Python roadmap](/roadmaps/python), which FastAPI loops draw on too.
Developers coming from Spring, ASP.NET Core or Express already know what a router, a middleware chain and an injected dependency are for; what they lack is the Python underneath. Move study order off by frequency and onto by topics, then give the hours to the type-hint opening, the two framework modules and async execution. Flask and Django developers have the opposite gap: Python is familiar, the event loop often is not.
When the interview is close, the library and specification modules after the framework are where the page's filters save the most time: an importance range cut down to must know leaves only their essentials, and a level range matching the posting drops the questions pitched above or below it. For a model-serving role, put the async, streaming and worker questions first; they decide whether an inference endpoint survives load.
The plan teaches one ORM through its own API, not persistence in general. Ideas every mapper shares, such as the unit of work, N+1 selects and lazy loading, belong to the Backend Developer roadmap, together with the request lifecycle and middleware theory any web framework has to answer. When work outgrows BackgroundTasks and needs a worker process of its own, the Celery roadmap picks it up. Python beyond typing and asyncio, from the data model to generators and decorators, belongs to the Python roadmap, which FastAPI loops draw on too.