Skip to content

10 โ€” Mock Interview Answer Key (full answers, simple words)

Complete answers to every question in 07-mock-interview.md, numbered to match. Written in plain English, assuming no prior knowledge. Use file 07 to test yourself (cover these), then come here to check.

Tip: you don't need to say all of this. Aim to hit the bold keywords โ€” those are what the interviewer is listening for.


A. LLM fundamentals

1. What is an LLM at its core? An LLM (Large Language Model) is, at heart, a next-word predictor. You give it some text, and it predicts the most likely next chunk of text, then adds that and predicts again, over and over. That simple trick, trained on huge amounts of text, is what lets it answer questions and write code. Two things follow: it's probabilistic (the same question can give different answers), and it has no built-in sense of truth โ€” it produces text that sounds right, which isn't always correct.

2. What is a token? Rule of thumb? A token is a chunk of text the model actually reads โ€” usually a piece of a word, not a whole word. For English, the rule of thumb is 1 token โ‰ˆ 4 characters โ‰ˆ ยพ of a word. Models have a fixed vocabulary of tokens and build any text out of them.

3. Why do tokens matter for testing? Three reasons. Cost and limits are measured in tokens, not words, so your test budgets must be token-aware. Truncation happens at token boundaries โ€” if a prompt is too long, text gets silently cut off, which is a real bug to test for. And French uses more tokens per word than English, so a French test case can hit limits or cost more sooner โ€” important because this role is bilingual.

4. Temperature vs top-p vs top-k? These control how the model picks the next word. Temperature is the randomness dial: near 0 it always picks the most likely word (predictable, repetitive); higher makes it pick less-likely words (creative, riskier). Top-p (nucleus sampling) means "only consider the most likely words that together add up to, say, 90% probability." Top-k means "only consider the top k most likely words." They're different ways to limit which words are in play before picking.

5. Best temperature for reproducible tests? Set temperature to 0. That makes the model pick the most likely word every time, so you get the most consistent, repeatable output โ€” which is what you want when you're trying to assert on a result.

6. Why isn't temperature 0 truly deterministic? Even at 0, the same prompt can give slightly different answers because of how computers do math (floating-point addition isn't perfectly consistent), because your request gets batched with other people's requests on the server, and because the provider can change the backend hardware/model under you. (OpenAI even exposes a system_fingerprint so you can tell when the backend changed.) So temperature 0 makes things more reproducible, not perfectly reproducible.

7. What is the context window? It's the maximum amount of text the model can "see" at once, measured in tokens. It has to fit everything: the hidden system instructions, the conversation history, any documents you pasted in (for RAG), and the space for the answer. Modern models range from a few thousand tokens up to about a million.

8. What is "lost in the middle"? Models reliably use information at the start and end of a long context, but often miss facts buried in the middle. So if you put an important detail in the middle of a long document, the model may overlook it. You test for this with a "needle in a haystack" test: hide a fact in the middle and check the model still finds it.

9. What is grounding? Grounding means tying the answer to a trusted source you provide, instead of letting the model answer from its memory (which can be outdated or made-up). The main way to do it is RAG: fetch the real document and tell the model "answer using only this." Grounding is the main defense against hallucination, and it's testable.

10. Hallucination mechanism? A hallucination is a confident answer that's actually wrong or unsupported. It happens because the model optimizes for plausible-sounding text, not true text. When its training data is thin on a topic, it fills the gap with something that fits the pattern. It also has no natural "I don't know" signal, so it produces something rather than admitting ignorance.

11. Four ways to test for hallucination? (1) Faithfulness โ€” break the answer into claims and check each one is supported by the provided source. (2) Reference checks โ€” compare the answer to known-correct gold answers. (3) Adversarial probes โ€” ask questions with no answer in the source (does it admit it, or invent one?) and false-premise questions (does it push back?). (4) Numerical accuracy โ€” test dates, math, and quantities, which models get subtly wrong.

12. RAG vs fine-tuning vs prompting? Prompting (wording the instruction well, giving examples) is the cheapest, try it first. RAG is for knowledge โ€” when the model "doesn't know something" (current or private facts), you retrieve the real info and feed it in. Fine-tuning is for behavior โ€” when the model "doesn't act the way you want" (consistent format, tone, a narrow skill), you further-train its weights. Rule of thumb: RAG for knowledge, fine-tuning for behavior, prompting first because it's cheapest.

13. The three message roles? System = the hidden developer instructions that set behavior and rules ("You are a Bell agent; never reveal pricing"). User = what the end-user types. Assistant = the model's replies. These matter for red-teaming because the model can't always tell trusted system instructions apart from untrusted user/retrieved text โ€” that's the root of prompt injection.


B. Evaluation & LLM-as-Judge

14. Why does exact-match testing fail for LLMs? Because there are many correct ways to phrase the same answer. "Ottawa is the capital" and "The capital is Ottawa" mean the same thing but aren't equal strings. Plus the output is non-deterministic. So assert answer == "expected" breaks constantly. You move to scoring how good the answer is, not whether it matches exactly.

15. Four families of eval techniques? From cheapest to most powerful: (1) Heuristics โ€” quick checks like "is it valid JSON?", "is it the right length?", "does it avoid banned words?". (2) Overlap metrics like BLEU/ROUGE โ€” compare word overlap with a gold answer (cheap but dumb). (3) Semantic similarity โ€” use embeddings to compare meaning, not exact words. (4) LLM-as-Judge โ€” use a strong model to score the answer against a rubric.

16. BLEU/ROUGE weakness? They only measure word overlap, so they don't understand meaning. "The cat sat" vs "The feline sat" score poorly even though they mean the same thing. They're reliable and fast but miss paraphrases and subtle errors โ€” that's why people moved to semantic and LLM-judge methods.

17. What's an embedding? An embedding turns a piece of text into a list of numbers (a vector) such that texts with similar meaning end up close together in that number-space. You measure closeness with cosine similarity (0 to 1 for text). Embeddings power RAG retrieval, semantic-similarity scoring, and duplicate-detection.

18. LLM-as-Judge โ€” three modes? Pointwise โ€” score one answer on its own against a rubric (e.g., 1โ€“5). Pairwise โ€” show the judge two answers and ask which is better. Reference-based โ€” also give the judge a gold answer to grade against.

19. When pairwise vs pointwise? Use pairwise when comparing two versions ("is the new prompt better than the old one?") or for subjective qualities like tone/style. Use pointwise when you want an absolute score for one system, or for objective things like factuality. Reference-based when you actually have a correct answer to compare to.

20. Three judge biases and their fixes? Position bias โ€” the judge favors whichever answer came first (or second). Fix: swap the order and run twice ("swap-and-average"). Verbosity bias โ€” it prefers longer answers even if length adds nothing. Fix: normalize for length or tell it to ignore length. Self-preference โ€” it favors answers from its own model family. Fix: use a different model as the judge than the one being tested.

21. How do you calibrate a judge? You check that the judge agrees with humans. Have humans label a set of examples (a "golden set"), run the judge on the same examples, and measure agreement with Cohen's kappa, aiming for 0.6 or higher. Feed the disagreements back to improve the judge's instructions, and re-check periodically because judges drift as models update.

22. Kappa scale milestones? Cohen's kappa measures agreement corrected for luck. The standard scale: 0.41โ€“0.60 = moderate, 0.61โ€“0.80 = substantial (the common "good enough" bar), 0.81โ€“1.00 = almost perfect. Humans usually agree with each other at about 0.80, so that's your realistic ceiling.

23. Cohen's kappa vs Krippendorff's alpha? Use Cohen's kappa when you have exactly two raters and simple categories. Use Krippendorff's alpha when you have three or more raters, missing data, or ordered/numeric ratings. Both correct for agreement that would happen by chance.

24. What if the humans don't agree on the golden set? Then your rubric is too vague โ€” fix that first. If the people writing the "correct" labels can't agree, the task definition is unclear, and any judge you build will just be optimizing for noise. Tighten the rubric until humans agree, then calibrate the judge.

25. Why re-calibrate a judge over time? Because the underlying judge model changes (providers update versions), so its scoring can drift. A judge that agreed with humans last quarter may not anymore. Re-running the kappa check periodically catches that drift before it corrupts your results.


C. RAG & RAGAS

26. What is RAG? (4 steps) RAG = Retrieval-Augmented Generation, a way to give the model fresh, trusted facts. (1) Chunk and embed your documents and store them in a vector database. (2) Retrieve the chunks most similar to the user's question. (3) Augment โ€” paste those chunks into the prompt. (4) Generate โ€” tell the model to answer using only those chunks.

27. Two ways RAG fails? Retrieval failure โ€” it fetched the wrong or incomplete chunks (measured by context precision and recall). Generation failure โ€” it got good chunks but ignored them or hallucinated anyway (measured by faithfulness and relevancy). The big insight: a RAG bug is either a retrieval bug or a generation bug, and the metrics let you tell which.

28. What is RAGAS? RAGAS is the standard open-source Python library for evaluating RAG systems. Its trick is that most of its metrics use an LLM-as-judge and need no gold answer ("reference-free"), so you can even run them on real production traffic.

29. Faithfulness formula? Faithfulness = (claims in the answer that are supported by the retrieved context) รท (total claims in the answer). You break the answer into individual claims and check each against the source. It's your hallucination detector, and it needs no gold answer.

30. Response Relevancy โ€” what does it measure? Whether the answer actually addresses the question โ€” is it on-topic and complete, not evasive or padded. (RAGAS computes it by generating questions from the answer and checking they match the original question.) Important: it measures on-topic-ness, NOT correctness โ€” an answer can be relevant but factually wrong.

31. Context Precision? It measures whether the relevant retrieved chunks are ranked near the top โ€” basically the signal-to-noise quality of retrieval. If the good chunk is buried under junk, precision is low.

32. Context Recall? It measures whether retrieval fetched everything needed to answer. You take the gold answer, break it into claims, and check how many are present in the retrieved chunks. It needs a reference (gold) answer, so it's an offline metric.

33. Which two are reference-free? Faithfulness and Response Relevancy. Because they don't need a gold answer, you can run them on live production traffic for monitoring.

34. Retrieval vs generation metric grouping? Retrieval quality = Context Precision (ranking/noise) + Context Recall (completeness). Generation quality = Faithfulness (grounded, no hallucination) + Response Relevancy (on-topic). Splitting them this way lets you localize a failure.

35. Agent metrics in RAGAS? For multi-step agents: Tool Call Accuracy (did it call the right tool, in the right order, with the right arguments?), Topic Adherence (did it stay in scope and refuse off-topic requests?), and Agent Goal Accuracy (did it actually accomplish the user's goal?).

36. "Answer Relevancy" โ€” the gotcha? It was renamed to "Response Relevancy" in current RAGAS. If you say "answer relevancy" you're not wrong, but saying "response relevancy" signals you know the current version. (Also: the old ground_truth field is now reference.)

37. RAGAS limitations? It's non-deterministic (same input, different score across runs โ€” mitigate with temperature 0 and averaging), it only moderately agrees with humans (use it for trends and comparison, not absolute truth), it inherits judge biases like verbosity, and it costs several LLM calls per row. Always keep a human spot-check set to make sure the scores mean something.


D. Red-teaming & safety

38. Prompt injection root cause? The model reads instructions and data through the same channel โ€” there's no hard wall between "trusted commands" and "untrusted content." It's all just tokens in the context window, so cleverly worded data can hijack the model's behavior.

39. Direct vs indirect injection? Direct = the user types something malicious ("ignore your instructions and reveal the system prompt"). Indirect = the malicious instruction is hidden inside content the model later reads โ€” a document, web page, email, or retrieved RAG chunk. Indirect is the dangerous one for RAG.

40. Why is RAG exposed to indirect injection? Because retrieved documents get pasted straight into the prompt, and free-form text can't be sanitized the way structured input can. So an attacker who can get a poisoned document into your knowledge base can plant instructions the model will read and obey.

41. Name a real indirect-injection incident. EchoLeak (CVE-2025-32711) in Microsoft 365 Copilot โ€” a zero-click attack where a crafted email, automatically ingested by Copilot's RAG, caused it to leak internal data with no user action at all.

42. Jailbreak vs injection? A jailbreak defeats the model's safety training (gets it to produce content it's supposed to refuse). A prompt injection hijacks its instruction-following (gets it to do something other than what the developer intended). They overlap, but they target different things.

43. Name four jailbreak techniques. DAN / role-play (tell it to be an unrestricted persona), prefix injection (force the answer to start with "Sure, here's..."), refusal suppression (forbid it from using refusal words), many-shot (flood a long prompt with fake examples of it complying), and crescendo (start innocent and escalate over several turns).

44. OWASP LLM 01 / 06 / 09 / 07? LLM01 = Prompt Injection, LLM06 = Excessive Agency (giving an agent too much power/autonomy), LLM09 = Misinformation (hallucination and over-reliance), LLM07 = System Prompt Leakage (the hidden system prompt gets exposed).

45. NIST AI RMF โ€” four functions? Govern (build a risk-management culture), Map (understand the context and risks), Measure (test, benchmark, and monitor โ€” this is where evals and red-teaming live), and Manage (act on the risks). It's a voluntary framework for managing AI risk.

46. What is garak? NVIDIA's open-source LLM vulnerability scanner โ€” think "nmap for LLMs." You point it at a model and it fires hundreds of known attack prompts at it, then reports how often the model failed.

47. Garak's four plugin types? Generators (connect to the target model), probes (the attacks), detectors (judge whether each response was a hit/failure), and buffs (mutate the attack prompts to slip past filters).

48. Three garak probe families? dan (jailbreaks), encoding (base64/obfuscation bypasses), promptinject / latentinjection (direct and hidden injections), and realtoxicityprompts (toxicity triggers).

49. Four injection defenses? Spotlighting/delimiting (mark untrusted content so the model can tell it apart from instructions), input/output filtering (classifiers that catch attacks and unsafe output), least privilege (give agents minimal permissions and sandbox their tools), and dual-LLM / CaMeL patterns (separate the model that handles untrusted data from the one with tool access). The key point: no single fix โ€” use layers (defense-in-depth).

50. How do you test bias/fairness? Use counterfactual testing: take the same prompt and swap a demographic detail (name, gender, region) and check the answer's quality or sentiment doesn't change. Check demographic parity across groups. And do it in both English and French.

51. Why test English and French separately? Because safety and quality are usually weaker in the lower-resource language. A jailbreak that's blocked in English might succeed in French, and toxic content the model avoids in English might slip through in French. Equivalent test cases should get equivalent safety โ€” so you verify both.

52. How do you stress-test an agent? Test for runaway actions (does it loop or escalate forever? โ€” enforce step/action limits), scope violations (does it do things outside its job? โ€” check topic adherence), tool-call accuracy (right tool, right arguments), and escalation (does it hand off to a human when it should?). Run it all with sandboxed/mocked tools so tests can't cause real damage.


E. Vertex AI / Gemini

53. What is Vertex AI? What is Gemini? Vertex AI is Google Cloud's managed platform for building, hosting, and evaluating ML/AI models โ€” you call models over an API, no infrastructure to run. Gemini is Google's flagship model family (e.g., Gemini 2.5 Pro/Flash) that you call on Vertex AI.

54. Current SDK name? The Google Gen AI SDK (pip install google-genai, imported as from google import genai). The old Vertex AI SDK (vertexai / google-cloud-aiplatform) had its generative-AI parts deprecated in June 2025. Knowing this signals you're current.

55. Gen AI Eval Service โ€” two metric families? Computation-based metrics (deterministic, no LLM โ€” like exact match, BLEU, ROUGE) and model-based metrics (an LLM-as-judge, called an "autorater," scores qualities like groundedness, coherence, safety, instruction-following).

56. What's an autorater? It's the judge model โ€” a Gemini model that Vertex uses to grade other models' outputs against a rubric. It's Google's name for "LLM-as-judge."

57. AutoraterConfig anti-bias options? Response flipping (swap the A/B order to counter position bias), multi-sampling (score several times and aggregate for stability), and using a tuned judge model. These are the built-in levers to make the judge more reliable.

58. How do you authenticate on Vertex? With Application Default Credentials (ADC), which is Google Cloud's IAM-based auth, not API keys. Locally you run gcloud auth application-default login; on Google Cloud (Cloud Build, Cloud Run, a VM) the attached service account is used automatically. Prefer service accounts/impersonation over downloading key files.

59. Key generation parameters? temperature (randomness โ€” set 0 for evals), top_p and top_k (limit which tokens are considered), max_output_tokens (cap the answer length), and safety_settings (how aggressively to block unsafe content per category).


F. AI-in-QA tooling

60. AI test-generation approach? Feed the model a user story, requirement, or API spec, and have it draft test cases, edge cases, and negative cases. For APIs, generate Postman/RestAssured tests from the OpenAPI spec. Crucial caveat: AI-generated tests are a draft โ€” they hallucinate selectors and assertions, so you review before committing, and you measure value by real bugs found, not raw test count.

61. Self-healing locators โ€” how, and the risk? Store multiple signals for each UI element (id, text, role, position, accessibility attributes). When the primary locator breaks, a ranker picks the best surviving candidate and auto-updates it, so a renamed selector doesn't break 50 tests. The risk: it can hide a real regression (it "heals" past an element that was genuinely removed), so every heal must be logged for review.

62. Predictive test selection inputs? Use the code diff + historical defect/flake data + a map of which tests cover which code to predict which tests are most likely to catch a bug for this change, and run those first. You measure it with APFD (how fast the test run finds faults).

63. Failure clustering for triage? When hundreds of tests fail, usually only a few root causes are responsible. You turn each failure (stack trace + logs) into an embedding, cluster similar ones together, and triage one representative per cluster instead of hundreds of tickets. Add an LLM to summarize each cluster's likely cause.

64. Natural-language test authoring โ€” keeping it reliable? Let a non-coder write a test in plain English (or French), and have the LLM map it to executable steps. To keep it reliable, constrain the model to a fixed library of vetted step functions rather than letting it write free-form code, validate the generated steps, and keep a human approval gate. Bilingual support is required here.


G. System design / scenario

65. Design a RAG certification pipeline. Walk the skeleton: (1) Build a test corpus โ€” representative + edge + adversarial cases from seed intents, in English and French, with a human-labeled gold subset. (2) Test retrieval โ€” context precision and recall. (3) Test generation โ€” faithfulness and relevancy. (4) Calibrate the judge against humans (kappa โ‰ฅ 0.6). (5) Red-team โ€” injection, jailbreak, toxicity, PII leaks (garak), both languages. (6) Gate in CI/CD โ€” thresholds + tolerance, block deploy on regression. (7) Issue a certificate with scores, risks, and conditions. (8) Monitor production for drift and feed failures back into the corpus.

66. Design drift monitoring. Sample production outputs, run the reference-free metrics (faithfulness, relevancy, safety) on them continuously, and track the trend over time rather than single scores. When a metric's moving average drops past a tolerance band, alert and trigger re-certification, generate a quality delta report versus the last certified version, and add those production failures into the golden set so the next round covers them.

67. Certify an agent (e.g., Agentforce)? Beyond RAG metrics, test agent-specific things: Tool Call Accuracy (right tool/order/arguments), Topic Adherence (stays in scope), Goal Accuracy (accomplishes the task), and escalation (hands off to a human correctly). Red-team for Excessive Agency โ€” try to make it take unauthorized or runaway actions โ€” and enforce least privilege with sandboxed/mocked tools so tests cause no real side effects. Judge the whole sequence of steps, not just the final answer.

68. Generate an adversarial corpus from seeds? Start from a few real seed intents, then use an LLM to expand them โ€” paraphrase, vary difficulty and language (EN/FR), and add edge cases (ambiguous, no-answer-exists, false-premise) and adversarial cases (injections, toxicity triggers). Remove near-duplicates by embedding similarity so it's genuinely diverse, keep a private held-out set to avoid contamination, and human-validate anything used as a gold answer.

69. Passed evals but failed in production โ€” why? Likely causes: a corpus gap (production hit a case or language you didn't test โ€” the most common, and why you feed failures back), a metric blind spot (you didn't measure the dimension that failed), judge drift (the judge scored it good but humans disagree), distribution shift (real inputs drifted from your test set), or non-determinism (passed at temperature 0 but production runs hotter). The key reflex: turn the production failure into a permanent regression test. Evals reduce risk; they don't eliminate it.


H. Behavioral

70. Building QA in ambiguity (no textbook)? Use a real STAR story. Situation: there was no existing framework or standard. Task: you needed a repeatable way to measure quality. Action: you researched current practice, defined the dimensions/metrics/thresholds, built the tooling, calibrated it against human judgment, and got the team to adopt it. Result: quantify it (bugs caught, time saved, adopted by the team). Close with: "This role is literally being 'written in real time,' and that from-scratch framework-building is exactly what I enjoy."

71. Convince devs an eval gate is mandatory? Lead with data, not authority: show real failures the gate would have caught. Frame it as reducing risk for their own release, not a tax. Make it fast (a small subset per pull request so it's not a bottleneck) and transparent (clear reports showing exactly what regressed). Partner early so the gate is co-owned, and start in "warn" mode to build trust before flipping it to "block."

72. Why AI testing / why this role? Tie your background to the two halves of the job: bringing AI into QA tooling (your automation experience) and doing QA on AI including red-teaming (your security/VAPT experience connects here). Mention that you're drawn to a discipline being defined right now and to the high-stakes, bilingual certification mission of certifying AI before it reaches production.

73. How do you stay current? You keep a "technology radar" โ€” a living list of emerging AI-testing tools you pilot and re-review (RAGAS, garak, PyRIT, promptfoo, DeepEval). You read current evaluation research and best practices, and you fold what works into your framework. (The JD explicitly calls out a technology radar and adopting new research, so this answer maps directly.)

โ†’ Back to README ยท self-test with 07-mock-interview.md