Module 02 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. The constraint that makes logic portable is…
- A. one file per endpoint
- B. services import no FastAPI
- C. short functions
- D. a shared base class
2. Running with --workers 4 means…
- A. four times the throughput, always
- B. any in-memory state exists four times
- C. requests are load-balanced by path
- D. reload is enabled
3. Typed settings read once at startup mean…
- A. faster requests
- B. a bad configuration value fails at boot
- C. less code
- D. automatic reloading
4. The test command on a fresh clone must…
- A. require a database
- B. pass with no environment set
- C. be run by CI only
- D. need an API key
5. Dependencies should be pinned…
- A. loosely, for security updates
- B. exactly, including transitive ones
- C. only for direct dependencies
- D. not at all
---
Answer Key and Explanations
Check these only after attempting every question.
1. B - services import no FastAPI
It can then be called from a worker, a job or a test with no request object.
2. B - any in-memory state exists four times
An in-memory counter, cache or limiter is duplicated per process.
3. B - a bad configuration value fails at boot
Scattered environment lookups fail at the first request that reads them.
4. B - pass with no environment set
If it needs infrastructure, nobody runs it on every change.
5. B - exactly, including transitive ones
Otherwise the build that passed CI is not the build that deployed.
Practical Check
Apply this module to your own work: complete the module activity for *Local Setup, Project Structure and Running with Uvicorn*, 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.
