Module 12 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 database session should be…
- A. a module-level global
- B. one per request, closed in a
finally - C. created in each service
- D. shared across workers
2. A database outage should return…
- A. 500
- B. 503
- C. 400
- D. 200 with an error body
3. An outbound call with no explicit timeout…
- A. uses a sensible default
- B. can consume every worker in turn
- C. fails fast
- D. is retried automatically
4. Retries should never be applied to…
- A. 503
- B. 4xx responses
- C. timeouts
- D. 429
5. Queries belong…
- A. wherever they are needed
- B. in the repository layer only
- C. in the router
- D. in the model
---
Answer Key and Explanations
Check these only after attempting every question.
1. B - one per request, closed in a finally
A leak on the error path exhausts the pool slowly and surfaces under load.
2. B - 503
500 says 'unknown, our fault'; 503 tells the client to retry with backoff.
3. B - can consume every worker in turn
Several popular clients default to none, so the failure mode is a hang.
4. B - 4xx responses
The payload will not become valid on the second attempt.
5. B - in the repository layer only
The service is then testable with a dictionary, and a storage change touches one directory.
Practical Check
Apply this module to your own work: complete the module activity for *Database and External Service Boundaries*, 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.
