Slides · LangChain ecosystem

LangChain ecosystem: interview drills

LangChain ecosystem: interview drills

Turning the module into spoken answers: a ninety-second opener, whiteboard arithmetic, a forty-minute design structure and symptom diagnosis.

By the end you can place each product aloud, work the standard derivations, structure a design answer for an agent with approvals, and name likely causes in order with the first check.

Concept

How to use these drills

  • Answer aloud, under a clock, before opening the key. Reading a drill teaches little.
  • Provenance: each drill slide carries its own label, Common industry pattern or Generated practice. None is verified as asked by a named company, and this deck makes no such claim.
  • The lesson observes that interviewers for agent roles tend to probe placement of each product, where state and side effects live, and whether you raise budgets and evaluation unprompted. That is the lesson’s observation, not a measured fact.
  • Product and API names are as read in the docs on 24 October 2026. If your interview uses a newer version, say which version you last read.

Diagram

The order of a strong answer

Diagram: Every answer, from a ninety-second explanation to a forty-minute design, follows four moves: name the job, pick the smallest part that does...

1 What the job needs

2 The smallest part

3 What it costs

4 How you will know

Diagram summary: Every answer, from a ninety-second explanation to a forty-minute design, follows four moves: name the job, pick the smallest part that does it, state its cost, and say how you will know it works. The order matters more than any single component.

Worked example

The ninety-second opener, with its evidence

Provenance: Common industry pattern.

“LangChain gives a common model interface and create_agent for the standard tool loop. LangGraph is the stateful runtime underneath it, with explicit state, saved checkpoints, interrupts and streaming, for anything custom, long-running or needing approval. LangSmith is tracing, evaluation and deployment, and works with other frameworks too. I start with the simplest thing that works: the provider SDK, then create_agent, then a graph.”

Claim in the answerWhat the docs say (read 24 October 2026)
create_agent is built on LangGraphThe LangChain overview says its agents are built on LangGraph
LangGraph stands aloneThe LangGraph overview says it can be used without LangChain
LangSmith is not tied to the librariesThe custom-instrumentation guide traces plain functions with a decorator

Sources1 LangChain overview (LangChain documentation)2 LangGraph overview (LangGraph documentation)3 Custom instrumentation (LangSmith documentation)

Compare

Match the job to the smallest part

Provenance: Generated practice.

JobSmallest part that does itWhat going further costs
One call that returns a typed resultThe provider SDK, or structured output on a modelA framework adds concepts for no gain
A tool-using assistant with a standard loopcreate_agentA graph adds state design and more to test
Approvals, resumable state, custom branchingA LangGraph graphA runtime to host and operate
Hosted durable runs, scheduling, many assistantsLangSmith DeploymentA server to run or rent

Pick the row that fits your case and say it aloud as your judgement line, with the cost in the last column. This table is course advice.

Check yourself

Check: critique this opener

Provenance: Generated practice.

A candidate says: “We use LangChain, LangGraph, LangSmith and Deep Agents. They are all from the same company, so it is the standard stack, and I would use all of them on any agent project.” Using the four-move order, what is missing, and how would you repair it in two sentences?

Answer

Only names are listed. There is no job, so no smallest part (move 2), no cost (move 3) and no way to know it works (move 4); “all of them on any project” is tool-first. Repair: “For a tool-using assistant with a standard loop I would start with create_agent; I would move to a LangGraph graph only when I need approvals, resumable state or custom branching, because each step adds code to operate. Either way I would trace from the start and gate changes with an offline evaluation.”

Compare

Rapid-fire answers, part 1 (about twenty seconds each)

Provenance: Generated practice.

QuestionAnswer, as the docs read on 24 October 2026
What is create_agent built on?LangGraph
Does LangGraph require LangChain?No; it can be used without it
What does a reducer do?It is the merge rule for one state key; with none, updates to that key overwrite
What is a super-step?A single iteration over the graph nodes; parallel nodes share one
What does the recursion limit count?Super-steps, not node calls; reaching it raises GraphRecursionError
What is Command(resume=...) for?It is the input pattern for continuing a paused run; its value becomes the return value of interrupt

Sources1 LangChain overview (LangChain documentation)2 LangGraph overview (LangGraph documentation)4 Graph API overview (LangGraph documentation)5 Interrupts (LangGraph documentation)

Compare

Rapid-fire answers, part 2

Provenance: Generated practice.

QuestionAnswer
What goes wrong if a side effect sits before interrupt?The node re-runs from its start on resume, so the effect runs again
Name the double-texting strategiesEnqueue, reject, interrupt, rollback
Are they open-source features?No; they belong to the deployment product
What can online evaluation not use?Reference outputs, because production runs have none
Can LangSmith trace code that does not use LangChain?Yes, for example with the traceable decorator
Where does the tenant or user id come from?The authenticated context, passed as runtime context, never the model

Sources5 Interrupts (LangGraph documentation)6 Double texting (LangSmith documentation)7 Evaluation concepts (LangSmith documentation)3 Custom instrumentation (LangSmith documentation)8 Authentication and access control (LangSmith documentation)

Math

The standard formulas

Provenance: Generated practice.

checkpoint bytes per day=conversations×steps×state size\text{checkpoint bytes per day} = \text{conversations} \times \text{steps} \times \text{state size}cost per resolved=cost per attemptresolution rate\text{cost per resolved} = \frac{\text{cost per attempt}}{\text{resolution rate}}traces kept per day=S+E×(1−s)\text{traces kept per day} = S + E \times (1 - s)all attempts fail=qn\text{all attempts fail} = q^{n}
SymbolMeaning
steps\text{steps}Saved checkpoints per conversation
state size\text{state size}Bytes written at each checkpoint (assumes the full state is stored each time)
SSOrdinary conversations sampled per day
EEErrored runs per day, all kept
ssSampling rate (an errored run already in the sample is not counted twice)
qqChance one attempt fails
nnAttempts in total, including the first

qnq^{n} assumes failures are independent; real failures often cluster, so say “roughly”.

Worked example

Worked: checkpoint volume

Provenance: Generated practice.

12,000 conversations a day, 18 saved steps each, 30 KB of state per step (illustrative).

StepArithmeticResult
Checkpoints per day12,000×1812{,}000 \times 18216,000
Bytes per day216,000×30 KB216{,}000 \times 30\ \text{KB}6,480,000 KB, about 6.5 GB
Thirty days kept6.48 GB×306.48\ \text{GB} \times 30about 194 GB
If only the final state were stored12,000×30 KB12{,}000 \times 30\ \text{KB}about 0.36 GB a day

The async default writes a checkpoint after each step, and exit stores only the final state, per the Agent Server page. The gap is the cost of being able to resume mid-run. Say what follows: keep references to documents in state, not the documents, and set retention.

Source9 Agent Server (LangSmith documentation)

Worked example

Worked: cost per resolved conversation

Provenance: Generated practice.

Design P: 4 model calls at 1.5 cents each plus 2 cents of other cost, resolving 64 percent without a person. Design Q: 10 cents per conversation, resolving 90 percent. All illustrative.

DesignArithmeticPer resolved
P(4×1.5+2)=8 cents(4 \times 1.5 + 2) = 8\ \text{cents}; 8/0.648 / 0.6412.5 cents
Q10/0.9010 / 0.90about 11.1 cents

Q costs 25 percent more per attempt (10/810 / 8) yet less per result, because fewer attempts fail. Quote the cost per resolved task, not per call. Unresolved conversations still cost money, and the resolved ones carry that cost.

Worked example

Worked: a trace sampling budget

Provenance: Generated practice.

Keep 5 percent of ordinary conversations and every errored run. 25,000 conversations a day, 2 percent error. Assume errors fall evenly across the sample.

StepArithmeticResult
Sampled5% of 25,0001,250
Errors2% of 25,000500
Errors already sampled5% of 50025
Extra errors to add500 - 25475
Traces kept1,250 + 4751,725

Adding 1,250 and 500 gives 1,750 and double-counts the 25. Say the assumption aloud; if errors cluster in the unsampled traffic the figure changes.

Worked example

Worked: the load that retries add

Provenance: Generated practice.

A tool fails 8 percent of the time per attempt and is tried up to 4 times in total (illustrative), with independent failures.

QuantityArithmeticResult
All four attempts fail0.0840.08^{4}0.00004096, about 1 request in 24,000
Expected calls per request1+0.08+0.082+0.0831 + 0.08 + 0.08^{2} + 0.08^{3}1.0869
Extra calls at 100,000 requests a day100,000×0.0869100{,}000 \times 0.0869about 8,700

A second attempt happens only if the first failed, a third only if two failed, and so on, which is why the expected count is a short sum and not 4. The extra calls land on the failing service, so retries need back-off and a cap. The independence assumption is the weak point.

Worked example

Worked: what a recursion limit allows

Provenance: Generated practice.

A graph normally takes 8 super-steps and you set the recursion limit to 40. Assume one model call per super-step at 1.2 cents (illustrative).

QuantityArithmeticResult
Normal run8×1.28 \times 1.29.6 cents
Upper bound at the limit40×1.240 \times 1.248 cents
Ratio40/840 / 85 times

The 48 cents is an upper bound: when one round trip uses two super-steps, as a model node plus a tool node does, only about half as many model calls happen before the error. The limit bounds super-steps, and hitting it raises GraphRecursionError. It does not bound money per step, so add a model-call limit and a step counter in state, and alert when the limit is hit.

Source4 Graph API overview (LangGraph documentation)

Check yourself

Check: a smaller sampling budget

Provenance: Generated practice.

40,000 conversations a day. Keep 2 percent of ordinary conversations and every errored run; 4 percent of runs error, spread evenly across the sample. How many traces are kept a day, and what changes if the error rate doubles?

Answer

Sampled: 2% of 40,000 = 800. Errors: 4% of 40,000 = 1,600, of which 2% (32) are already sampled, leaving 1,568. Total 800 + 1,568 = 2,368. If the error rate doubles to 8 percent: 3,200 errors, 64 already sampled, 3,136 extra, total 3,936. Errors dominate the budget at low sampling rates, so an incident can multiply trace volume and cost.

Check yourself

Check: size a loop cap

Provenance: Generated practice.

A run normally takes 6 super-steps. You set the recursion limit to 36, and each super-step makes one model call at 1.5 cents (illustrative). What does a run that hits the limit cost against a normal run, and what second guard would you add?

Answer

Normal: 6×1.5=96 \times 1.5 = 9 cents. At the limit: at most 36×1.5=5436 \times 1.5 = 54 cents, up to six times as much (fewer if a round trip uses two super-steps). The limit counts super-steps, not spend, so add a model-call limit or a cost budget per run, plus a step counter in state that treats nearing the limit as an alert. A limit that is far above the normal path lets a runaway burn many times a normal run before it stops.

Process

The eight parts of a forty-minute design

Provenance: Common industry pattern.

  1. Clarify: before drawing anything, ask what success looks like, who signs off on money, how fast it must be and which rules apply.
  2. Shape: the smallest structure that fits, such as a router and two paths; a graph when there is validation and approval.
  3. State and memory: one thread per conversation on a database-backed checkpointer; a store for preferences; the user id passed as context.
  4. Tools: scoped, with idempotency keys, caps and ownership checks.
  5. Guardrails: redaction before tracing, untrusted tool text, per-run limits, a kill switch.
  6. Evaluation: a dataset from real cases plus adversarial ones, trajectory checks, online checks.
  7. Deployment: workers scaled on queue depth, gradual release, rollback, a chosen double-texting strategy.
  8. Failure modes: outage, duplicate resume, stale data, long histories.

Diagram

Drill A at a glance: a support agent with refunds

Provenance: Common industry pattern.

Diagram: A router splits policy questions from order questions, and a refund over a threshold pauses for approval before it is issued with an...

yes

no

Customer message

Router: cheap model

Policy path: retrieve

Order path: look up

Over the threshold?

Interrupt: approval

Refund, idempotency key

Diagram summary: A router splits policy questions from order questions, and a refund over a threshold pauses for approval before it is issued with an idempotency key. Not drawn: every path is traced and failures feed the evaluation dataset.

Concept

Drill A: the points that carry marks

Provenance: Common industry pattern.

  • Approval: the refund sits after the interrupt, because the node re-runs from its start on resume; a call before it would repeat.
  • Duplicate resume: an idempotency key lets the server recognise a retried request, as the Stripe docs describe for safe retries.
  • Identity: the customer id comes from the authenticated context, passed as runtime context, never from the model.
  • Evaluation: offline experiments on historical tickets before release; online checks must be reference-free, since live traffic has no reference outputs.
  • Leave to people: name what you would not automate, such as large refunds or suspected fraud, and say why.

Sources5 Interrupts (LangGraph documentation)10 Idempotent requests8 Authentication and access control (LangSmith documentation)7 Evaluation concepts (LangSmith documentation)

Compare

Drills B and C: key points

AspectB: research agent (40 minutes)C: code-review assistant (30 minutes)
ShapePlanner emits tasks; Send starts a worker per source; an append reducer collects findingsA pull-request event; split by file; parallel reviewers by concern; merge, rank, post
Risk to nameWeb pages are untrusted, so the summariser step should have no toolsFalse positives, and secrets in diffs
IdempotencyCheckpoints so a crash does not repeat searchesComments posted with a key so a retry does not comment twice
EvaluationCitation accuracy, coverage against a rubric, hallucination rateBuilt from past accepted and rejected comments

Provenance: Generated practice. The point is to walk the eight parts in order.

Worked example

Worked: re-costing when volume jumps tenfold

Provenance: Generated practice.

The refund agent handles 20,000 conversations a day at 8 cents each (illustrative). The interviewer says volume is now ten times higher.

AspectArithmeticResult
Today20,000×0.0820{,}000 \times 0.081,600 dollars a day
Ten times the volume, same cost per conversation200,000×0.08200{,}000 \times 0.0816,000 dollars a day
Per-conversation budget to hold 1,600 dollars1,600/200,0001{,}600 / 200{,}0000.8 cents

Say the choice aloud: a cheaper model for routing, shorter histories and caching can cut cost per conversation, but 0.8 cents is a tenth of today’s, so also consider escalating less and sampling fewer traces. Name the risk you accept, such as lower quality on the cheap path, and how you would measure it.

Check yourself

Check: place a failure in the eight parts

Provenance: Generated practice.

In drill C, a retried job posts the same review comment twice on one pull request. Which of the eight parts should have prevented it, what exactly is the fix, and which other drill-C failure belongs to the same part?

Answer

Part 4, tools: the posting tool must be safe to repeat. Give each comment a stable key (for example pull request, file, line and a hash of the text) and have the tool skip a key it has already posted. Part 8 should list the failure so it is tested. Another drill-C item in the same part is rate limits on the hosting platform’s API, handled in the tool with back-off rather than in the model.

Check yourself

Check: re-cost against a fixed budget

Provenance: Generated practice.

A travel-booking agent handles 5,000 conversations a day at 12 cents each (illustrative), which is the budget. The interviewer says volume will reach 40,000 a day and the budget cannot change. What per-conversation cost holds the budget, and what two options would you offer?

Answer

Budget: 5,000×0.12=6005{,}000 \times 0.12 = 600 dollars a day. At 40,000 conversations: 600/40,000=1.5600 / 40{,}000 = 1.5 cents each, one eighth of today. Option 1: cut cost per conversation with a cheaper model on easy turns, shorter histories and caching, and measure what quality is lost. Option 2: triage, giving the full-cost path to the 5,000 conversations most likely to benefit (600/0.12600 / 0.12) and a cheap path or a human to the rest. State the risk of each aloud.

Diagram

Diagnose in order: cause, then first check

Provenance: Generated practice.

Diagram: Say the symptom back, list likely causes in order, name the cheapest check that separates them, then fix the structure that allowed it and...

A described symptom

Causes, likeliest first

Name the first check

Fix the structure

Add a regression test

Diagram summary: Say the symptom back, list likely causes in order, name the cheapest check that separates them, then fix the structure that allowed it and add a test that reproduces the symptom. Naming the first check is what separates a diagnosis from a guess.

Compare

Symptoms, causes in order, first check

Provenance: Common industry pattern.

SymptomCauses to walk throughFirst check
Loops until the recursion errorNo stop condition; a tool error the model cannot see; vague tool descriptionsThe last few tool calls in the trace
Duplicated messages in stateA reducer misused; a node re-adding historyWhat the node returns
Parallel branches raise an invalid updateA key written by two nodes with no reducerThe state definition
Score up, users unhappyJudge bias; a dataset that no longer matches real questions; a slice that got worseScores by slice, and a read of ten failures
The bill tripled after a releaseA changed prompt prefix defeating caching; summarising turned off; more tool calls; bigger retrieved chunks; retriesTokens per run, by run type, in the traces
A tool returned another customer’s dataA model-supplied id; no ownership check; a shared cache keyWhere the id in the call came from

Code

Reproducing three symptoms

Provenance: Generated practice.

Sketch of the three setups; each was run, with the fixed version as the control.

Python

class S1(TypedDict):
    notes: list                      # no reducer: later updates overwrite
# nodes "a" and "b" both return {"notes": [...]} in the same super-step
# fix: notes: Annotated[list, operator.add]

# refund call placed BEFORE interrupt(...) in the node; approve, then resume
# fix: move the call after interrupt(...), keyed for idempotency

app.invoke({"msgs": ["hi"]}, {"configurable": {"thread_id": new_id}})
SymptomObserved (langgraph 1.2.17, in-memory saver, 24 October 2026)
Two branches write one key, no reducerInvalidUpdateError; with an add reducer the result was ['a', 'b']
Side effect before the interruptit ran 2 times across pause and resume; after the interrupt, 1 time
New thread id each requesteach call started empty; the same id kept earlier turns
No checkpointer at alleach call started empty

Print the saved state for two consecutive calls before suspecting the model: if it is empty, the cause is in how state is stored or looked up.

Sources5 Interrupts (LangGraph documentation)11 Persistence (LangGraph documentation)4 Graph API overview (LangGraph documentation)

Check yourself

Check: another customer’s data

Provenance: Generated practice.

A support agent’s order tool returns the wrong customer’s orders for one user. Name the likely causes in order and the first check, then a structural fix.

Answer

Likely causes: the model chose the customer id and picked wrongly or was manipulated; the tool has no ownership check; a cache is keyed without the customer. First check: in the trace, where the id in the tool call came from. Structural fix: take the id from the authenticated context in the run configuration, never from model output, and have the tool refuse any record the caller does not own. Add a regression task that tries to read another customer’s order.

Check yourself

Check: the score went up and users complained

Provenance: Generated practice.

After a prompt change the offline evaluation score rose from 0.81 to 0.85, yet support tickets about answer quality increased. Give causes in order and the first check.

Answer

Likely causes: the dataset no longer matches real questions; one slice (a language, a product line) got worse while the average rose; judge bias, such as a model judge favouring longer answers; latency or format changes the score ignores. First check: scores broken down by slice, then a read of about ten failing real conversations. Then add those conversations to the dataset so the next offline run can catch the regression.

Process

A 45-minute mock

Provenance: Generated practice.

  1. 0 to 5 minutes, warm-up: how do the three products relate, and when would you use none?
  2. 5 to 15, depth: reducers and super-steps, interrupt behaviour, checkpointer versus store, middleware hooks.
  3. 15 to 35, design: drill A, or drill B at the interviewer’s choice; the interviewer changes a constraint twice.
  4. 35 to 42, debug: two symptoms from the table, at random.
  5. 42 to 45, close: the three biggest risks and what you would measure first.

The interviewer does not teach during the mock. Afterwards note the two places you lost the thread and repeat those on a nearby variant a few days later.

Summary

Recap

  • Every answer follows four moves: the job, the smallest part, its cost, how you will know.
  • Place the products: LangChain for the quick path, LangGraph for state and control, LangSmith for tracing, evaluation and deployment; start with the SDK, and name when you would use none.
  • Know the derivations: checkpoints, cost per resolved task, trace budget, all attempts failing and loop caps; say the independence assumption.
  • Design in eight parts and re-cost aloud when a constraint changes.
  • Diagnose by naming causes in order and the first check, then fix the structure and add a test.

References

References & Sources (1 of 3)

  1. LangChain overview (LangChain documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for create_agent as a minimal harness built on LangGraph, a standard model interface, middleware for added capability, and LangSmith for tracing and evaluation. Read 24 October 2026.

  2. LangGraph overview (LangGraph documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for LangGraph as a low-level orchestration framework and runtime that can be used without LangChain, with durable execution and human-in-the-loop.

  3. Custom instrumentation (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Tracing code that does not use LangChain, with the traceable decorator, the trace context manager or the RunTree API.

  4. Graph API overview (LangGraph documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Per-key reducers (default: overwrite), the super-step definition, and the recursion limit counting super-steps with GraphRecursionError at the limit.

  5. Interrupts (LangGraph documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for A node re-runs from its start on resume, so work before an interrupt repeats; Command(resume=...) is the input pattern; resume values pair by position.

References

References & Sources (2 of 3)

  1. Double texting (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for The four double-texting strategies and the fact that they belong to the deployment product.

  2. Evaluation concepts (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Offline evaluation on datasets, and online evaluation on production runs that have no reference outputs.

  3. Authentication and access control (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Identity from the authenticated context reaches the graph through the run configuration; thread ownership by metadata filter.

  4. Agent Server (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for The async (default) and exit checkpoint durability modes, used to size checkpoint writes.

  5. Idempotent requests (opens in a new tab)

    Stripe2026Documentation

    Used for Idempotency keys make a retried request safe against performing the same operation twice.

References

References & Sources (3 of 3)

  1. Persistence (LangGraph documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Checkpointers keyed by thread_id; in-memory checkpoints are lost on restart.