AI Interviews · Question

Take-home: build an agent, then discuss your solution, then an applied system-design round.

Take-home / ML / LLM system design question reported at LangChain (2025). Sources, confidence and an answer card.

Researched · updated

eng-031 AI Engineer Agent design & reliability Take-homeML / LLM system design Low confidence
On this page

What they’re really asking

If you only remember one thing, say this in the first minute: “I built the simplest agent that solves the task: fixed steps where the steps are known, and a model-driven tool loop only where the next step depends on what a tool returned. Every tool call is checked, every run has a step cap and a token budget, and a labelled set measures it. In the design round I grow this same system, adding per-user state, runs that survive restarts, the eval as a release gate, and cost limits, rather than starting from a blank whiteboard.”

The rest of this page explains each part of that answer.

The reported sequence has three stages: a take-home agent, a discussion of your solution, then an applied system-design round. The question underneath: can you build a small agent that works, explain it, and then scale your own design under questioning? The three stages reward one consistent story, so build the take-home with the design round in mind.

What makes this different from a normal take-home

In a normal take-home every component does what its documentation says. Here the centre is a large language model (LLM), a program reached through an API that reads text and writes text and is sometimes wrong. In an agent, the model also decides what to do next: it asks your code to run a tool (a function such as search_docs or create_ticket), reads the result, and decides again. That makes the program’s path, its cost and its failures depend on the model’s choices. Your job is to keep those choices inside limits you set, and to show you can turn the prototype into a production system.

Words you need first

  • Workflow: your code fixes the order of steps; the model fills in one decision per step.
  • Tool loop: the model picks the next tool call each time, until it decides it is done. Each round trip is a step.
  • Step cap: a hard limit on steps per run, so a confused model can’t loop forever.
  • Tokens: the pieces of words (about ¾ of a word each) that models read and write, and that providers bill.
  • Eval (evaluation): a labelled set of tasks with known right outcomes, plus a script that scores the agent.

Where it was reported

A Reddit report relayed by a research repo AI Engineering Field Guide (GitHub)secondary. Low confidence, and it gives no detail on the task.

Clarify first

  • What is the task, and what counts as the agent being right? Assume you define a labelled set of 20–30 tasks.
  • Should you use the company’s own framework? LangChain builds agent frameworks (libraries that wrap the model loop, tools and memory), so ask. If they expect it, know what it does under the hood; if not, plain code is easier to defend.
  • What does the design round cover? Assume it starts from your take-home and adds scale, users and failure.
  • AI tools allowed? Ask.

Answer

The take-home: simplest control flow that works

Pick the simplest control flow that solves the task. A fixed sequence of model calls is a workflow. Use a tool loop only where the next step depends on what a tool returned. Check every tool call against a schema (the declared names and types of its arguments), cap steps and tokens per run, make writes confirmable and idempotent (safe to run twice), and ship a labelled eval with pass rates and the failures you read. Anthropic’s agent guidance argues for starting with direct API calls and adding agentic complexity only when it pays (Building effective agents, 2024-12-19).

Say it like this: “Where I knew the steps, I wrote them. I let the model choose only where the next step really depends on what it found.”

A picture of the take-home, with the production seams marked

Task in
   │
   ▼
Orchestrator (your code) ── owns step order, step cap, token budget
   │   [seam: state store — in memory now, durable later]
   ▼
Model ── chooses: final answer │ tool call
   │
   ▼
Tool layer ── schema check, permissions, idempotent writes
   │   [seam: per-tenant credentials later]
   ▼
Tools (search, lookup, write)
   │
   ▼
Trace log ── step, tool, tokens, outcome
       [seam: becomes production tracing + the eval gate in CI]

Orchestrator. Plain code that runs the loop and enforces the limits. Keeping control here, not in the prompt, is what makes behaviour predictable.

Model. One decision per step: answer, or call a tool.

Tool layer. Checks every call and refuses anything outside policy.

Trace log. One record per step. In the take-home it is a file; in production it is your tracing system.

The marked seams are the places you will change in the design round. Building them as clean boundaries now is what lets you grow the system instead of redrawing it.

The discussion: decisions, not code

Lead with decisions: why a workflow or a loop, why these tools, what the step cap protects against, what failed in your eval and what you changed. Have the alternative ready for each choice.

The design round: grow the same system

Prepare these extensions in advance:

  • Many users: per-user state and memory, separate tool credentials per customer, rate limits.
  • Long runs: state stored durably so a run survives a restart, resumable steps, human approval that can wait hours.
  • Quality at scale: the labelled set becomes a CI gate on prompt and model changes; a trace per run with step, tool, tokens and outcome; online metrics such as task success and how often a human overrides the agent.
  • Cost: each step resends the whole conversation, so input tokens grow faster than the number of steps. Caps and prompt caching (the provider bills a repeated opening part of the prompt more cheaply) are design decisions, not tuning.

Saying “here is what my take-home would need to become production” is the bridge the interviewers are likely looking for, in my reading.

Follow one run’s cost as steps grow

A model keeps no memory between calls, so step 10 resends everything from steps 1–9. With an assumed 4,000-token start and 1,000 tokens added per step, on Claude Sonnet 5 at $2 per 1M input tokens (fetched 2026-10-11):

StepsInput tokens sent in totalInput costWhat to say in the interview
1095,000$0.19”A typical run.”
30585,000$1.17”Three times the steps, six times the cost. That’s why the cap is a design decision.”

Senior vs Staff

Take-home to design round

Senior

  • Working agent with bounded loop and eval; scales it with sensible components when asked.

Staff

  • Designs the take-home so its seams (state, tools, eval) are the ones production needs, and drives the design round by naming what breaks first at 10× and 100× and how they'd know.

In plain words: Senior builds a working, bounded agent and scales it when asked. Staff builds the take-home with production’s boundaries already in place, and leads the design round by saying what breaks first as load grows.

Small-team version

The same arc happens at work: a prototype someone liked, then the question of whether it can serve the whole company. Keep the prototype in plain code with its eval, add durable state and tracing when it gets real users, and adopt a framework only for a capability you would otherwise build, such as durable execution (a system that saves each step so a long run resumes after a crash).

Put a step cap and a token budget on every run, because input grows with the square of the step count, as the table above shows. Default: a managed API, plain code, a cap of 10 steps. Revisit the cap with traces that show where runs end.

The arithmetic behind the numbers (for a Staff-level follow-up)
  • If the first call sends C0 tokens and each step adds Δ, step k sends C0 + k × Δ, so input over N steps is N × C0 + Δ × N(N+1)/2.
  • C0 = 4,000, Δ = 1,000 (assumed). N = 10: 40,000 + 1,000 × 55 = 95,000 tokens × $2 per million = $0.19.
  • N = 30: 120,000 + 1,000 × 465 = 585,000 tokens = $1.17, about six times more for three times the steps.

Pitfalls

  • Several agents for a one-loop task. A multi-agent design adds hand-offs and failure points that a single loop doesn’t need.
  • Starting the design round from scratch. It throws away the system the interviewers just watched you build and explain.
  • Using or avoiding the company’s framework without a reason. Either choice is fine; not being able to explain it is not.

Go deeper

Family