Skip to content

Prompt Engineer interview questions

100 real questions with model answers and explanations for Senior Prompt Engineer candidates.

See a Prompt Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

promptingzero-shotchain-of-thought

I use zero-shot chain-of-thought for multi-step tasks only after a direct prompt proves insufficient in evaluation.

  • It can improve arithmetic, constraint tracking, and compositional questions by asking the model to work through intermediate steps.
  • It adds tokens and latency, and it can turn a simple classification into a verbose path with more opportunities to drift.
  • For high-stakes use I score final-answer accuracy on a fixed set and request a concise justification or verifiable work rather than treating fluent reasoning as proof.

Why interviewers ask this: The interviewer is checking whether the candidate treats chain-of-thought as a measured technique rather than a universal prompt suffix.

chain-of-thought

A prompt cannot make chain-of-thought private, so I request only concise artifacts that the user can verify and let the application control what is exposed.

  • The output contract can allow the answer, key assumptions, cited evidence, and a short formula with inputs, but never a full reasoning transcript.
  • I never place secrets, hidden policy text, or credentials in model context on the assumption that an instruction will conceal them.
  • The application validates and filters allowed response fields, while evals test correctness, evidence consistency, and leakage because fluent support is not proof.

Why interviewers ask this: A strong answer avoids requesting full chain-of-thought, limits context to non-secret data, and assigns leakage control to the application rather than the prompt.

promptingself-consistencydesign

I sample multiple candidate solutions and aggregate normalized final answers only when measured accuracy gains justify the extra calls.

  • I tune sample count and decoding settings on a development set for the specific model and task; neither a fixed temperature nor five to ten samples is universally correct.
  • Exact answers can use majority vote, while free-form answers need canonicalization, clustering, or a calibrated judge with a defined rubric.
  • I report ties, vote concentration, cost, and latency, then confirm the chosen configuration on a held-out set because correlated samples can create false confidence.

Why interviewers ask this: The interviewer is evaluating whether the candidate understands both sampling diversity and the hard aggregation step in self-consistency.

prompting

I would make assumption discovery a required planning output and block execution when an unsupported assumption is consequential.

  • The planner separates supplied facts, derived facts, assumptions, and unknowns, with the source or validation method for each item.
  • Every plan step declares its prerequisites; missing high-impact inputs produce a clarification or validation step rather than a guessed value.
  • Evals remove or contradict expected inputs and verify that the plan exposes the gap before any dependent action runs.

Why interviewers ask this: The interviewer is checking whether planning surfaces unsupported assumptions and unknowns before execution, not merely a sequence of steps.

promptingleast-to-mostdesign

I use least-to-most when later subproblems genuinely depend on answers to simpler earlier ones.

  • The decomposition prompt first produces an ordered list from prerequisites to the final task, rather than asking for a complete solution immediately.
  • Each answer is passed explicitly into the next step, which helps with compositional questions and long constraint chains.
  • Error propagation is the main risk, so I validate critical intermediate outputs or compare the final result with a direct baseline.

Why interviewers ask this: The interviewer wants to see whether the candidate can turn least-to-most decomposition into explicit dependencies and validate its error-propagation boundary.

promptingdesign

I make the decomposition produce independently answerable subquestions with explicit dependencies and a synthesis target.

  • The prompt rejects overlapping subquestions and labels which ones can run in parallel versus which need earlier results.
  • Each subquestion includes its required evidence and expected output shape, such as one claim plus source and date.
  • The synthesis stage receives the original request and all subanswers so it can detect gaps instead of merely concatenating them.

Why interviewers ask this: A strong answer turns decomposition into enforceable stage inputs and outputs rather than asking vaguely to break the task down.

prompting

I use critique and revision as two distinct passes with a narrow rubric, not as an open invitation to keep rewriting.

  • The critique identifies specific failures such as unsupported claims, missing constraints, or schema violations and points to the affected text.
  • The revision prompt receives the original request, draft, and critique but may change only issues supported by that critique.
  • Repeated self-revision can erase correct details or reinforce the model's own misconception, so I cap it at one or two passes and compare against a no-revision baseline.

Why interviewers ask this: The interviewer is checking whether the candidate can constrain revision and account for self-confirmation and quality regression.

prompting

I translate the constitution into prioritized, testable principles and require the model to cite the violated principle before rewriting.

  • A critique pass returns the principle ID, offending span, and a brief description of the conflict instead of a generic safety judgment.
  • The rewrite preserves allowed content and changes only the violating portion, which reduces unnecessary refusal and loss of utility.
  • I include precedence for conflicts, such as legal safety above brand tone, and evaluate each principle with positive and negative cases.

Why interviewers ask this: The interviewer is evaluating whether constitutional prompting is implemented as an auditable policy process rather than a vague request to be safe.

reactserializationsessions

I would persist a versioned, runtime-owned state artifact that can be validated and replayed before resuming.

  • It records stable action IDs, completed and pending work, verified observations, and provenance linking each observation to its tool call and runtime result.
  • The stop state includes its reason, resume cursor, allowed next transitions, and whether user input or retry approval is required.
  • On resume, the runtime validates the artifact, rejects assistant-authored observations, and continues from the last verified transition without repeating completed actions.

Why interviewers ask this: The interviewer is checking whether a ReAct workflow remains trustworthy and resumable across turns through serialized state and verified provenance.

promptingagents

The planner should produce a bounded task graph, while the executor should complete exactly one approved step with no authority to redesign the plan.

  • The planner sees the goal, constraints, available capabilities, and prior results, then emits steps, dependencies, and success criteria.
  • The executor sees one step, its permitted tools, relevant inputs, and the expected result schema, which narrows accidental scope expansion.
  • Replanning is triggered by a typed blocker or failed assumption rather than by letting every executor silently alter the workflow.

Why interviewers ask this: A strong answer separates planning authority from execution authority and defines how controlled replanning occurs.

promptingabstention

I describe tools by decision-relevant capabilities, exclusions, and prerequisites, then give abstention as an explicit valid outcome.

  • Each description says what the tool returns and when not to use it, such as using account lookup only for authenticated customer records.
  • The output contains the selected tool, a short evidence-based reason, and missing prerequisites rather than a free-form action plan.
  • I test confusing tool pairs and no-tool cases because obvious examples do not reveal routing boundaries.

Why interviewers ask this: The interviewer is evaluating whether tool selection is based on discriminating contracts and includes a safe no-tool path.

prompting

I state where every sensitive or consequential argument may come from and forbid the model from filling missing values by inference.

  • Authenticated IDs come from trusted session state, while dates or preferences may come from the user's latest explicit message.
  • Enumerations, units, ranges, and mutually exclusive fields are described in both the schema and plain-language policy.
  • If a required value is absent or ambiguous, the model must ask a targeted question instead of copying a plausible value from retrieved text.

Why interviewers ask this: The interviewer wants evidence that the candidate controls argument provenance, not just JSON syntax.

prompting

I have the runtime enforce hard limits and pass the planner or executor a structured snapshot of the allowance relevant to its next decision.

  • The planner receives remaining step, tool, and replanning allowances and must produce a plan that fits them; the executor receives one approved step and its permitted calls.
  • The prompt defines behavior for enough budget, low budget, and exhaustion, including returning a supported partial result or blocker instead of claiming completion.
  • The application counts tokens and calls and stops execution because a model cannot reliably count tokens or enforce its own budget.

Why interviewers ask this: A strong answer converts runtime-owned budget state into distinct planner and executor behavior without delegating token counting or enforcement to the model.

prompting

Each stage gets a single responsibility, a validated input schema, and an output schema designed for the next stage.

  • An extraction stage returns source spans and fields, while a later synthesis stage may interpret them but cannot silently create missing evidence.
  • Contracts include null behavior, confidence or abstention rules, and which original inputs remain available downstream.
  • I evaluate stages separately before the end-to-end chain so a good final answer cannot hide a broken intermediate step.

Why interviewers ask this: The interviewer is checking whether the candidate designs prompt chains as testable interfaces rather than loose prose handoffs.

promptingabstentiondesign

I define mutually distinguishable route criteria and reserve unknown as a first-class label with a clear threshold.

  • The router sees only information needed for routing, which prevents answer content or irrelevant context from biasing the label.
  • Few-shot cases concentrate on boundaries, mixed intents, and unsupported domains rather than easy examples.
  • The output is a route enum plus matched evidence, and low-confidence or conflicting evidence maps to clarification or human review.

Why interviewers ask this: The interviewer is evaluating route-boundary design and whether uncertainty produces a controlled outcome.

ensemblesprompting

I use ensembles for independent diversity and debate only when explicit challenge can expose competing assumptions.

  • Parallel candidates reduce correlated single-sample errors, but an aggregator must use a rubric rather than choose the most confident prose.
  • Debate can surface overlooked evidence, yet later agents may anchor on the first answer or converge socially on a wrong claim.
  • Both multiply token cost and latency, so I compare their lift against self-consistency and a stronger single prompt on the same evaluation set.

Why interviewers ask this: A strong answer distinguishes independent voting from interactive debate and measures both against cheaper baselines.

prompting

I reserve tree search for tasks with meaningful alternative states, cheap partial evaluation, and costly early commitment.

  • Planning puzzles, constrained scheduling, and candidate program strategies can benefit because branches can be scored before full completion.
  • The prompt must define branch generation, state representation, pruning score, depth, and a hard expansion budget.
  • For ordinary summarization or extraction, branching mostly duplicates text and increases cost, so a direct or plan-and-solve prompt is better.

Why interviewers ask this: The interviewer wants to see a concrete criterion for branching rather than using tree-of-thought as fashionable overhead.

ragpromptingtokens

I would define a tokenizer-measured cap and a preservation contract that is validated against the source context.

  • Compression must retain negation, numeric qualifiers, stable source IDs, and authority metadata such as issuer, effective date, and document type.
  • The output keeps each compressed claim linked to its source span and drops lower-priority repetition before any qualifying detail.
  • A validator checks token count, source linkage, and preservation of decisive claims, rejecting summaries that invert or weaken the evidence.

Why interviewers ask this: The interviewer is checking whether RAG compression meets a real token budget while preserving and validating evidence semantics.

citationsprompting

I require citations at the claim level and make every citation resolve to a passage that directly supports that claim.

  • The answer format places source IDs immediately after factual sentences instead of collecting unrelated links at the end.
  • A verification pass extracts each claim-citation pair and marks unsupported, partial, or contradictory support.
  • I prohibit citations on pure recommendations unless they rely on a source fact, which keeps the citation contract meaningful.

Why interviewers ask this: A strong answer focuses on citation entailment and granularity, not merely the presence of source identifiers.

groundednessprompting

I tell the model to expose material conflicts and apply a documented source-precedence policy instead of averaging claims or choosing the newest text.

  • Each source carries scope, jurisdiction, authority, publication and effective intervals, status, and any explicit supersession relationship.
  • The prompt first filters for applicability, then prefers the governing authority within the relevant jurisdiction and effective interval; recency matters only among otherwise applicable sources.
  • If those signals do not resolve the conflict, the answer names both claims and abstains from a definitive conclusion.

Why interviewers ask this: The interviewer is evaluating whether source precedence accounts for applicability, jurisdiction, effective time, authority, and explicit supersession rather than simple recency.

Locked questions

  • 21

    How do you decide where to place instructions, examples, context, and the user query in a long prompt?

    promptingcontextqueries
  • 22

    How would you design a position-swap prompt evaluation for the lost-in-the-middle effect?

    promptingdesignllm-eval
  • 23

    When would you use quote-first or extract-then-answer prompting?

    prompting
  • 24

    How do you write a multimodal prompt that refers unambiguously to regions or pages?

    prompting
  • 25

    How do JSON Schema descriptions and examples affect structured generation?

    schemajson-output
  • 26

    When are grammar constraints preferable to prompt instructions for output formatting?

    promptingoutput-contract
  • 27

    How do you evolve a structured-output schema without breaking prompt consumers?

    promptingschemastructured-output
  • 28

    How should few-shot examples teach a model to call tools correctly?

    promptingfew-shot
  • 29

    How do you adapt one prompt task for OpenAI, Claude, and Gemini models?

    prompting
  • 30

    What is the difference between system and developer instructions in prompt design?

    system-designdesigninstruction-roles
  • 31

    How do you choose between XML tags and other delimiters in a prompt?

    promptingdelimitersxml-sections
  • 32

    How would you compose and inherit prompt templates without creating an opaque hierarchy?

    promptingownershiptemplates
  • 33

    How do you make reusable prompt blocks safe from hidden instruction conflicts?

    prompting
  • 34

    How would you localize a prompt for a multilingual product?

    prompting
  • 35

    How do you encode cultural and tone constraints without relying on stereotypes?

  • 36

    How do you budget and compress prompt content when the context limit is tight?

    promptingcontext
  • 37

    What belongs in a stable prompt prefix, and why keep it stable?

    prompting
  • 38

    What should a dependency lock manifest contain for a prompt assembled from reusable components?

    promptingcomponentsdependencies
  • 39

    What static checks would you include in a prompt linter?

    promptinglinting
  • 40

    How would you construct an evaluation set for a new prompt?

    promptingllm-eval
  • 41

    How do you decompose a rubric for evaluating prompt outputs?

    promptingllm-eval
  • 42

    When would you use pairwise versus pointwise judge prompts?

    promptingllm-judge
  • 43

    How do you probe judge-prompt bias and iterate its rubric prompt?

    promptingiteration
  • 44

    How do you adjudicate evaluator disagreements to improve a prompt rubric and its examples?

    promptingconflictllm-eval
  • 45

    How would you instrument an A/B experiment for two production prompt versions?

    promptingexperiments
  • 46

    How do promptfoo, Inspect AI, LangSmith, and RAGAS differ from a prompt-evaluation perspective?

    promptingllm-eval
  • 47

    How would you build a red-team corpus for prompt injection testing?

    injectionprompt-injectionred-teaming
  • 48

    What prompt defenses help against direct and indirect prompt injection?

    injectionprompt-injectionprompting
  • 49

    How would you write a constitutional safety-policy prompt that remains usable?

    prompting
  • 50

    How do you test and reduce over-refusal caused by a safety prompt?

    prompting
  • 51

    A reasoning prompt succeeds on clean cases but fails when irrelevant facts are added or the question is paraphrased. How would you make it robust?

    prompting
  • 52

    A self-consistency voter treats 0.5, 1/2, and 50% as three different answers. How would you repair aggregation?

    self-consistencyconsistencyaggregation
  • 53

    A support prompt reveals internal rationales such as policy labels in 7% of responses, while answers remain correct. How would you stop the leakage?

    prompting
  • 54

    In a least-to-most chain, stage one decomposes tasks correctly, but stage two misuses a prior subanswer in 14% of 300 cases. How would you debug it?

    least-to-most
  • 55

    A critic prompt rejects rare correct facts because they are unfamiliar and provides no source evidence. How would you redesign it?

    prompting
  • 56

    A constitutional critic identifies the right principle, but the rewrite drops its principle ID and required change. How would you enforce the handoff?

  • 57

    A tool returns partial_failure after completing two of five items, but the ReAct prompt treats any result as success. How would you fix the contract?

    promptingreact
  • 58

    A planner and executor both repeat the same research and tool work because their boundary is unclear. How would you separate them?

  • 59

    In 2 of 500 tests, a tool-selection prompt chooses delete_account instead of suspend_account for an ambiguous request. How would you make the prompt safe?

    promptingtesting
  • 60

    Tool arguments violate business rules in 6.5% of calls even though every response matches the JSON schema. How would you improve the prompt?

    promptingschemajson-output
  • 61

    All field names match across a prompt chain, but source IDs disappear between extraction and synthesis. How would you preserve provenance?

    prompting
  • 62

    A router prompt sends 31% of simple rewrites to an expensive reasoning prompt, while the budget allows at most 12%. How would you tune it?

    prompting
  • 63

    In a two-agent debate prompt, the second agent repeats the first answer in 70% of cases and catches few errors. How would you restore independent review?

    promptingagents
  • 64

    An invoice prompt is only 94% schema-valid against a 99.5% target. How would you compare provider-native strict schemas with grammar constraints?

    promptingschema
  • 65

    You must add a required confidence_reason field to a prompt schema used by three downstream consumers with no coordinated deployment window. How would you migrate it?

    promptingschemadeployment
  • 66

    A Claude prompt built around four XML sections scores 88%, but a direct copy into OpenAI roles scores 78%. How would you port it?

    promptingxml-sections
  • 67

    The same moderation prompt stops mid-sentence on one provider and returns a full refusal on another in 8% of tests. How would you normalize behavior?

    promptingnormalizationtesting
  • 68

    A classifier with six English few-shot examples scores 92% in English but 74% in Spanish and 71% in German. What would you change?

    promptingfew-shot
  • 69

    After localizing a cancellation prompt, 11% of Russian requests are interpreted as immediate deletion instead of cancellation at period end. How would you fix it?

    promptingresilience
  • 70

    A RAG answer prompt follows long quoted prose but ignores compact authoritative metadata that determines the correct result. How would you rebalance evidence use?

    ragprompting
  • 71

    One citation is attached to a paragraph containing three factual claims, but it supports only one. How would you enforce citation coverage?

    citationscoverage
  • 72

    A pricing prompt receives a table whose footnote excludes annual plans, but it applies the discount to annual plans in 14% of 500 cases. How would you redesign it?

    promptingpricing
  • 73

    A 20-document prompt loses 21 percentage points when the key evidence moves from the start to the middle. How would you change context ordering?

    promptingcontext
  • 74

    A quote-first grounding prompt improves factual accuracy by 8 points but adds 38% output tokens. How would you keep most of the gain?

    promptingtokens
  • 75

    An untrusted tool observation contains a forged success message, and the answer prompt claims the action completed. How would you prevent that?

    prompting
  • 76

    A delayed multi-turn jailbreak plants an instruction in turn one and triggers it several turns later. How would you test and contain it?

    llm-safety
  • 77

    A classifier refuses a policy-analysis request because the quoted material contains harmful instructions. How would you distinguish analysis from execution?

  • 78

    A mixed-language homoglyph changes a tool name, but normalization cannot determine the intended identifier safely. What should the prompt and runtime do?

    promptingnormalization
  • 79

    A template uses customer_name in both account data and an embedded example, causing 2.3% of rendered prompts to address the wrong person. How would you fix the variable collision?

    prompting
  • 80

    A shared safety block says to refuse financial advice, while a product block says to provide portfolio recommendations, producing contradictory outputs in 14% of tests. How would you resolve the template conflict?

    testing
  • 81

    The team cannot reproduce 12% of last week's prompt failures because only the template name was logged. What would you version and record?

    promptingdebugging
  • 82

    A 6,000-token system prompt contains three conflicting instructions, and 19% of failures follow the wrong one. How would you simplify it?

    promptingtokenssystem-prompt
  • 83

    Context compaction separates few-shot inputs from their labels and corrupts demonstration pairing. How would you preserve examples?

    promptingcontextfew-shot
  • 84

    Rotating few-shot examples were placed in the stable prefix, so cache changes and behavior changes cannot be attributed separately. How would you restructure the prompt?

    promptingfew-shotcaching
  • 85

    Two rubric criteria, completeness and usefulness, correlate at 0.86 and judges repeat the same justification. How would you repair the rubric?

  • 86

    A judge rewards formal professional tone over equally correct plain language. How would you remove the tone bias?

  • 87

    A judge anchors on reference wording and penalizes a correct answer that uses different reasoning. How would you validate semantic equivalence?

    validationequivalence
  • 88

    An LLM judge agrees with domain reviewers only moderately, with Cohen's kappa of 0.42 on 250 cases. What would you do before using it in CI?

    llm
  • 89

    Three human raters achieve only weighted kappa 0.31 on a five-point prompt-quality rubric. How would you improve the evaluation?

    promptingllm-eval
  • 90

    Development examples were semantically paraphrased into the release eval, creating leakage without exact text matches. How would you clean the benchmark?

    benchmarking
  • 91

    A prompt scores 96% on synthetic evals but only 78% on 400 real user requests. How would you rebuild the test set?

    prompting
  • 92

    A promptfoo run shows 37 regressions after a wording change, but 29 are judge-score differences under 0.1. How would you decide what blocks release?

    prompting
  • 93

    A LangSmith trace has nine prompt and tool stages, and final accuracy fell by 10 points after a release. How would you isolate the failing prompt stage?

    prompting
  • 94

    An A/B assignment says variant B, but 6% of traces contain the rendered hash for prompt A because bundles were mixed. How would you handle the experiment?

    promptingexperiments
  • 95

    A 120-case paired eval shows a 3-point prompt gain with a wide confidence interval from minus 2 to plus 8. How would you decide whether to collect more samples?

    promptingconfidence-intervals
  • 96

    An unchanged prompt suite scores between 68% and 92% across ten runs. How would you make the eval decision reliable?

    prompting
  • 97

    You have 1,200 thumbs-down comments, but 64% contain no reason. How would you turn them into prompt eval cases?

    prompting
  • 98

    The pinned prompt and model are unchanged, but live traffic shifts from short billing questions to multi-policy requests and success drops. How would you diagnose it?

    prompting
  • 99

    How would you dynamically select a small, diverse set of few-shot demonstrations under a token budget?

    promptingtokensfew-shot
  • 100

    A junior engineer's 14-line prompt change looks cleaner but lowers the difficult-case score by 6 points. How would you review the change and mentor them?

    promptingmentoring