Interview questions with answers
LangSmith interview questions and answers
Tracing, datasets, evaluators, experiments and monitoring. Open any question to read its model answer; the multiple-choice set marks the right option and explains it.
- Subjective
- 30
- Objective
- 30
Subjective questions 30
1What is LangSmith and why use it?Asked almost every time
LangSmith is a platform for observing, evaluating and improving LLM applications. It records traces of every run (model calls, tools, retrieval, with inputs, outputs, tokens, cost and latency), lets you build datasets and run evaluations, compare experiments, review runs with people, and monitor production. It works with LangChain, LangGraph or any code through the SDK.
2How do you add tracing to an application?Asked almost every time
For LangChain and LangGraph, set LANGSMITH_TRACING=true and LANGSMITH_API_KEY (and optionally LANGSMITH_PROJECT), and runs are traced automatically. For other code, wrap functions with @traceable in Python or traceable() in TypeScript, or use wrappers for provider clients such as wrap_openai.
3How do you run an evaluation in LangSmith?Asked almost every time
Create a dataset of examples (inputs and, ideally, reference outputs). Write a target function that runs your app on an input. Define evaluators that return scores. Call evaluate() (or client.evaluate) with the target, the dataset and the evaluators; the results appear as an experiment you can compare with others.
4How do you build a good evaluation dataset?Asked almost every time
Start from real traffic: collect representative and difficult inputs from production traces, add known failures and edge cases, write reference outputs or criteria with domain experts, keep it versioned, and grow it whenever a bug is found. Fifty well-chosen examples beat thousands of random ones.
5How would you set up a regression gate in CI with LangSmith?Asked almost every time
On each pull request, run evaluate() against a fixed dataset with deterministic and LLM-judge evaluators, compare scores with the main-branch baseline experiment, and fail the build if key metrics drop beyond a threshold. Post a link to the experiment comparison in the PR.
6Offline vs. online evaluation: what is the difference?Asked almost every time
Offline evaluation runs your app on a curated dataset before release, giving comparable scores across versions. Online evaluation scores live production traces (sampled), catching real-world drift and issues your dataset missed, often without reference answers.
7What kinds of evaluators are there?Very often asked
Code evaluators (exact match, regex, JSON validity, custom logic), LLM-as-judge evaluators with a rubric, pairwise evaluators that compare two experiments, and human review through annotation queues. Summary evaluators compute dataset-level metrics such as precision. Online evaluators run on production traces.
8What is an annotation queue?Very often asked
A queue of runs for people to review: they read the trace, give feedback scores or labels, and can correct the output and add it to a dataset. Automation rules can send runs to a queue, for example every run with negative user feedback.
9How do you collect user feedback?Very often asked
Record the run ID when the app answers, then send feedback with client.create_feedback(run_id, key, score, comment) when the user clicks thumbs up or down. Feedback appears on the trace and can drive dashboards, filters and automation rules.
10What are online evaluations and automation rules?Very often asked
Online evaluators score a sample of live production traces automatically, for example for correctness or toxicity. Automation rules act on traces matching a filter: add them to a dataset, send them to an annotation queue, run an evaluator or trigger a webhook.
11How do you compare two versions of a prompt?Very often asked
Run each as an experiment on the same dataset with the same evaluators, then use the comparison view to see score differences and the examples where the outputs differ. Pairwise evaluation helps for subjective qualities. Version the prompts in LangSmith so the winner can be promoted with a tag.
12What are tags and metadata used for in tracing?Very often asked
They label runs with information such as environment, app version, user tier, prompt version or experiment name, so you can filter traces, build dashboards per segment and compare versions in production.
13How do you trace an application that is not built with LangChain?Very often asked
Use the @traceable decorator (Python) or traceable wrapper (TypeScript) on functions, wrap provider clients such as wrap_openai, or send OpenTelemetry traces. Nested calls become child runs automatically.
14What is a run tree?Very often asked
The hierarchy of runs that makes up one trace: a root run for the request, with child runs for each chain, model call, retriever and tool. It shows inputs, outputs, timing, tokens and errors at every level.
15How do you write a custom evaluator?Very often asked
A function that receives the run's inputs, outputs and reference outputs and returns a score (boolean or number) with an optional comment. It can use exact matching, regex, code execution or an LLM judge.
16How do you investigate a spike in bad answers?Very often asked
Filter traces by low feedback or failing online evaluators, group by tags such as version or model, open the run trees to find the failing step (often retrieval or a tool), add the cases to a dataset, fix and re-run the experiment to confirm.
17How do you use the Prompt Playground?Very often asked
Open a prompt or a traced model call, edit the prompt or model settings, and run it against examples or a whole dataset to compare outputs side by side, then save a new version to the prompt hub.
18What are datasets and how should you build them?Often asked
Collections of examples with inputs, optional reference outputs and metadata, used for evaluation and testing. Build them from real production traces, add edge cases and past failures, split them (for example by difficulty), and keep them versioned as they grow.
19How do you manage prompts in LangSmith?Often asked
Save prompts in the prompt hub, where each change is a commit. Tag versions (such as prod or staging), test them in the Playground against datasets, and pull them in code by name and tag, so prompts can change without a redeploy.
20How do you protect sensitive data in traces?Often asked
Mask or hide inputs and outputs with SDK options or environment variables (for example hiding inputs/outputs entirely, or custom anonymisers), avoid logging secrets, restrict workspace access, and choose data retention settings or self-hosting where required.
21What is LLM-as-judge and how do you make it reliable?Often asked
Using a model to grade outputs against a rubric. Make it reliable with specific criteria, reference answers, asking for reasoning before the score, small score scales, few-shot examples of correct grading, and regular checks against human labels.
22How do you control tracing volume and cost?Often asked
Sample traces with a rate setting, trace only certain environments, drop large inputs or outputs, and set data retention periods appropriately.
23How do you make LLM-as-judge evaluations consistent?Often asked
Use a clear rubric with examples, ask for reasoning before the score, use a strong model with temperature 0, keep the judge prompt versioned, and calibrate it against human labels on a sample.
24How do you evaluate an agent's trajectory?Often asked
Besides the final answer, check the sequence of tool calls: were the right tools used, in a sensible order, with valid arguments and no unnecessary steps. Compare with an expected trajectory or have a judge score it.
25How do you run repeated trials of an experiment?Often asked
Set a number of repetitions so each example runs several times, then look at average scores and variance, since model outputs are not deterministic and one run can mislead.
26What is a pairwise experiment used for?Often asked
Comparing two versions' outputs on the same inputs and asking which is better, by people or an LLM judge. It is useful when absolute scores are hard to define, such as for writing quality.
27What metrics would you put on a production dashboard?Sometimes asked
Request volume, error rate, latency (p50/p99), token usage and cost, feedback scores, online evaluator scores, and tool-call failures, filtered by model, prompt version or user segment.
28Do you need LangChain to use LangSmith?Sometimes asked
No. The SDK traces any Python or TypeScript code and wraps popular provider clients, and OpenTelemetry can send traces too. LangChain and LangGraph just integrate automatically.
29How do you share results with stakeholders?Sometimes asked
Share experiment comparison views, dashboards of production metrics and annotated example traces. Showing concrete good and bad examples beside the numbers builds trust.
30Can LangSmith be self-hosted?Sometimes asked
Yes, there is a self-hosted option for enterprises that must keep trace data in their own infrastructure, in addition to the cloud service with regional data storage.
Objective questions 30
1Which environment variable turns on LangSmith tracing?Asked almost every time
Why: With an API key set, LANGSMITH_TRACING=true traces LangChain and LangGraph runs automatically.
2Which decorator traces any Python function?Asked almost every time
Why: @traceable records the function as a run in a trace.
3What is an experiment?Asked almost every time
Why: Experiments are what you compare across prompt or model versions.
4Where should evaluation examples come from first?Asked almost every time
Why: Real inputs reveal real failures.
5What fails a CI regression gate?Asked almost every time
Why: Compare with the main-branch experiment.
6Which wrapper traces OpenAI client calls automatically?Asked almost every time
Why: Calls become child runs.
7Where do people review and correct runs?Very often asked
Why: Annotation queues collect runs for human review and labelling.
8Which call records a user's thumbs-down on a run?Very often asked
Why: Feedback is attached to a run ID with a key and score.
9What runs evaluators automatically on live traffic?Very often asked
Why: Online evaluators score sampled production traces.
10What does a pairwise evaluator compare?Very often asked
Why: It judges which of two answers is better.
11Online evaluation scores…Very often asked
Why: It catches real-world drift.
12What do tags and metadata let you do?Very often asked
Why: For example by version or environment.
13A custom evaluator returns…Very often asked
Why: Boolean or numeric.
14What does a trajectory evaluation check?Very often asked
Why: Right tools, right order.
15Why run repetitions in an experiment?Very often asked
Why: Averages are more reliable.
16What can an automation rule do with matching traces?Often asked
Why: Rules route traces to datasets, queues, evaluators or webhooks.
17What is a trace made of?Often asked
Why: Nested runs show every model, tool and retriever call.
18Which function runs an offline evaluation in the SDK?Often asked
Why: evaluate() runs a target over a dataset with evaluators.
19How should prompts be pulled in production code?Often asked
Why: Tags let you promote a tested version without a deploy.
20What improves LLM-judge consistency?Often asked
Why: Also calibrate against humans.
21Where can you edit and rerun a traced prompt?Often asked
Why: Compare outputs side by side.
22How do you reduce tracing volume?Often asked
Why: Sampling keeps cost in check.
23A run tree shows…Often asked
Why: Each step is a child run.
24Pairwise experiments are best for…Often asked
Why: Ask which output is better.
25What groups traces from one application?Sometimes asked
Why: Traces are logged to a project, set by LANGSMITH_PROJECT.
26Can LangSmith trace apps not built with LangChain?Sometimes asked
Why: It is framework-agnostic.
27A summary evaluator computes…Sometimes asked
Why: Summary evaluators see all results at once for dataset-level metrics.
28Which standard can also send traces to LangSmith?Sometimes asked
Why: OTel traces are supported.
29Can enterprises keep traces in their own infrastructure?Sometimes asked
Why: A self-hosted option exists.
30What should happen to a bug found in production?Sometimes asked
Why: Datasets grow from failures.
Track what you have practised and search every bank in your dashboard.
Start learning