All jobs / Data science / ML / AI
NLP interview questions
NLP questions a Data science / ML / AI can be asked, from first job to senior. Open one to see the strongest answer and why it works.
Why do modern language models split text into subword pieces rather than whole words or single characters?
The strongest answer: Whole words leave rare and new words unknown and need a huge vocabulary; characters make sequences long and slow to learn; subwords (BPE, WordPiece) keep common words whole and build rare ones from pieces
Why it works: Right — a fixed vocabulary with no unknown-word problem, and a sequence length between the two extremes.
- Words: unknown-word problem.
- Characters: long, slow sequences.
- Subwords: coverage with a fixed vocabulary.
- BPE and WordPiece are the usual methods.
What is a large language model trained to do, and how does a raw pretrained model become an assistant?
The strongest answer: Pretraining predicts the next token over huge amounts of text, which builds language and world patterns; then instruction tuning on example dialogues and preference tuning on human judgements shape it to follow requests and answer helpfully
Why it works: Exactly — next-token pretraining, then supervised fine-tuning, then preference tuning; fluency comes from the first, manners from the rest.
- Objective: predict the next token.
- Pretraining builds patterns.
- Instruction tuning teaches requests.
- Preference tuning shapes behaviour.
How do you know a prompt change helped?
The strongest answer: A fixed eval set with a written rubric — humans or checks I can repeat — not “it felt better in chat this afternoon”
Why it works: Exactly. Eval is a product. Vibes are a demo.
- Fixed set + written rubric.
- Repeatable checks, not afternoon vibes.
- Do not let the model mark its own homework.
- Change one thing at a time.
The policy PDF changes monthly. Do you fine-tune or retrieve?
The strongest answer: Retrieve and ground on the current PDF — fine-tune when the skill is style or a stable task, not when the facts move every month
Why it works: Exactly. Moving facts want retrieval plus citations. Weights are a slow, costly encyclopaedia.
- Changing facts → RAG / grounding.
- Fine-tune for stable skills or style.
- Weights are not a CMS.
- Do not stuff the whole corpus in the prompt.
Your LLM eval questions were copied from a popular GitHub gist. Why is that a problem in 2026?
The strongest answer: Those items are likely in pretraining and in other people’s few-shots — I need a private, versioned set that is not a meme
Why it works: Exactly. Popular items are contaminated. Private, living evals are the job.
- Popular public items are contaminated.
- Keep a private, versioned eval.
- Prompts do not undo pretraining.
- A translation is not a new test.
Before transformers, why did people use recurrent networks for text instead of a bag-of-words model, and what was their weakness?
The strongest answer: Bag-of-words discards order, so “not good” looks like “good”; an RNN reads tokens in order and carries a state — but that state fades over long spans and training cannot run in parallel across the sequence
Why it works: Right — order and state were the win; fading long-range memory and sequential training were the price transformers removed.
- Bag-of-words loses order.
- RNN: read in sequence, carry state.
- Weakness: long spans fade.
- Sequential training, no parallelism.
You use an LLM to grade another LLM. What makes that acceptable?
The strongest answer: A written rubric, spot-checks by humans, and knowing the judge’s failure modes — not an unreviewed auto-score I treat as truth
Why it works: Exactly. LLM-as-judge is a noisy instrument. Rubric plus humans on a sample.
- Rubric + human spot-check.
- Know how the judge fails.
- Do not treat auto-scores as truth.
- Do not drop humans entirely.
A RAG answer has no supporting chunk. What should the product do?
The strongest answer: Refuse or say we do not know — I do not let the model “helpfully” complete from weights and dress it as retrieval
Why it works: Exactly. Ground or decline. Improvisation in a RAG costume is a hallucination with a footnote slot.
- No support → refuse or “we do not know.”
- Do not improvise in RAG clothing.
- Do not fake a citation.
- Empty UI is better than a false source.
Your search matches queries to documents by averaging word2vec vectors of the words. Users searching “river bank” get pages about savings accounts.
What is the limitation, and what do you change?
The strongest answer: Static embeddings give one vector per word regardless of context, so both senses of “bank” share it and averaging blurs everything; a contextual model (BERT-style or a sentence-embedding model) encodes the phrase as a whole, sense included
Why it works: Exactly — one-vector-per-word cannot represent polysemy; contextual encoders produce different vectors for the same word in different sentences.
- Static: one vector per word.
- Polysemy collapses into one point.
- Contextual encoders embed the phrase.
- Sentence-embedding models for retrieval.
How do you evaluate a RAG system beyond “users liked it”?
The strongest answer: Separate retrieval quality from answer faithfulness to the retrieved bits — plus a human sample on the risky intents — not one vibe score
Why it works: Exactly. Did we fetch the right thing, and did we stick to it? Two questions. Humans on the dangerous ones.
- Score retrieve and faithfulness apart.
- Human-review risky intents.
- Do not collapse to thumbs.
- More citations ≠ more true.
A stakeholder wants to fine-tune “so the model knows our brand.” When do you push back?
The strongest answer: When the need is current facts, tool use, or policy — retrieval, prompts, and product rules are cheaper and safer to update than weights
Why it works: Exactly. Fine-tune is for a stable skill or voice you cannot get otherwise — not a CMS and not a weekly dump of tickets.
- Fine-tune ≠ knowledge base.
- Prefer RAG, prompts, and rules for moving facts.
- Do not soup tickets into weights by default.
- Cost is a constraint, not the reason it works.
You need humans to grade model answers. What do you specify?
The strongest answer: A rubric, rater training, overlap for agreement, and how disagreements resolve — not “a few people will click thumbs”
Why it works: Exactly. Human eval is a measurement system. Design it.
- Rubric, training, overlap, resolution.
- Do not use leftover Friday clicks.
- Authors do not grade their own work alone.
- Agreement is part of the instrument.
RAG chunks are 2k tokens with no overlap because “the model is long-context now.” Pushback?
The strongest answer: Long context does not remove lost-in-the-middle or split-apart facts — I chunk for the task, cite at useful grain, and measure retrieval
Why it works: Exactly. Context length is a budget, not a theory of documents. Measure.
- Chunk for the task, not the window ad.
- Measure retrieval.
- Long context ≠ one blob.
- Do not embed “the whole drive.”
Who owns the eval suite for an assistant that can spend money?
The strongest answer: A named owner, a release gate, and a budget to refresh hard cases — not “research will add a few prompts when they can”
Why it works: Exactly. High-impact evals are operated. Gists and vendor boards are inputs, not the gate.
- Name an owner and a gate.
- Fund refresh of hard cases.
- Vendor boards are not your suite.
- Do not give the gate to marketing.
The company wants one platform: “fine-tune everything.” Your staff answer?
The strongest answer: Platform the boring bits — retrieval, eval, logging, authz — and let teams choose RAG, tools, or weights per job; a single fine-tune factory is a bottleneck with a brand
Why it works: Exactly. Shared eval and walls. Local choice of lever. One soup model is how you bake every team’s gossip together.
- Share eval, logs, and authz.
- Choose RAG, tools, or weights per job.
- Do not mandate a fine-tune factory.
- Do not soup every drive into one model.
Teams keep adding prompts that their model already passes. How do you protect the suite?
The strongest answer: A change-control on the suite, a hidden confirmation slice, and a rule that authors do not grade their own additions alone
Why it works: Exactly. Suites rot toward vanity. Control the door and keep a slice they cannot coach to.
- Change-control the eval suite.
- Keep a hidden confirmation slice.
- Authors do not solo-grade their adds.
- Do not fork or public-memorise the exam.