Skip to content

Context Engineering & Caching

16 questions
0 of 16 done · 5 unlocked for you
DONEUNLOCKEDLOCKED

Context Engineering Interview Questions

The context window as a budget the harness spends on every turn. What goes in and in what order, tool-result clearing, compaction and external notes, why long runs degrade before the window is full, and how to keep the prompt prefix cacheable.

Worked answers that trace the run, put each decision on the right side of the authority line, and end with the follow-ups and scoring a panel applies.

You have 5 free answers unlocked here.Sign in free for 1 more · 10 are premium.
01–07Foundationsthe mechanisms behind this topic, and the terms a panel uses for them0/7 done
08–13Core questionsthe questions this topic is most often tested on, with full worked answers0/6 done
14–16Field scenariosopen-ended designs, incidents and trade-offs where you must state what is missing0/3 done
PRACTICE TESTStudied this track? Prove it: a timed Context Engineering & Caching test.fresh items every sitting · explanations for every answer · easy items free with an accountStart →

The concepts behind Context Engineering & Caching

Lessons behind these answers. The opening lessons are free; deeper ones are Premium.

Foundational
The Context Window as a BudgetAn agent's context window holds a stable prefix (system prompt, tool definitions) and parts that grow every turn (conversation, tool results, notes). Treating it as a budget means accounting for each part's tokens on every turn, capping what grows, reserving room for the model's output, and clearing or compacting at deliberate thresholds well before the limit, because quality falls long before the window is full and every token is reread on every later turn.
Foundational
Context RotContext rot is the drop in a model's accuracy as its input grows longer and noisier, even when the fact it needs is present. Three effects drive it: attention spread over more tokens, distractors that resemble the right answer, and position (facts in the middle of a long input are used less reliably). Agents are especially exposed because their context grows every turn with stale and repetitive tool output. The fix is to keep the context small and high-signal, not to buy a bigger window, and to measure the effect on your own task.
Core
Sign in
Clearing, Compaction and NotesLong-running agents need context reduction, and the tools differ in how much they lose. Tool-result clearing replaces results already used with placeholders while keeping the record of each call. Notes move durable facts and progress out of the transcript into a small structured store the agent rereads. Compaction rewrites the conversation into a summary and is the lossiest, so it runs rarely, at deliberate boundaries, under a contract that names what must survive, and with a test that checks it did.
Advanced
🔒 Premium
Prompt Caching for AgentsPrompt caching reuses the provider's computation for a prefix identical to one it processed recently, which makes repeated input cheaper and faster. Agents benefit more than chat because each turn resends everything before it. The benefit depends on a byte-stable prefix: stable content first (system prompt, tools, fixed documents), history append-only, anything per-request or per-turn at the end. Timestamps, reordered tools, non-deterministic serialization and edits to earlier messages each turn a hit into a miss.
Advanced
🔒 Premium
Just-in-Time RetrievalInstead of loading everything an agent might need into every request, just-in-time retrieval gives it lightweight handles (file paths, record ids, document titles with sizes and dates) and tools to open exactly the slice it needs when it needs it. The trade is a few extra turns of latency against a much smaller, cleaner context. Good designs keep a small always-present core, give the agent a map of what exists, return slices rather than whole documents, and treat everything fetched as untrusted input.
Advanced
🔒 Premium
Four Ways Long Context Fails: Poisoning, Distraction, Confusion and ClashLong agent contexts fail in four recognisable ways, named by Drew Breunig in 2025. Poisoning: a wrong statement enters the context and is referred back to until it shapes every later step. Distraction: the accumulated history grows until the model leans on repeating past actions instead of the task. Confusion: irrelevant documents or too many tools influence the response. Clash: information added at different times contradicts itself. Each has a trace signature and a harness fix: validated memory and quarantine, compaction and notes, selection and tool projection, and explicit supersession of stale facts.
Unlock all 16 answers · $25

All 19 topics with every worked answer, all lessons and courses, the full practice bank, and anything new that appears during your access.

6 months · One payment · No auto-renewal