Slides · LangChain ecosystem
LangChain ecosystem: interview drills
1 / 33
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
Worked example
The ninety-second opener, with its evidence
Provenance: Common industry pattern.
“LangChain gives a common model interface and
create_agentfor 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, thencreate_agent, then a graph.”
| Claim in the answer | What the docs say (read 24 October 2026) |
|---|---|
create_agent is built on LangGraph | The LangChain overview says its agents are built on LangGraph |
| LangGraph stands alone | The LangGraph overview says it can be used without LangChain |
| LangSmith is not tied to the libraries | The custom-instrumentation guide traces plain functions with a decorator |
Sources[1] 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.
| Job | Smallest part that does it | What going further costs |
|---|---|---|
| One call that returns a typed result | The provider SDK, or structured output on a model | A framework adds concepts for no gain |
| A tool-using assistant with a standard loop | create_agent | A graph adds state design and more to test |
| Approvals, resumable state, custom branching | A LangGraph graph | A runtime to host and operate |
| Hosted durable runs, scheduling, many assistants | LangSmith Deployment | A 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.
| Question | Answer, 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 |
Sources[1] 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.
| Question | Answer |
|---|---|
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 strategies | Enqueue, 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 |
Sources[5] 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 sizecost per resolved=resolution ratecost per attempttraces kept per day=S+E×(1−s)all attempts fail=qn| Symbol | Meaning |
|---|---|
| steps | Saved checkpoints per conversation |
| state size | Bytes written at each checkpoint (assumes the full state is stored each time) |
| S | Ordinary conversations sampled per day |
| E | Errored runs per day, all kept |
| s | Sampling rate (an errored run already in the sample is not counted twice) |
| q | Chance one attempt fails |
| n | Attempts in total, including the first |
qn 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).
| Step | Arithmetic | Result |
|---|---|---|
| Checkpoints per day | 12,000×18 | 216,000 |
| Bytes per day | 216,000×30 KB | 6,480,000 KB, about 6.5 GB |
| Thirty days kept | 6.48 GB×30 | about 194 GB |
| If only the final state were stored | 12,000×30 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.
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.
| Design | Arithmetic | Per resolved |
|---|---|---|
| P | (4×1.5+2)=8 cents; 8/0.64 | 12.5 cents |
| Q | 10/0.90 | about 11.1 cents |
Q costs 25 percent more per attempt (10/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.
| Step | Arithmetic | Result |
|---|---|---|
| Sampled | 5% of 25,000 | 1,250 |
| Errors | 2% of 25,000 | 500 |
| Errors already sampled | 5% of 500 | 25 |
| Extra errors to add | 500 - 25 | 475 |
| Traces kept | 1,250 + 475 | 1,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.
| Quantity | Arithmetic | Result |
|---|---|---|
| All four attempts fail | 0.084 | 0.00004096, about 1 request in 24,000 |
| Expected calls per request | 1+0.08+0.082+0.083 | 1.0869 |
| Extra calls at 100,000 requests a day | 100,000×0.0869 | about 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).
| Quantity | Arithmetic | Result |
|---|---|---|
| Normal run | 8×1.2 | 9.6 cents |
| Upper bound at the limit | 40×1.2 | 48 cents |
| Ratio | 40/8 | 5 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.
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=9 cents. At the limit: at most 36×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.
- Clarify: before drawing anything, ask what success looks like, who signs off on money, how fast it must be and which rules apply.
- Shape: the smallest structure that fits, such as a router and two paths; a graph when there is validation and approval.
- State and memory: one thread per conversation on a database-backed checkpointer; a store for preferences; the user id passed as context.
- Tools: scoped, with idempotency keys, caps and ownership checks.
- Guardrails: redaction before tracing, untrusted tool text, per-run limits, a kill switch.
- Evaluation: a dataset from real cases plus adversarial ones, trajectory checks, online checks.
- Deployment: workers scaled on queue depth, gradual release, rollback, a chosen double-texting strategy.
- Failure modes: outage, duplicate resume, stale data, long histories.
Diagram
Drill A at a glance: a support agent with refunds
Provenance: Common industry pattern.
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.
Sources[5] Interrupts (LangGraph documentation)[10] Idempotent requests[8] Authentication and access control (LangSmith documentation)[7] Evaluation concepts (LangSmith documentation)
Compare
Drills B and C: key points
| Aspect | B: research agent (40 minutes) | C: code-review assistant (30 minutes) |
|---|---|---|
| Shape | Planner emits tasks; Send starts a worker per source; an append reducer collects findings | A pull-request event; split by file; parallel reviewers by concern; merge, rank, post |
| Risk to name | Web pages are untrusted, so the summariser step should have no tools | False positives, and secrets in diffs |
| Idempotency | Checkpoints so a crash does not repeat searches | Comments posted with a key so a retry does not comment twice |
| Evaluation | Citation accuracy, coverage against a rubric, hallucination rate | Built 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.
| Aspect | Arithmetic | Result |
|---|---|---|
| Today | 20,000×0.08 | 1,600 dollars a day |
| Ten times the volume, same cost per conversation | 200,000×0.08 | 16,000 dollars a day |
| Per-conversation budget to hold 1,600 dollars | 1,600/200,000 | 0.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=600 dollars a day. At 40,000 conversations: 600/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.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.
Compare
Symptoms, causes in order, first check
Provenance: Common industry pattern.
| Symptom | Causes to walk through | First check |
|---|---|---|
| Loops until the recursion error | No stop condition; a tool error the model cannot see; vague tool descriptions | The last few tool calls in the trace |
| Duplicated messages in state | A reducer misused; a node re-adding history | What the node returns |
| Parallel branches raise an invalid update | A key written by two nodes with no reducer | The state definition |
| Score up, users unhappy | Judge bias; a dataset that no longer matches real questions; a slice that got worse | Scores by slice, and a read of ten failures |
| The bill tripled after a release | A changed prompt prefix defeating caching; summarising turned off; more tool calls; bigger retrieved chunks; retries | Tokens per run, by run type, in the traces |
| A tool returned another customer’s data | A model-supplied id; no ownership check; a shared cache key | Where 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}})| Symptom | Observed (langgraph 1.2.17, in-memory saver, 24 October 2026) |
|---|---|
| Two branches write one key, no reducer | InvalidUpdateError; with an add reducer the result was ['a', 'b'] |
| Side effect before the interrupt | it ran 2 times across pause and resume; after the interrupt, 1 time |
| New thread id each request | each call started empty; the same id kept earlier turns |
| No checkpointer at all | each 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.
Sources[5] 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.
- 0 to 5 minutes, warm-up: how do the three products relate, and when would you use none?
- 5 to 15, depth: reducers and super-steps, interrupt behaviour, checkpointer versus store, middleware hooks.
- 15 to 35, design: drill A, or drill B at the interviewer’s choice; the interviewer changes a constraint twice.
- 35 to 42, debug: two symptoms from the table, at random.
- 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)
LangChain overview (LangChain documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/oss/python/langchain/overview
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.
LangGraph overview (LangGraph documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/oss/python/langgraph/overview
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.
Custom instrumentation (LangSmith documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/langsmith/annotate-code
Used for Tracing code that does not use LangChain, with the traceable decorator, the trace context manager or the RunTree API.
Graph API overview (LangGraph documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/oss/python/langgraph/graph-api
Used for Per-key reducers (default: overwrite), the super-step definition, and the recursion limit counting super-steps with GraphRecursionError at the limit.
Interrupts (LangGraph documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/oss/python/langgraph/interrupts
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)
Double texting (LangSmith documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/langsmith/double-texting
Used for The four double-texting strategies and the fact that they belong to the deployment product.
Evaluation concepts (LangSmith documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/langsmith/evaluation-concepts
Used for Offline evaluation on datasets, and online evaluation on production runs that have no reference outputs.
Authentication and access control (LangSmith documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/langsmith/auth
Used for Identity from the authenticated context reaches the graph through the run configuration; thread ownership by metadata filter.
Agent Server (LangSmith documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/langsmith/agent-server
Used for The async (default) and exit checkpoint durability modes, used to size checkpoint writes.
Idempotent requests (opens in a new tab)
Stripe2026Documentation
https://docs.stripe.com/api/idempotent_requests
Used for Idempotency keys make a retried request safe against performing the same operation twice.
References
References & Sources (3 of 3)
Persistence (LangGraph documentation) (opens in a new tab)
LangChain2026Documentation
https://docs.langchain.com/oss/python/langgraph/persistence
Used for Checkpointers keyed by thread_id; in-memory checkpoints are lost on restart.
Keys: ← → move, Home End first and last, F full screen.