AI Engineering Interview Questions: LLM Evaluation & Safety

Reviewed by Mark Dickie · Last updated

LLM evaluation is the practice of measuring how well a large language model performs on specific tasks using quantitative metrics, human judgment, or automated grading. For an AI engineering interview, you need to know the difference between automatic and human evaluation, how to design eval sets that avoid contamination, and which metrics fit which tasks. You should also understand safety evaluation — red-teaming, toxicity scoring, and jailbreak resistance — because interviewers increasingly pair "does the model work?" with "can it be made to cause harm?" The strongest candidates can critique a proposed eval pipeline, not just list metrics.

What evaluation methods should I know for an LLM interview?

MethodWhat it measuresWhen to use itWatch out for
Exact match / accuracyWhether output matches a gold labelClassification, Q&A with fixed answersFails on semantically correct paraphrases
BLEU / ROUGEN-gram overlap with reference textTranslation, summarization (legacy)Weak proxy for meaning; gaming by repetition
LLM-as-a-judgeA model scores another model's outputOpen-ended tasks, preference rankingJudge bias, position effects, self-preference
Human evaluationHuman raters score quality or safetyGold-standard validationExpensive, slow, rater disagreement
Safety classifiersToxicity, PII, policy-violation ratesGuardrails, red-team pipelinesFalse positives on benign content
Benchmark suites (MMLU, HELM)Broad capability across many tasksModel comparison, progress trackingContamination, stale benchmarks, overfitting

How do I design an evaluation pipeline?

A solid eval pipeline is not just "run the model and check accuracy." Interviewers want to see you think about data, metrics, and failure modes together. Here is a practical sequence:

  1. Define the task and success criteria before touching a model — what counts as a good output, and who decides?
  2. Build a held-out eval set with gold labels or rubrics, sourced separately from training data to prevent contamination.
  3. Choose metrics that match the output type: exact match for factual Q&A, LLM-as-a-judge for open-ended generation, human review for safety-critical decisions.
  4. Run baselines (a simpler model, a prompt template, or a random selector) so your numbers have context.
  5. Iterate on prompts and model settings, re-running evals each time to catch regressions — a pipeline that only runs once is a snapshot, not a safety net.

What does a safety evaluation question look like?

Safety evals test whether a model can be pushed into producing harmful, biased, or policy-violating content. You may be asked to design a red-team protocol, explain how you would measure jailbreak success rates, or compare automated toxicity classifiers against human review. Know the common attack surfaces: prompt injection (malicious instructions embedded in retrieved context), jailbreaking (crafted prompts that bypass guardrails), and data leakage (the model regurgitating training data). Be ready to discuss the trade-off between false positives in safety filters and user experience — an overly aggressive filter blocks legitimate requests and erodes trust.

What metrics matter most for different output types?

Interviewers love asking you to match a metric to a scenario. Quick reference:

Output typeGo-to metricWhy
Factual Q&AExact match + F1Verifiable correctness, fast to compute
SummarizationLLM-as-a-judge with rubricCaptures coherence and factuality, not just word overlap
Code generationPass@k (functional tests)Runs the code; pass or fail, no subjective scoring
Open-ended chatHuman preference / win rateQuality is subjective; pairwise comparison is reliable
Safety filteringFalse-positive rate + recallBoth directions matter — missed harm and blocked good content

Key facts

  • Tarmac has 30 AI Engineering interview questions on this topic, 10 of them on this page, at difficulty 3–5 of 5.
  • Tarmac last reviewed these AI Engineering interview questions on 19 August 2026.

At a glance

Questions10 shown · 30 in the bank
Difficulty3–5 of 5
FormatsOrdering, Multiple choice, True / false, Short answer, Flashcard, Fill in the blank, Find the bug, Multiple answer

What you'll review

  1. llm eval
  2. eval datasets
  3. rag eval metrics
  4. model routing
  5. agent loops

Practice questions

AI Engineering/evaluation-safety/llm-eval

Order the stages of standing up evaluation for a new LLM feature so you can ship and iterate with confidence.#

Put these in order

Show answer

Stand up evaluation in this order:

  1. Define the task and success criteria / metrics
  2. Build a representative eval dataset with expected outcomes
  3. Run candidate prompts/models against the dataset and score them
  4. Compare results and pick the best variant
  5. Monitor live outputs in production and feed failures back into the eval set
Why:

Evaluation starts by defining what good means (criteria/metrics), then assembling a representative dataset of inputs with expected outcomes. You score candidate variants against it, compare and select the winner, and finally monitor in production, routing real-world failures back into the dataset so the eval set hardens over time. Skipping the dataset step is the classic mistake — you can't iterate on quality you don't measure.

AI Engineering/evaluation-safety/eval-datasets

You change a production prompt to fix one class of failure. Before shipping, how do you confirm the change is a net improvement and did not quietly break cases that used to work?#

Options

Show answer

Run both the old and new prompt against a versioned golden set of representative cases with expected outcomes, score each, and compare, gating on any regression before shipping. The golden set catches regressions before they reach users and localizes which cases changed. Watching the live thumbs-down rate is post-hoc, slow, and noisy; eyeballing a handful of outputs misses the long tail you were already passing; and temperature is unrelated to whether the new prompt is better.

Why:

A golden set is a versioned, labeled dataset of representative inputs with known-good expectations; running both prompt versions against it and comparing scores catches regressions before they ship and localizes which cases changed (c). Watching the live thumbs-down rate (a) is post-hoc, slow, and noisy — it only tells you something broke after real users hit it, and can't isolate the regressed cases. Eyeballing a handful (b) doesn't cover the long tail you were already passing. Temperature (d) is unrelated to whether the new prompt is actually better.

AI Engineering/evaluation-safety/eval-datasets

Running an online A/B test of a new prompt on live production traffic removes the need for an offline golden eval set, because real users provide the ground truth directly.#

Options

Show answer

False. An A/B test measures online outcome metrics on live traffic, which is valuable but slow, noisy, confounded by traffic mix, and only observable after you have already exposed real users to the change. It gives no labeled ground truth on known-hard cases, cannot catch a regression before it ships, and cannot tell you which inputs broke. An offline golden set is the pre-ship regression gate; A/B testing complements it rather than replacing it.

Why:

An A/B test measures online outcome metrics (engagement, task success, thumbs-up) on live traffic — valuable, but slow, noisy, confounded by traffic mix, and only observable after you have already exposed real users to the change. It gives you no labeled ground truth on known-hard cases, can't catch a regression before it ships, and can't tell you which inputs broke. An offline golden set — versioned, labeled, and run in CI on every change — is the pre-ship regression gate. A/B testing complements it (does the improvement hold up with real users?); it does not replace it.

AI Engineering/evaluation-safety/llm-eval

You're shipping an LLM feature and need to know if a prompt change is an improvement. Outline how you'd evaluate it, and one pitfall of using an LLM as a judge.#

Show answer

Build an offline eval set of representative inputs with known-good expectations, then score each candidate prompt against it — using exact/programmatic checks where possible (does it parse, does it match the schema, is the retrieved fact present) and an LLM-as-judge with a rubric for open-ended quality. Compare versions on the same dataset so changes are measurable rather than vibes, and track regressions over time. A key pitfall of LLM-as-judge is bias: judges favor longer or more verbose answers, can be inconsistent run-to-run, and may rate their own model's style higher, so you should calibrate the judge against human labels and pin its temperature.

Why:

Treat prompts like code: a versioned eval dataset with deterministic checks plus an LLM judge for subjective dimensions, run on every change so you catch regressions instead of guessing. LLM judges are useful but biased — they reward verbosity, drift between runs, and can prefer their own family's outputs — so anchor the judge to human-labeled examples, use a strict rubric, and keep its temperature low. Eyeballing a handful of outputs is not evaluation.

AI Engineering/evaluation-safety/llm-eval

What is "LLM-as-judge" evaluation, and what are its main pitfalls?#

Show answer

LLM-as-judge uses a (usually strong) model to score or compare outputs against a rubric — e.g. rating faithfulness, relevance, or picking the better of two responses — so you can evaluate open-ended generations at scale where exact-match metrics fail. Pitfalls: positional/verbosity/self-preference bias (favoring the first option, longer answers, or its own family), rubric ambiguity producing noisy scores, cost/latency of judging at scale, and drift when the judge model changes. Mitigate with clear rubrics and few-shot anchors, randomized option order, pairwise comparisons over absolute scores, and calibrating the judge against a human-labeled gold set.

Why:

LLM-as-judge unlocks scalable evaluation of subjective/open-ended outputs, but it's a measurement instrument that must itself be validated against human labels and de-biased — otherwise you optimize toward the judge's quirks rather than real quality.

AI Engineering/evaluation-safety/llm-eval

You ship prompt changes weekly and need a scalable regression check on answer quality for open-ended summaries, where exact-match scoring is meaningless. Which evaluation approach is the most appropriate primary method, and what is its key caveat?#

Options

Show answer

Use LLM-as-judge scoring against a rubric on a fixed eval set; the key caveat is that the judge can be biased and must itself be validated against human labels. For open-ended generation it scales and correlates reasonably with human judgment when given a clear rubric, but the judge is a fallible model with known biases (position, verbosity, self-preference). Exact match and BLEU penalize valid paraphrases, and reading every output manually does not scale to weekly iteration.

Why:

For open-ended generation, LLM-as-judge over a fixed, versioned eval set scales and correlates reasonably with human judgment when you give the judge a clear rubric and, ideally, a reference answer. The essential caveat is that the judge is itself a fallible model — it shows known biases (position bias, verbosity/length bias, self-preference) — so you must validate it against a sample of human labels and re-check when you change the judge model. Exact match (a) fails by design for free-form text where many wordings are equally correct. BLEU against a single reference (c) was built for machine translation and penalizes valid paraphrases; its weakness is poor correlation with quality on summaries, not speed. Reading every output manually (d) does not scale to weekly iteration; spot-checking belongs alongside an automated eval, not as the primary gate.

AI Engineering/evaluation-safety/llm-eval

Using the same LLM as both the system under test and the evaluator (LLM-as-judge) produces unbiased quality scores because the model grades based purely on the rubric provided.#

Options

Show answer

False. LLM-as-judge evaluation carries known biases that distort scores when the judge and the system under test are the same or closely related models. Self-preferencing favors outputs stylistically similar to the judge's own, verbosity bias rates longer answers higher regardless of accuracy, and position bias boosts the first answer in pairwise comparisons. Mitigate with a different, stronger judge, order-swapped pairwise comparisons, calibration examples, and a human or deterministic cross-check. A self-judge score should never be the sole gate.

Why:

LLM-as-judge evaluation is powerful but carries known biases that distort scores in a predictable direction when the judge and the system under test are the same or closely related models. Self-preferencing bias: the model tends to rate outputs stylistically similar to what it would generate more favourably. Verbosity bias: longer answers are scored higher regardless of accuracy. Position bias: in pairwise comparisons, the first presented answer gets a boost. Mitigation strategies include using a different, stronger judge model, presenting pairwise comparisons in both orders and averaging, adding calibration examples to the judge prompt, and triangulating with at least one human or deterministic metric. A single-judge self-evaluation score should never be the sole quality gate.

AI Engineering/evaluation-safety/rag-eval-metrics

In component-wise RAG evaluation, two retrieval-stage metrics are context _____ (are the retrieved passages relevant?) and context _____ (were all the passages needed to answer actually retrieved?). On the generation side, _____ measures whether every claim in the answer is supported by the retrieved context.#

Show answer

In component-wise RAG evaluation, two retrieval-stage metrics are context precision (are the retrieved passages relevant?) and context recall (were all the passages needed to answer actually retrieved?). On the generation side, faithfulness measures whether every claim in the answer is supported by the retrieved context.

Why:

Context precision = relevance/signal of the retrieved passages (relevant ones ranked high); context recall = coverage (did retrieval fetch everything needed, usually checked against a reference answer). Faithfulness (a.k.a. groundedness) = the share of the answer's claims entailed by the retrieved context — the anti-hallucination signal. The fourth common metric, answer relevance, checks that the answer actually addresses the question. Splitting retrieval metrics from generation metrics is what lets you attribute a failure to the right stage.

AI Engineering/ai-production/model-routing

This cascade is meant to escalate to the strong tier whenever the cheap tier's answer isn't good enough, not just when the call errors. Which line lets a wrong-but-successful cheap-tier answer through unescalated?#

async function answerQuery(query: string): Promise<string> {
  try {
    const cheap = await callModel("cheap-tier", query);
    return cheap.text;
  } catch {
    const strong = await callModel("strong-tier", query);
    return strong.text;
  }
}
Show answer

The bug is on line 4.

Why:

Line 4 returns the cheap tier's text the instant the call succeeds, with no check on whether the answer is actually any good. The catch block only fires on a thrown exception — a timeout, a 5xx, a malformed-request error — never on a response that came back fine but is low-confidence, off-topic, or simply wrong. Cascades work specifically because escalation is driven by a quality/confidence signal on the cheap tier's real output — a verifier score, a self-consistency check, a validator against the expected shape, or the model's own confidence — not by whether an exception was thrown (this is the core idea behind cascade-based serving approaches like FrugalGPT). As written, this code silently serves bad answers from the cheap tier on exactly the hard requests it was supposed to catch and escalate, while only ever escalating for unrelated infrastructure failures. The fix is to score cheap.text against a threshold after line 4 and route to the strong tier when it doesn't clear it.

AI Engineering/agents/agent-loops

You want an agent loop covered by tests that run on every pull request, with no live model or tool calls. Which of these make that possible? Select all that apply.#

Options

Pick every one that applies.

Show answer

Inject the tools and the model client so a test can drive a scripted run, assert on the sequence of tool calls rather than the model's prose, and keep the loop's control logic free of network calls so the step cap and stop condition are ordinary unit-testable functions. Together these cover the paths hardest to trigger live — a tool 500, a malformed argument, a run that hits its cap. Calling the real model at temperature 0 is not a substitute: it reduces variance without guaranteeing identical output, and it puts network access and spend on every pull request.

Why:

Agent loops are testable to the exact degree that the loop is separable from the two things that make it non-deterministic and slow. Injecting tools (a) and the model client (b) is what lets a test drive the loop through a scripted run — including the paths that matter most and are hardest to trigger live: a tool 500, a malformed argument, an unterminated run hitting the step cap. Asserting on the call sequence (c) rather than the prose gives you a stable oracle, because "which tools, with what arguments, in what order" is the loop's actual behaviour; the wording of the final answer is not. Keeping control logic network-free (d) means the step cap and stop condition are ordinary functions with ordinary unit tests. Option (e) is the trap: temperature 0 reduces variance but does not guarantee identical output — batching and floating-point non-determinism on the provider's side still shift results, models are updated underneath you, and the test now needs network access and a budget on every pull request. Reproducible-looking beats reproducible right up until it flakes in someone else's branch.

Related interview questions

The other 20 questions

This page shows 10. A free account opens the rest and marks your answers, which a page of answers can't do. Miss one and it returns a few days later, then a week after that, until you stop missing it.

Start free

Free · the whole bank · 100 graded answers per 30 days · written feedback and job-ad quizzes on the paid plan

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.