Software Engineering Foundations
Official scope (Exam Guide v1.0): REST, JSON, asynchronous programming, version control, SDLC integration, code review, and small- and large-scale refactoring. Mostly general engineering practice applied to Claude; candidates tend to under-study it.
One API round trip
- HTTPS
POST /v1/messageswith a JSON body. - Headers:
Authorization: Bearer <key>(the legacyx-api-keystill works),anthropic-version: 2023-06-01,content-type: application/json; optionalanthropic-betafor preview features. - Every response carries a
request-idheader; error bodies repeat it asrequest_id. Log it.
SDK vs raw HTTP
The official SDKs add: typed exceptions per status, automatic retries with exponential backoff (2 by default, honouring retry-after) for connection errors, 429 and 5xx, request-id access, streaming helpers that can return the final message, TCP keep-alive, and a check that a non-streaming request is not expected to exceed 10 minutes. Use raw HTTP only when no SDK fits; then you own all of that.
Catch the SDK's typed exception classes, most specific first, instead of string-matching messages.
Sync, async and streaming (verified facts, design guidance on choice)
| Mode | Use when |
|---|---|
| Synchronous | Short answers, simple scripts |
| Asynchronous client | Many concurrent requests; keep concurrency under rate limits; set timeouts and handle cancellation |
| Streaming (SSE) | A person is watching, or the output is long. Long non-streaming requests risk idle-connection drops |
Version control is more than code (design guidance)
Prompts, tool schemas, model IDs, parameters, eval sets and configuration change behaviour as much as code. Keep them in version control, review them like code, and be able to roll back.
SDLC integration (design guidance)
- Run evals in CI on every prompt, tool or model change; gate merges on them.
- Link changes to tickets; review prompt diffs like code diffs.
- Claude Code can run in CI (
claude -p, GitHub Actions) for review or fixes, behind normal review gates.
Code review and refactoring (design guidance)
- AI-generated code gets the same tests and review as any code. Watch for plausible-looking wrong logic and invented APIs ("do not vibe-ship").
- Small refactors: tests first, one change at a time, reviewable diffs.
- Large refactors: characterisation tests first, small reversible steps, automated codemods where possible, staged rollout, and plan mode or a written plan before broad edits.
Production qualities (design guidance, verified where marked)
Timeouts; retries only for transient errors; idempotent retried operations (a retry must not double-charge or double-send); structured logging with request ids; secrets out of code; monitoring; graceful degradation. Request size limits are verified: Messages 32 MB, Batch 256 MB, Files 500 MB; over the limit returns 413.
Exam traps
- Hand-rolled HTTP without retries or typed errors when an SDK exists.
- Raising the timeout instead of streaming a very long output.
- Prompts stored only in a dashboard, with no history or review.
- Merging AI-generated code because it "looked right".
- Non-idempotent retries (duplicate emails, double charges).
References
- Errors and long requests — checked Oct 16, 2026
- Authentication — checked Oct 16, 2026
- Claude Code GitHub Actions — checked Oct 16, 2026
Check your understanding
Name three things the SDK gives you that raw HTTP does not.Show answerHide answer
Answer
Typed errors, automatic backoff retries, request-id access (also streaming helpers, timeout guard).A very long generation fails with a dropped connection. Fix?Show answerHide answer
Answer
Stream it (or use the Batch API).Why version prompts?Show answerHide answer
Answer
A prompt change is a behaviour change: you need history, review and rollback.A payment step is retried on timeout and the customer is charged twice. Missing property?Show answerHide answer
Answer
Idempotency.