12 questions, 20 points, 30 minutes. Pass mark: 14/20 (70%). The answers are in
answer-key.md(for instructors only).
Part A - Multiple choice (1 point/question)
Q1. What is the safest way for a web application to use a model provider's API key?
- A. Put the key in the page's JavaScript code
- B. Store the key in an environment variable of the backend, and have the browser call only the backend
- C. Encode the key in base64 and put it in the frontend
- D. Send the key to users by email
Q2. A reply has stop_reason: "max_tokens". The most correct handling is:
- A. Show it as a complete answer
- B. Mark it as incomplete (or handle it according to the product decision), not show it as a complete reply
- C. Retry with the same parameters until
stop_reasonis different - D. Ignore it because it is an API error
Q3. The SDK retries 2 times by default. For a 400 invalid_request_error, how many requests does the SDK send?
- A. 1 B. 2 C. 3 D. It depends on
retry-after
Q4. TTFT measures:
- A. The time from sending the request to the end of the stream
- B. The time from sending the request to the first token of the output
- C. The number of tokens per second
- D. The processing time in the database
Q5. What can a replay test prove?
- A. The current model still answers as it did when recorded
- B. The code correctly handles one recorded real response
- C. The answer quality is stable
- D. The API key is still valid
Part B - True / False (1 point/question)
Q6. A test run against the fake API proves that the real API will behave exactly the same way.
Q7. According to Anthropic's Versions page, from API version 2026-10-21 a request with temperature gets a
400 error on every model.
Q8. Every 429 error should be handled with the message "try again in a few minutes".
Part C - Short answer (3 points/question)
Q9. A regression test run sends 300 requests on Claude Opus 5.5, each request averaging 800 input
tokens and 250 output tokens, with max_tokens=1000. Calculate the estimated actual cost, and the worst-case
cost that the budget guard will use. Show the calculation (prices in L01).
Q10. Explain "retry on retry" and how a test detects it.
Q11. Why does the L04 demo print conditions (True/False) instead of seconds? What does this say about how
to write latency tests?
Part D - Scenario (3 points)
Q12. Your team wants to put all the LLM tests into CI. There are currently 40 tests with the fake API, 15 replay tests and 5 live tests. Propose when each group runs, how cost is protected, and when the cassettes must be re-recorded.