Module 10 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. Validation belongs…
- A. in the handler body
- B. on the request model, so it runs before your code
- C. in the frontend only
- D. after the model call
2. Content that must pass a later check should…
- A. always be streamed
- B. not be streamed as an answer
- C. be streamed with a warning
- D. be streamed then validated
3. Your request timeout should be…
- A. longer than the load balancer's
- B. shorter than the infrastructure in front of you
- C. the same as the model's
- D. unset
4. Work taking more than a couple of seconds should…
- A. hold the connection open
- B. return a job id the client can come back to
- C. run synchronously with a longer timeout
- D. be cached
5. TestClient lets you exercise the app…
- A. against a running server
- B. in-process, with no server and no network
- C. only in production
- D. with a real model
---
Answer Key and Explanations
Check these only after attempting every question.
1. B - on the request model, so it runs before your code
In the handler, the second endpoint gets a slightly different version and one path loses a rule.
2. B - not be streamed as an answer
If validation fails you must visibly replace text the user is already reading.
3. B - shorter than the infrastructure in front of you
Otherwise the user gets a generic 504 and never receives the request id you would have given them.
4. B - return a job id the client can come back to
A held-open connection fails on dropped connections, page reloads and mobile network changes.
5. B - in-process, with no server and no network
That is what makes the offline suite in the next module possible.
Practical Check
Apply this module to your own work: complete the module activity for *Simple App UI with FastAPI or Streamlit*, 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.
