All jobs / Backend developer / Backend Languages

Backend developer interview question · 0–1 years

The interviewer asks: “How should a FastAPI path operation be structured?” Strongest answer?

The strongest answer

Declare the route, verb and response model. Let Pydantic validate input; the function calls a service and returns a model — I don't grow SQLAlchemy queries inside the route.

Why it works

Exactly. The path operation is the HTTP edge. Types and models catch bad input; services own the use case.

What a good answer covers

Answers that fall short

Who gets asked this

More Backend Languages questions