Walk me through your process for systematically improving a prompt that's underperforming.
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
The process is an empirical loop, and it starts with measurement, not rewriting.
Full worked answer with diagram
The process is an empirical loop, and it starts with measurement, not rewriting.
1. Build the eval before touching the prompt. Collect 30-200 cases: real production failures, representative inputs, and known edge cases. Define scoring per case - exact match or schema checks where possible, LLM-as-judge with a rubric for open-ended quality (spot-check the judge against human labels first). Without this, "improvement" is anecdote and you'll play whack-a-mole: fix one case, silently break three.
2. Score the baseline and read the failures. Don't just look at the aggregate - bucket failures by type: wrong format vs. wrong reasoning vs. ignored instruction vs. hallucinated content. Each bucket implies a different fix (schema/prefill, decomposition or CoT, instruction placement/emphasis, grounding constraints). Reading 20 failed transcripts carefully is the highest-value hour in the whole process.
3. Change one variable, re-run, compare. Prompt edits interact unpredictably; batch changes make attribution impossible. Keep a log of variants and scores - prompts are code, so version them like code (in git, with the eval score in the commit message or an experiment tracker).
4. Watch for regressions and overfitting. A fix targeting bucket A must not regress buckets B - D - that's what the full suite is for. And guard against overfitting the eval set: hold out cases, and refresh the set with new production failures periodically.
5. Know the escalation ladder. If iteration plateaus: try example changes (add/reorder few-shot), structural changes (decomposition, output schema), model changes (different model or reasoning effort), retrieval changes - and only then fine-tuning. Also try meta-prompting (feed a strong model the prompt plus failure cases and ask for a rewrite) as a cheap candidate generator - candidates still have to win on the eval.
6. Ship carefully. Offline win → shadow or canary with online guardrail metrics, because eval sets never fully match production distribution.
The differentiating signal in this answer is the order: eval → failure analysis → single-variable iteration. Candidates who start with "I'd add better wording" fail this question.
Worth sketching. The loop back from the regression check is what separates this from "I would reword it and see."
flowchart TD
A["Build the eval set:<br/>30 to 200 real cases"] --> B["Score the baseline"]
B --> C["Bucket failures: format,<br/>reasoning, ignored, ungrounded"]
C --> D["Change one variable"]
D --> E["Re-run the whole suite"]
E -->|"target bucket up,<br/>others flat"| F["Keep it, log the score"]
E -->|"regressed elsewhere"| D
F --> G{"Scores plateaued?"}
G -->|"yes"| H["Escalate: structure, model,<br/>retrieval, then tuning"]
G -->|"no"| I["Shadow, then canary"]
What a good answer covers
- The process is an empirical loop, and it starts with measurement, not rewriting
- Build the eval before touching the prompt
- Collect 30-200 cases: real production failures, representative inputs, and known edge cases
- Define scoring per case - exact match or schema checks where possible, LLM-as-judge with a rubric for…
- Without this, "improvement" is anecdote and you'll play whack-a-mole: fix one case, silently break three
Key terms: 5. Know the escalation ladder · 6. Ship carefully
In the glossary: Prefill · Grounding · Eval set · Few-shot · Fine-tuning · Guardrail metric
Interviewer follow-ups to expect
How do you eval open-ended generation where there's no single right answer?
Your prompt scores 95% offline but users complain - what's broken?
How do you keep the eval set from going stale?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep