All practice tests

Module 3 practice questions: Observability: drift, regressions and cost spikes

15 questions · Observability and Production Monitoring

Practice questions written by Sanjay Shah. Not exam questions, not affiliated with or endorsed by Anthropic.

  1. Question 1

    The status page is green: error rate is 0.1%, every model call returns 200, latency is normal. Support staff say the bot has given wrong answers all week. Which signals would most likely have caught this early?

    • A) A tighter alert on HTTP 5xx error rate.
    • B) A p99 latency alert on the answer endpoint.
    • C) CPU and memory alerts on the app servers.
    • D) Quality proxies (escalation rate, "I don't know" rate, thumbs-down rate, refusal rate) and a sampled judge score, split by tenant and prompt version.
    Show answer

    Answer: D

    • A: There are no errors to alert on; the failure is in content, not transport.
    • B: Wrong answers usually arrive at normal speed.
    • C: Infrastructure metrics say nothing about answer quality.
    • D: Wrong answers come back as successful requests, so only outcome signals move; splitting by tenant and prompt version points to the cause.
  2. Question 2

    Cost per ticket doubled overnight. Traffic, the model and the code are unchanged. Which dashboard split is most likely to find the cause fastest?

    • A) Cost by hour of day.
    • B) Cost per ticket and output tokens per ticket, split by prompt_version.
    • C) Cost split by user_id.
    • D) Cost split by the cloud region the app runs in.
    Show answer

    Answer: B

    • A: Time of day shows when, not why.
    • B: With traffic, model and code unchanged, a prompt change is the likely cause, and it shows up in output tokens split by prompt_version.
    • C: Per-user splits are high-cardinality, and one user rarely doubles the whole average.
    • D: Region doesn't change token usage.
  3. Question 3

    You find that prompt v7 ("give detailed, thorough answers") caused the cost spike. It's live for every tenant. What should you do first?

    • A) Flip the prompt-version flag back to v6, confirm on the dashboard that cost returns to baseline, then send v7 back through the eval gate with a length budget.
    • B) Edit the v7 text directly in production to remove the line.
    • C) Set max_tokens to 500 on every call so answers can't be long.
    • D) Switch every tenant to a cheaper model until next week.
    Show answer

    Answer: A

    • A: Contain first: a flag rollback stops the cost at once and can be checked, then the fix goes through the eval gate.
    • B: Hand-editing in production skips review and the gate, and leaves no clean version to roll back to.
    • C: A global cap truncates legitimate long answers everywhere to fix one prompt line.
    • D: Changing the model changes quality and caching everywhere and doesn't fix the cause.
  4. Question 4

    An engineer builds a "total input tokens" panel. From the Messages API responses they plot usage.input_tokens; from the SDK's OTel spans they plot gen_ai.usage.input_tokens + gen_ai.usage.cache_read.input_tokens + gen_ai.usage.cache_write.input_tokens. The two panels disagree. Which statement is correct?

    • A) Both fields include cache tokens, so the response panel is right and the span panel double counts nothing.
    • B) Both fields exclude cache tokens, so both panels are right and the gap is just lost spans.
    • C) The response's usage.input_tokens excludes cache tokens, while the span's gen_ai.usage.input_tokens already includes them, so the span panel double counts and the response panel undercounts.
    • D) Neither source reports cache tokens; call the token-counting endpoint for every request instead.
    Show answer

    Answer: C

    • A: The response field excludes cache tokens.
    • B: The span field includes them.
    • C: API usage.input_tokens is the uncached remainder, while Anthropic's span gen_ai.usage.input_tokens already includes cache reads and writes.
    • D: Both sources report cache tokens, and counting tokens for every request is needless extra calls.
  5. Question 5

    Finance asks for exact spend per API key for last month. The team plans to sum the cost-estimate attribute across all exported spans. What is the best approach?

    • A) Sum the spans; they're a complete record of every request.
    • B) Multiply the request count by the average cost per request.
    • C) Grep the application logs for every response and sum their usage.
    • D) Use the Usage and Cost Analytics reports (or the invoice), and keep spans for trends and alerts.
    Show answer

    Answer: D

    • A: Span export is best effort, so spans can be lost and aren't a complete record.
    • B: Costs vary widely per request, so averages are far from exact.
    • C: Logs have the same gaps and estimates, and are even easier to lose or sample.
    • D: Finance needs the provider's usage and cost reports or the invoice; spans are for trends and alerts.
  6. Question 6

    To debug bad answers, a developer sets every span to record full prompts and responses, and exports them to the shared observability vendor that all engineers can see. Tickets contain names, emails and card fragments. Which two changes are best? (Choose TWO.)

    • A) Make telemetry metadata-only by default, with HMAC-pseudonymised ids and redaction.
    • B) Keep full content everywhere, since you can't debug LLM answers without it.
    • C) Turn telemetry off entirely for any tenant whose tickets might contain personal data.
    • D) Base64-encode the prompts before export so they aren't readable at a glance.
    • E) Keep full prompts and responses only in a sampled, access-controlled store with short retention and logged access.
    Show answer

    Answer: A, E

    • A: Metadata everywhere gives trends without spreading personal data, and HMAC keeps ids groupable but not reversible.
    • B: It copies personal data into a system with wide access and long retention.
    • C: You lose all visibility exactly where problems would hurt most.
    • D: Base64 is an encoding, not protection; anyone can decode it.
    • E: A small, locked-down, short-lived store keeps real content available for debugging without exposing it widely.
  7. Question 7

    One run made 40 tool calls, calling get_order again and again with the same arguments. Per-call latency and error metrics look normal. Which two controls are best? (Choose TWO.)

    • A) A daily alert when total spend is above average.
    • B) Turns-per-run and tool-calls-per-run histograms, with an alert on the high percentiles.
    • C) A lower max_tokens on each call, so each turn is cheaper.
    • D) A prompt line: "Use at most five tool calls."
    • E) A hard cap in the loop that stops and escalates, plus an early stop when the same tool is called with identical arguments several times in a row.
    Show answer

    Answer: B, E

    • A: It's a day late and doesn't say which run.
    • B: The problem is per run, not per call, so measure per run and alert on the tail.
    • C: Forty cheaper turns are still forty turns.
    • D: A prompt rule is a request; the loop needs a limit in code.
    • E: The hard cap stops the cost, and the repeated-call check catches the common loop early.
  8. Question 8

    The team adds ticket_id and user_id as labels on Prometheus metrics, so they can filter dashboards. Prometheus memory use climbs until it crashes. What is the best fix?

    • A) Give Prometheus much more memory.
    • B) Stop collecting metrics and use only traces.
    • C) Keep metric labels low-cardinality (bounded tenant, prompt version, model, outcome, tool) and put ticket and user ids on traces and logs.
    • D) Hash ticket_id and user_id before using them as labels.
    Show answer

    Answer: C

    • A: The number of series grows with every new ticket, so memory never catches up.
    • B: You lose cheap, accurate rates and alerts.
    • C: Every unique label combination is a new series; ids belong on traces and logs, which are built for unique records.
    • D: A hashed id has exactly as many distinct values as the id itself.
  9. Question 9

    Cedar reorganised its help centre. Since then, cedar's escalation rate has crept up a little each day. You have no ground-truth labels in production. What is the best way to detect and confirm this kind of drift?

    • A) Watch quality proxies per tenant against that tenant's own baseline (with a minimum volume), correlate with change events such as re-indexes, and confirm with a small daily judge-scored sample.
    • B) Wait for customer complaints; without labels, drift can't be measured.
    • C) Fine-tune the model every week on cedar's latest tickets.
    • D) Compare cedar's escalation rate with alpine's, and alert if cedar is higher.
    Show answer

    Answer: A

    • A: Drift shows in proxies first, a tenant's own baseline avoids false alarms, change events find the cause, and a judge sample confirms quality moved.
    • B: Proxies plus sampled judging measure drift fine without full labels.
    • C: The cause is the index and docs, not the model, and weekly fine-tuning is costly and slow.
    • D: Tenants differ naturally, so a higher absolute rate may be normal for cedar.
  10. Question 10

    The cost alert pages on-call several times a night, each time because of one long, legitimately expensive ticket. Which two changes are best? (Choose TWO.)

    • A) Alert on any single request above a cost threshold, but send it to email instead of the pager.
    • B) Delete the cost alert; the monthly bill will show problems anyway.
    • C) Page on every request above twice the median cost.
    • D) Alert on cost per resolved ticket against a rolling baseline, sustained over a window (for example above 1.5× for 15 minutes).
    • E) Add a minimum-volume guard, so a handful of tickets in a quiet hour can't trigger the alert.
    Show answer

    Answer: D, E

    • A: It still alerts on single legitimate requests, now with nobody watching.
    • B: A monthly bill finds problems weeks too late.
    • C: It pages even more often for normal long tickets.
    • D: Cost per unit of work, sustained and compared with the system's own baseline, catches regressions and ignores single long tickets.
    • E: A volume guard stops two tickets at 3 a.m. from looking like a trend.
  11. Question 11

    Traces are head-sampled at 5% at the start of each run. When a rare failure happens, there's usually no trace of it. What is the best change?

    • A) Keep 100% of all traces forever.
    • B) Tail-based sampling: keep every errored, refused, max_tokens, escalated, slow or expensive run, plus a small random baseline of normal runs; keep counting every run in metrics.
    • C) Lower head sampling to 1% to save money, and use logs for failures.
    • D) Sample by tenant: keep 100% for alpine and 0% for the others.
    Show answer

    Answer: B

    • A: It's costly at volume, and "forever" keeps sensitive data far longer than needed.
    • B: Tail sampling decides after the run, so it keeps the runs worth keeping, and unsampled metrics keep rates accurate.
    • C: It loses even more failures, and logs have the same sampling problem.
    • D: Problems in birch and cedar become invisible.
  12. Question 12

    The SDK's OpenTelemetry export is turned on, and the team's own wrapper also records gen_ai.usage.* on its spans for the same calls. The token dashboard now shows twice the real usage. What is the best fix?

    • A) Divide the dashboard numbers by two.
    • B) Turn off all tracing and read usage from the API responses only.
    • C) Use one source per request for token totals (the SDK's model spans or your own, not both), and put app attributes like tenant and prompt version on a parent span.
    • D) Keep both sources and add a dashboard note explaining the doubling.
    Show answer

    Answer: C

    • A: Dividing hides the bug and breaks as soon as coverage differs between the sources.
    • B: You'd lose traces entirely to fix a counting problem.
    • C: One source per request avoids the double count, and a parent span carries your app dimensions without repeating usage.
    • D: A known-wrong dashboard gets misread.
  13. Question 13

    One model call returned a strange result, and you want to ask Anthropic support about it. What should your telemetry have recorded to make that possible?

    • A) The customer's email address, so support can look up the account.
    • B) The full API key used for the call.
    • C) Only your own ticket id.
    • D) The request id (from the response or the error body), plus the model, prompt version and timestamp, on the model span.
    Show answer

    Answer: D

    • A: Personal data doesn't belong in telemetry, and it doesn't identify a request.
    • B: Never record credentials anywhere in telemetry.
    • C: Your ticket id means nothing to the provider.
    • D: The request id lets the provider find the exact call, and the model, prompt version and timestamp let you reproduce it.
  14. Question 14

    Prompts live in a database table that support leads edit directly in production; there's no version column. A cost regression appears, and nobody can tell which edit caused it. What is the best long-term fix?

    • A) Version prompts as files in the repo, deploy them with an id, choose the active version with a flag, record the version on every span, and roll back by flipping the flag.
    • B) Make the table read-only for everyone.
    • C) Add an audit log table recording who changed the prompt and when.
    • D) Hard-code the prompt in the application source so it can't change.
    Show answer

    Answer: A

    • A: Prompts are code: versioned files, deploy ids, a flag and the version on every span make regressions traceable and reversible in minutes.
    • B: It stops changes without making them traceable or reversible.
    • C: An audit log says who changed something, but there's still no version to compare, test or restore.
    • D: Every change needs a deploy, and you still can't switch versions per tenant or roll back quickly.
  15. Question 15

    After a bulk import of old birch tickets, birch's refusal rate jumps from 0.2% to 6%. Nothing else changed. What is the best response?

    • A) Retry every refused request until it gets a normal answer.
    • B) Make sure refusal rate per tenant is a monitored signal; review a sample of the refused runs in the access-controlled store to find what the imported tickets have in common, and route refusals to a person in the meantime.
    • C) Switch birch to a different model straight away.
    • D) Ignore it; refusals are the model's decision and can't be investigated.
    Show answer

    Answer: B

    • A: Retrying blindly multiplies cost, and a refusal on the same input is likely to repeat.
    • B: A refusal is an outcome you can monitor and investigate, and escalating meanwhile keeps customers served.
    • C: Switching models before you understand the cause changes cost and quality for birch and may not help.
    • D: Refusals carry a stop reason and details you can log, count and review.

↑ ↓ navigate · ↵ select · esc close