Skip to content

Context engineering and agent memory

  • Agents
  • Asked often
  • About 80 min to learn
  • 5 vetted resources
Build a plan that includes this

What this topic covers

An agent's context window is a budget, not a bucket: every tool result, file and message competes for a finite space, and quality drops before the hard limit is reached. Context engineering is the set of moves that keeps the right tokens in the window at each step: writing notes outside the window (scratchpads, memory files), selecting what to pull back in, compressing with summarisation or trimming, and isolating work in sub-agents that return only a digest. Memory tiers (in-context working memory, recall of past turns, long-term archival store) extend this across conversations, with the model itself deciding what to save and evict. Senior agent interviews ask you to design cross-conversation memory, explain when to compact versus clear, and justify sub-agent isolation versus one long loop.

You’re ready when you can

What interviewers check, from the resources below.

  • Name the four context-engineering strategies and give one concrete mechanism for each
  • Compare a scratchpad with a memory: who writes it, when it is read, and what survives across sessions
  • Explain when you would summarise versus trim a context, and what gets lost in each
  • Justify sub-agent isolation over one long loop, including the cost of handing results back
  • Design cross-conversation memory for a support bot: what to extract, where to store it, how to select it next time
  • Rewrite a vague prompt so it names the file, the edge case, and the check the agent must run
  • Explain when plan mode is worth its overhead and when to skip it
  • Draft a ten-line CLAUDE.md for a toy project and justify each line
  • Describe what you do after the agent has been wrong twice on the same issue
  • Explain context rot and why a bigger window doesn't remove the need for retrieval

What to study, in order

Each link opened and checked by hand; the date says when.

  1. Start here

    Context Engineering for Agents (opens in a new tab)

    LangChain Blog · LangChain Team · 25 min · Free · checked 21 Oct 2026

    Why
    The write / select / compress / isolate split is the cleanest framework for answering 'how do you keep a long-running agent from degrading', and interviewers recognise it.
    What to read
    Read “TL;DR” through “Isolating Context”, including the “Scratchpads”, “Memories”, “Context Summarization”, “Context Trimming” and “Multi-agent” subsections.
    What to skip
    “Context Engineering with LangSmith / LangGraph” and “Related content”; they are product mapping.
  2. Free alternative

    Best practices for Claude Code (opens in a new tab)

    Claude Code docs · Anthropic · 35 min · Free · checked 21 Oct 2026

    Why
    The operating manual for the agent you'll most likely be handed: closing the loop with a runnable check, plan-before-code, a short CLAUDE.md, and correcting early.
    What to read
    Read “Give Claude a way to verify its work”, “Explore first, then plan, then code”, “Provide specific context in your prompts”, “Write an effective CLAUDE.md”, “Course-correct early and often”, and “Avoid common failure patterns”.
    What to skip
    “Configure permissions”, MCP/hooks/plugins, and everything under “Automate and scale”; irrelevant inside a 45-minute interview.
  3. Go deeper

    Effective context engineering for AI agents (opens in a new tab)

    Anthropic Engineering · Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, Jeremy Hadfield · 25 min · Free · checked 21 Oct 2026

    Why
    The 'long context vs RAG' question has shifted to 'when should the agent retrieve just-in-time instead of pre-loading', and this is the vendor-side argument interviewers now quote.
    What to read
    Read “Why context engineering is important to building capable agents” (context rot), “Context retrieval and agentic search” (pre-inference embedding retrieval vs. just-in-time loading, the hybrid) and “Context engineering for long-horizon tasks” (compaction, structured note-taking, sub-agents).
    What to skip
    “Context engineering vs. prompt engineering”, “The anatomy of effective context” (system-prompt and tool-design advice, not RAG) and the acknowledgements.
  4. Go deeper

    MemGPT: Towards LLMs as Operating Systems (opens in a new tab)

    arXiv · Charles Packer et al. · 40 min · Free · checked 21 Oct 2026

    Why
    The virtual-memory analogy (main context versus paged-in external context, with the model issuing its own memory edits) is the reference design interviewers reach for when they ask you to build cross-conversation memory.
    What to read
    Read “1 Introduction” and all of “2 MemGPT (MemoryGPT)” (2.1 Main context, 2.2 Queue Manager, 2.3 Function executor, 2.4 Control flow and function chaining), then skim “3.1 MemGPT for conversational agents”.
    What to skip
    “3.2 MemGPT for document analysis”, “4 Related Work” and the appendix prompts.
  5. Go deeper

    Generative Agents: Interactive Simulacra of Human Behavior (opens in a new tab)

    arXiv · Joon Sung Park et al. · 40 min · Free · checked 22 Oct 2026

    Why
    Its memory stream, scored by recency, importance and relevance and then distilled into reflections, is the reference design behind most agent memory questions.
    What to read
    Read §4 with Figure 5: §4.1 on the memory stream and the retrieval score, §4.2 on reflection, §4.3 on planning and reacting. Then read §6.5 for the ablation showing each part matters, and §7.2 on where it breaks.
    What to skip
    Skip §2 related work, §3’s narrative examples, §5 sandbox implementation and §8.3 ethics.

Companies that test Agents most

Put Context engineering and agent memory in your plan

Tell us your interview date and hours a day; it lands on the right day, in the right order.

Build my plan