Skip to course content
Free FastAPI backend course

FastAPI for AI Backend Development

Module 05 Knowledge Check

5 questions. Pass mark 4 out of 5. Answer every question before checking the answer key below, then retry after reading the feedback.

1. A request model is…

2. Constraints on the model mean the handler…

3. A refund ceiling of 500 belongs…

4. Typing a nested object as dict

5. A rule involving two fields belongs in…

---

Answer Key and Explanations

Check these only after attempting every question.

1. B - a published contract

Adding a required field to it breaks every existing caller.

2. B - never sees invalid input

Defensive re-checks are dead code that drifts out of step with the model.

3. B - on the model, so it is in the published contract

A permissive model advertises something more permissive than the system accepts.

4. B - loses validation, schema and the error path

The nested model names the exact failing field instead of saying the request was invalid.

5. B - a model validator

A field validator sees one value; the model validator sees the whole object.

Practical Check

Apply this module to your own work: complete the module activity for *Pydantic Models for Request and Response Contracts*, then write one sentence naming what your result shows and one naming what it does not.

Strong Answer Pattern

A strong answer names the task, the evidence used, the check performed, and the remaining limitation. It avoids "proved", "guaranteed", or "always" unless the evidence genuinely supports it.