- The generative map
- Prompting that actually helps
- RAG: retrieve, then generate
- Tools & agents (light)
- Why models hallucinate
- How to evaluate GenAI features
- Interview questions
The generative map
Generative models produce new samples — text, images, audio — instead of only labelling inputs.
- Autoregressive LMs — next-token transformers (ChatGPT-class). Your daily GenAI workhorse.
- Diffusion — start from noise, iteratively denoising into an image (Stable Diffusion, Imagen). Dominant for modern image gen.
- GANs — generator vs discriminator. Historically huge for images; less central now for product LLMs, still appears in interviews.
- VAEs — probabilistic latent models; useful intuition, niche products.
For most ML / GenAI engineer interviews in 2026, depth on LLMs + RAG + eval beats memorising every generative family.
Prompting that actually helps
- Be specific — role, format, constraints, examples of good output.
- Few-shot — show 2–5 examples when the task is picky.
- Chain-of-thought — ask for stepwise reasoning on hard problems; verify it doesn’t invent steps for factual lookups.
- Separate instructions from data — clear delimiters reduce prompt-injection confusion.
- Version prompts — treat them as code; A/B and regress on an eval set.
RAG: retrieve, then generate
Retrieval-Augmented Generation keeps knowledge outside the model:
1. Ingest docs → chunk → embed → vector index (+ keyword/hybrid) 2. On query → retrieve top-k passages 3. Stuff passages into the prompt with instructions 4. Generate an answer that must cite those passages 5. Evaluate retrieval hit rate + answer faithfulness
When RAG wins: private docs, frequently changing facts, need for citations, compliance. When fine-tune wins: style, format, tool-calling habits — not a weekly FAQ refresh.
RAG failure modes (memorise these)
- Bad chunking (splitting mid-table / mid-clause)
- Wrong embedding model or missing hybrid search
- Retrieved junk → fluent wrong answer
- Stale index after docs change
- No abstention when evidence is weak
Your FilingPilot project is this pattern on financial documents — highest GenAI portfolio signal.
Tools & agents (light)
An LLM can call tools: search, SQL, calculator, ticket API. Pattern:
model proposes a tool call → your code runs it → result returns to the model → final answer
“Agents” chain multiple steps. Start simple: one tool, clear schema, hard timeouts, logged traces. Multi-agent theatre is optional; reliable tool loops are not.
Why models hallucinate
They sample plausible tokens, not truth. Causes: knowledge gaps, bad retrieval, prompts that force an answer, overconfident decoding.
Mitigations: RAG with citations, allow “I don’t know,” constrained decoding / JSON schemas, grounding checks, human review on high stakes, eval sets for factuality.
How to evaluate GenAI features
Offline fixed question set · exact checks where possible
retrieval hit rate · citation accuracy · format validity
rubric / human spot checks · LLM-as-judge only with audits
Online thumbs, escalation rate, task success, latency, $/request
Safety injections, PII leaks, jailbreaks — separate test suites
Never ship on vibes. A 20-question eval set beats a demo every time in interviews.
Interview questions
Also in the interview bank.
RAG vs fine-tuning — when do you pick which?
RAG for changing/private/citable knowledge. Fine-tune for style, format, tool-use patterns. Many production systems use both.
Why do LLMs hallucinate?
They predict plausible tokens, not ground truth. Mitigate with retrieval, abstention, constraints, and factuality evals.
How would you evaluate an LLM feature?
Fixed offline eval set + task metrics + human spot checks; track online quality, latency, and cost. Don’t trust a single judge score alone.
Name three RAG failure modes.
Bad chunking, poor retrieval, stale indexes — each can produce fluent wrong answers. Strong candidates also mention weak abstention.
What is prompt injection?
Untrusted content (user or retrieved docs) that tries to override system instructions. Defend with separation of privileges, allowlists for tools, and treating retrieved text as data, not commands.