Explain precision, recall, and F1. Give a concrete case where 99% accuracy means the model is useless.
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
From the confusion matrix: precision = TP/(TP+FP) - of everything flagged positive, what fraction was right; recall = TP/(TP+FN) - of all true positives, what fraction was found; F1 = 2PR/(P+R), the harmonic mean, which punishes imbalance between the two (harmonic, so a model with P=1.0, R=0.01 gets F1≈0.02, not 0.5).
Full worked answer with diagram
From the confusion matrix: precision = TP/(TP+FP) - of everything flagged positive, what fraction was right; recall = TP/(TP+FN) - of all true positives, what fraction was found; F1 = 2PR/(P+R), the harmonic mean, which punishes imbalance between the two (harmonic, so a model with P=1.0, R=0.01 gets F1≈0.02, not 0.5).
Accuracy lies whenever classes are imbalanced. Fraud at 1% prevalence: the constant classifier "not fraud" scores 99% accuracy and catches zero fraud - recall 0. Any headline accuracy must be compared against the majority-class baseline.
Which metric to optimise is a cost question, not a math question:
- False positives expensive (spam filter eating real mail, police alerts) → prioritise precision.
- False negatives expensive (cancer screening, fraud, safety filters) → prioritise recall.
- Use F-beta to encode the ratio explicitly: F2 weights recall higher, F0.5 weights precision higher.
Also know that precision/recall/F1 are threshold-dependent - they describe one operating point on the classifier's score distribution. Reporting "F1 = 0.83" without saying how the threshold was chosen (and on which split) is a red flag; sweep the threshold on validation data and pick the operating point that matches the product's cost structure.
This vocabulary transfers directly to LLM evals: hallucination detection, toxicity filtering, and RAG retrieval are all precision/recall problems (retrieval's recall@k is literally recall), and interviewers expect you to move fluently between the classic and LLM framings.
Worth sketching. Drawing which cells feed which metric stops you fumbling the denominators under pressure.
flowchart TD
A["Model flags positive"] --> B["TP: really positive"]
A --> C["FP: false alarm"]
D["Model says negative"] --> E["FN: missed positive"]
D --> F["TN: really negative"]
B --> G["Precision = TP / (TP + FP)"]
C --> G
B --> H["Recall = TP / (TP + FN)"]
E --> H
What a good answer covers
- From the confusion matrix
- Accuracy lies whenever classes are imbalanced
- Fraud at 1% prevalence: the constant classifier "not fraud" scores 99% accuracy and catches zero fraud -…
- Any headline accuracy must be compared against the majority-class baseline
- Which metric to optimise is a cost question, not a math question
Key terms: precision · recall · F1 · F-beta · threshold-dependent
In the glossary: Accuracy · Hallucination · RAG · Recall@k
Interviewer follow-ups to expect
Why the harmonic mean rather than arithmetic?
Precision is 0.95 but the product team is unhappy - what would you check?
How do micro- vs macro-averaged F1 differ on imbalanced multiclass?
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