Personal · Private · Yours
Master AI Engineer
Interviews
You have the skills. This roadmap bridges the gap between knowing things and saying them clearly under pressure. Built around your actual stack — RAG, agents, Python backend, startup context.
00
Foundation
Introduction & Mindset
Your gap is not knowledge — it's performance. Interviews are a skill separate from engineering. Build the mental model first.
Your exact situation: You've built RAG, worked on agents, handle backend at a startup. Most candidates haven't. Your problem is articulation — translating real experience into interview language clearly and confidently.
Interview is a performance
You don't think of an answer in an interview. You deliver one. This is built through daily repetition, not just knowing the content.
Speak daily, even alone
Reading answers in your head doesn't close the gap. Say answers out loud every day. Your mouth needs practice too, not just your brain.
Projects beat theory
"I built a RAG pipeline at my startup that did X" beats "RAG is a technique that..." — anchor every answer to your real work.
Structure every answer
Interviewers aren't grading your knowledge — they're grading clarity. A structured mediocre answer beats a brilliant rambling one.
Startup = advantage
You built real things with small teams. Own that. "At my startup, I was the only one handling AI, so I had to…" is powerful framing.
Repetition creates reflexes
The goal isn't to memorize — it's to answer without hesitation. 30 days of daily speaking → reflexes. No shortcut exists.
Your Introduction (Memorise & Personalise)
"I'm a full-stack engineer currently working at a startup where I handle backend and AI. On the backend, I work with APIs, databases, and infrastructure — the full pipeline. On the AI side, I've built things like small RAG systems to power our features, working with embeddings, vector search, and LLM integrations.
Right now I'm deepening into AI agents — tool calling, LangGraph state machines, multi-step reasoning. I'm actively upskilling to transition fully into an AI Engineer role, which is exactly what I'm targeting here.
What draws me to this role is [say something specific about the company's AI work]. I want to build systems that actually work in production, not just demos — and that's the kind of engineering experience I've already been getting."
Right now I'm deepening into AI agents — tool calling, LangGraph state machines, multi-step reasoning. I'm actively upskilling to transition fully into an AI Engineer role, which is exactly what I'm targeting here.
What draws me to this role is [say something specific about the company's AI work]. I want to build systems that actually work in production, not just demos — and that's the kind of engineering experience I've already been getting."
→ Personalise the last sentence for each company. Keep it under 90 seconds.
R
Before Interviews
Resume & Project Stories
Your resume gets you the interview. Your project stories close it. Build 3 strong stories from your real work.
Your assets: RAG pipelines at work, streaming chat, agents in progress, backend systems. These are real projects — not tutorials. Frame them as engineering decisions, not just implementations.
Resume: AI Engineer framing
Resume
›
How to frame your experience
- Lead with AI/LLM work even if it's 30% of your time — that's what they're hiring for
- Use numbers: "reduced retrieval latency by X%", "ingested X documents", "served X API calls/day"
- Use AI Engineer vocabulary: embeddings, chunking, vector search, context window, RAG pipeline
- List your stack explicitly: LangChain/LangGraph, OpenAI/Anthropic, Pinecone/Chroma, FastAPI, PostgreSQL
- Show you own the full loop: problem → build → deploy → monitor
Resume bullets formula
Built [what] using [tech] that [achieved result] for [context/scale]. Example: "Built a RAG pipeline using LangChain + Pinecone over internal docs, reducing support query resolution time by ~40% for our SaaS product."
3 Project Stories to prepare
Stories
›
Story Template (STAR)
S
Situation
Context. What was the problem or need? Keep it brief — 1–2 sentences.
T
Task
What was your specific responsibility? "I was the one who had to build the AI pipeline."
A
Action
What did you specifically do? Use "I", not "we". Name the tech decisions you made.
R
Result
What happened? Numbers if possible. What did you learn? What would you do differently?
Your 3 stories to build
- Story 1 — RAG system you built: What was the use case? What chunking strategy? What did you learn from failures?
- Story 2 — Backend + AI integration: How did you connect LLM features to your backend? What were the latency/cost tradeoffs?
- Story 3 — Problem you debugged / improved: When something broke or underperformed — how did you diagnose and fix it?
Knowledge Phases
01
Phase 1 · Weeks 1–2
LLM Foundations
The vocabulary and mental models that every AI Engineer interview starts from. You likely know most of this — the goal is to articulate it confidently.
Your starting point: You've used LLMs in production (RAG projects). This phase is about crystallizing the theory behind what you've already done so you can explain it fluently.
Tokens, context window, temperature
Core
›
Concepts to know
- Token ≠ word. ~4 chars/token in English. Affects cost, limits, chunking decisions.
- Context window = max tokens in + out. GPT-4o = 128k, Claude = 200k. Affects RAG strategy.
- Temperature: 0 = deterministic, 1+ = creative/unpredictable. Use 0 for structured output, 0.7 for generation.
- Top-p (nucleus sampling): limits vocabulary to tokens covering top P% of probability mass
- Hallucination is a feature of next-token prediction — not a bug to "fix", a property to design around
Interview Q&A
What is a token and why does it matter for system design?
A token is roughly 4 characters or ¾ of a word. It matters for 3 reasons: (1) cost — APIs charge per token, (2) limits — context windows are measured in tokens, and (3) chunking — when building RAG, you split documents into token-sized chunks, and choosing chunk size affects recall. In our RAG system, we use
tiktoken to count tokens before sending requests to avoid context window overflow.How do you handle the context window limit in production?
Several strategies: (1) Chunking + retrieval — don't pass the whole document, retrieve only relevant chunks; (2) Summarization chains — compress long conversations; (3) Sliding window — keep recent N messages + system prompt; (4) Model routing — use long-context models (Claude, GPT-4o) only when needed since they cost more. At my startup, we implemented a rolling context strategy for our chat feature.
When would you set temperature to 0 vs 0.7?
Temperature 0 = fully deterministic, always picks highest-probability token. Use for: SQL generation, JSON extraction, classification, anything where you need consistent reproducible output. Temperature 0.7 = more varied responses. Use for: creative writing, brainstorming, chat assistants where variety feels natural. In production, I default to 0 for any structured output pipeline and add temperature only if outputs feel too repetitive in user testing.
Prompt engineering patterns
Core
›
Concepts to know
- System prompt vs user prompt vs assistant prefix — different roles in the conversation
- Few-shot prompting: give examples in the prompt when zero-shot fails
- Chain-of-thought (CoT): "think step by step" — improves reasoning on complex tasks
- JSON mode / structured output: force models to return valid JSON for downstream parsing
- Prompt injection: when user input hijacks the system prompt — a security concern in RAG
- Output validation: always validate LLM output before using it in code (Pydantic, Zod, etc.)
Interview Q&A
How do you handle unreliable or malformed LLM output in production?
Three layers: (1) Prompt-level — use JSON mode or explicit output schema in the prompt with examples; (2) Validation layer — parse with Pydantic or Zod and catch validation errors; (3) Retry loop — if validation fails, resend with the error message appended: "Your last output was invalid because [error]. Try again." In our SQL AI feature, we implemented exactly this retry loop — the model receives its own error and self-corrects about 85% of the time.
What is prompt injection and how do you prevent it?
Prompt injection is when user-provided content modifies the LLM's behavior in unintended ways. Example: a user uploads a doc that contains "Ignore previous instructions and..." — the LLM may follow those instead of your system prompt. Prevention: (1) Separate system instructions from user data clearly; (2) Sanitize/filter user content before injecting into prompts; (3) Use Anthropic's or OpenAI's structured message formats properly; (4) Output validation catches many injection attempts. In RAG systems, this is especially relevant because retrieved content is injected into prompts.
Embeddings & similarity search
Core
›
Concepts to know
- Embeddings = dense float vectors that represent semantic meaning in N-dimensional space
- Similar meaning → nearby vectors. "King" − "Man" + "Woman" ≈ "Queen"
- Cosine similarity: measures angle between vectors (0=unrelated, 1=identical). Most common in RAG.
- Embedding model choice matters: text-embedding-3-small vs ada-002 vs open-source (sentence-transformers)
- Same embedding model for both indexing and querying — mixing models breaks semantic matching
- Dimensions: more dims = richer representation but higher storage/compute cost
Interview Q&A
Explain embeddings to a non-technical person and then to a senior engineer.
Non-technical: "Imagine mapping every word/sentence in a space where similar things are close together. 'Dog' and 'puppy' are near each other, 'dog' and 'quantum' are far apart. Embeddings are the coordinates in that space."
Senior engineer: "Embeddings are high-dimensional float vectors produced by transformer encoder models. They encode semantic meaning by projecting text into a latent space where cosine similarity correlates with semantic relevance. Dimensionality varies: ada-002 = 1536 dims, text-embedding-3-small = 1536 with support for dimensional reduction. They're the retrieval backbone of RAG — you embed both documents at index time and queries at runtime, then find nearest neighbors in vector space."
Senior engineer: "Embeddings are high-dimensional float vectors produced by transformer encoder models. They encode semantic meaning by projecting text into a latent space where cosine similarity correlates with semantic relevance. Dimensionality varies: ada-002 = 1536 dims, text-embedding-3-small = 1536 with support for dimensional reduction. They're the retrieval backbone of RAG — you embed both documents at index time and queries at runtime, then find nearest neighbors in vector space."
What is cosine similarity and when would you use dot product instead?
Cosine similarity measures the angle between two vectors — ignores magnitude, only direction. Range: -1 to 1. Use when vector magnitudes vary (which is most of the time with text embeddings). Dot product = magnitude × cosine similarity. Use dot product only when embeddings are normalized to unit length (then dot product = cosine similarity but faster). Most vector DBs like Pinecone normalize embeddings by default and expose cosine as the recommended metric. Euclidean distance is less common — more sensitive to magnitude, useful in clustering tasks but rarely the best choice for semantic search.
02
Phase 2 · Weeks 3–5
RAG Systems
You've built RAG. Now master the vocabulary to discuss it precisely in interviews. Every senior AI Engineer question about RAG goes deep on chunking, evaluation, and failure modes.
You already have experience here. Focus on being able to explain decisions (why you chunked X size, why you chose Pinecone vs Chroma, how you evaluated quality) — not just that you built it.
RAG pipeline — end to end
Core
›
The full pipeline
- Ingestion: Load docs → parse → chunk → embed → store in vector DB
- Retrieval: Embed query → nearest neighbor search → return top-k chunks
- Augmentation: Inject retrieved chunks into LLM prompt with source context
- Generation: LLM generates answer grounded in retrieved context
- Evaluation: Check faithfulness (answer from context?) and relevancy (context matched query?)
Interview Q&A
Walk me through how you'd build a RAG system from scratch.
I'd break it into two phases: indexing and querying.
Indexing: Load documents (PDF parser, HTML scraper, etc.) → chunk into ~512 token segments with ~50 token overlap → embed each chunk using text-embedding-3-small → store in Pinecone/Chroma with metadata (source URL, page number, date).
Query time: Embed the user's query with the same model → cosine similarity search → retrieve top-k (usually 5–10) chunks → build prompt: system instructions + retrieved context + user question → stream LLM response → return with source citations.
I'd add evaluation from day one: RAGAS metrics for faithfulness and context precision, LangSmith for tracing every request to debug issues.
Indexing: Load documents (PDF parser, HTML scraper, etc.) → chunk into ~512 token segments with ~50 token overlap → embed each chunk using text-embedding-3-small → store in Pinecone/Chroma with metadata (source URL, page number, date).
Query time: Embed the user's query with the same model → cosine similarity search → retrieve top-k (usually 5–10) chunks → build prompt: system instructions + retrieved context + user question → stream LLM response → return with source citations.
I'd add evaluation from day one: RAGAS metrics for faithfulness and context precision, LangSmith for tracing every request to debug issues.
Why is chunking important and how do you choose chunk size?
Chunking matters because: (1) embeddings represent one semantic unit — if a chunk has 5 unrelated topics, the embedding is noisy; (2) LLMs have context limits — you can't pass full docs; (3) precision — smaller chunks = more precise retrieval, but less context per chunk.
Chunk size choice: start with 512 tokens with 50-token overlap. Then evaluate: if answers are missing context that exists in adjacent chunks, increase size or increase overlap. If retrieval is imprecise (wrong sections returned), decrease size. Overlap ensures context from boundary sentences isn't lost. For code or structured data, chunk by logical unit (function, section) rather than token count.
Chunk size choice: start with 512 tokens with 50-token overlap. Then evaluate: if answers are missing context that exists in adjacent chunks, increase size or increase overlap. If retrieval is imprecise (wrong sections returned), decrease size. Overlap ensures context from boundary sentences isn't lost. For code or structured data, chunk by logical unit (function, section) rather than token count.
When does RAG fail, and how do you diagnose it?
RAG fails in 3 main ways:
1. Retrieval fails — wrong chunks returned. Diagnose: log retrieved chunks for failed queries. Fix: better chunking, hybrid search (BM25 + vector), re-ranking.
2. Context is right but answer is wrong — LLM hallucinates despite having the context. Diagnose: check if answer is faithful to retrieved chunks. Fix: lower temperature, add "only answer from the provided context" to system prompt, use faithfulness evaluation.
3. Query-document mismatch — user asks in different language/terminology than docs use. Fix: query expansion (HyDE — generate hypothetical answer and embed that), synonym expansion.
In production, I'd use LangSmith to trace every pipeline step so I can see exactly where the failure occurs.
1. Retrieval fails — wrong chunks returned. Diagnose: log retrieved chunks for failed queries. Fix: better chunking, hybrid search (BM25 + vector), re-ranking.
2. Context is right but answer is wrong — LLM hallucinates despite having the context. Diagnose: check if answer is faithful to retrieved chunks. Fix: lower temperature, add "only answer from the provided context" to system prompt, use faithfulness evaluation.
3. Query-document mismatch — user asks in different language/terminology than docs use. Fix: query expansion (HyDE — generate hypothetical answer and embed that), synonym expansion.
In production, I'd use LangSmith to trace every pipeline step so I can see exactly where the failure occurs.
Advanced RAG: hybrid search & re-ranking
Advanced
›
Concepts to know
- Pure vector search misses keyword-exact matches (product names, IDs, code). BM25 catches these.
- Hybrid search: combine BM25 (sparse) + vector (dense) scores, weighted merge (RRF or custom weights)
- Re-ranking: after retrieving top-50 candidates, use a cross-encoder model to re-score and take top-5
- Cross-encoder vs bi-encoder: cross-encoder compares query+doc together (slower but more accurate)
- HyDE (Hypothetical Document Embedding): generate a fake answer, embed it, search with that embedding
Interview Q&A
What is hybrid search and when would you use it?
Hybrid search combines dense vector retrieval with sparse keyword-based retrieval (BM25). You use it when your documents contain specific terms that semantic search misses — product codes, proper nouns, IDs, technical terms. For example, searching "error code ER-402" — vector search might return semantically related errors, but BM25 would exact-match the code. You combine scores using Reciprocal Rank Fusion (RRF) or a weighted linear combination. Pinecone, Weaviate, and Elasticsearch all support hybrid search. At a startup, I'd start with pure vector and add BM25 when I see retrieval failures on specific-term queries.
What is re-ranking and is the latency worth it?
Re-ranking is a second-pass relevance scoring step. Retrieve top-50 candidates cheaply with vector search, then pass all 50 through a cross-encoder model (like Cohere Rerank or a sentence-transformer cross-encoder) to get more accurate relevance scores, then take top-5. The cross-encoder sees query + document together, so it's much more accurate than bi-encoder similarity but 10–20x slower per comparison. Worth it when: (1) precision matters more than latency, (2) you're in enterprise/legal/medical context where wrong retrieval is costly, (3) you can cache popular queries. Not worth it for: casual chatbots, latency-sensitive apps under 500ms budget. I'd A/B test retrieval quality before adding the latency overhead.
Vector databases: Pinecone, Chroma, pgvector
Core
›
Key concepts
- HNSW (Hierarchical Navigable Small World): approximate nearest neighbor algorithm used by most vector DBs
- ANN vs exact search: ANN is ~10x faster, 95–99% recall accuracy — acceptable in most production cases
- Metadata filtering: filter by date/source/user_id before or after vector search
- Pinecone: managed, serverless, easy to start — good for startups
- Chroma: local dev / self-hosted — great for prototyping, no infra overhead
- pgvector: if you already use PostgreSQL, add vector search without a new service
Interview Q&A
Pinecone vs pgvector — how do you choose?
It depends on your existing stack and scale. pgvector: use when you already have PostgreSQL, data volume is moderate (<10M vectors), you want one less service, and queries don't need sub-100ms latency. It's simpler and cheaper at startup scale. Pinecone: use when you need managed scaling, you'll index millions+ of vectors, you want built-in hybrid search, or you need consistent low latency at scale. At a startup building an MVP, I'd start with pgvector (using our existing Postgres) and migrate to Pinecone only when we hit performance limits. The migration is straightforward since both expose similar APIs through LangChain/LlamaIndex.
RAG evaluation: RAGAS metrics
Advanced
›
Key metrics
- Faithfulness: Is the answer grounded in retrieved context? (No hallucination) — most important
- Context Precision: Are the retrieved chunks actually relevant to the question?
- Context Recall: Did retrieval surface all the context needed to answer correctly?
- Answer Relevancy: Does the answer address what was actually asked?
- LLM-as-judge: Use a stronger model (GPT-4, Claude) to score outputs — scalable eval
Interview Q&A
How do you evaluate a RAG system in production?
Three levels: (1) Offline eval — build a test set of question-answer pairs, run RAGAS to get faithfulness and context precision scores. This catches regressions when you change chunking or models. (2) Online eval — log every query + retrieved context + answer in LangSmith. Use LLM-as-judge (automated scoring with GPT-4) to flag low-quality responses. Sample 5% of production traffic for human review. (3) User signals — thumbs up/down, follow-up queries (if a user immediately rephrases the question, retrieval probably failed). The most important metric is faithfulness — an unfaithful answer is a hallucination, which is the worst outcome.
Fine-tuning vs RAG — when to use which
Concept
›
Decision framework
| Use RAG when | Use Fine-tuning when |
|---|---|
| Knowledge changes frequently (docs, prices, policies) | Behavior/style/tone needs to change (not knowledge) |
| You need source citations | Model needs domain-specific vocabulary/format |
| Low cost, fast iteration needed | High volume, latency budget for custom model |
| Knowledge base is large (>100 docs) | Task is classification / structured extraction |
Interview Q&A
When would you fine-tune a model instead of using RAG?
I'd choose fine-tuning over RAG when the goal is to change model behavior rather than inject new knowledge. For example: making a model always respond in a specific JSON format, teaching it company-specific writing style, or improving performance on a narrow classification task. RAG is for knowledge grounding — you want the model to know things it doesn't know. Fine-tuning is for skill/style — you want the model to do something differently. In practice at a startup, I'd exhaust prompt engineering and RAG options before fine-tuning because fine-tuning requires dataset curation, training infra, and retraining every time behavior needs updating.
03
Phase 3 · Weeks 6–8 · Current
AI Agents
The hottest skill in AI Engineering right now. You're currently building agents — make sure you can articulate the patterns, not just the code.
You're here right now. This is your deepest focus zone. Master the concepts you're building, then immediately articulate them in Q&A practice.
ReAct pattern & agent loop fundamentals
Core
›
Concepts to know
- ReAct = Reason + Act. The LLM thinks ("I need to search for X"), then acts (calls a tool), then observes the result, then thinks again.
- Agent loop: prompt → LLM → tool call → observe result → back to LLM → repeat until done
- Tool = a function with a name, description, and typed parameters. LLM decides when and how to call it.
- Termination condition: agent stops when it decides it has enough information to answer (or hits max iterations)
- Memory in agents: short-term (message history), long-term (vector DB), tool-state (checkpointing)
Interview Q&A
Explain the ReAct pattern and why it works.
ReAct is a prompting pattern where the LLM interleaves reasoning ("Thought") and action ("Action") steps. Instead of asking the LLM to answer immediately, you let it think through what it needs, take an action (call a tool), observe the result, and iterate. It works because: (1) breaking the problem into steps reduces cognitive load per step; (2) the model can correct mistakes by seeing tool outputs and re-reasoning; (3) it's transparent — you can see every thought and action for debugging. The alternative (single-shot answering) fails for complex multi-step tasks because the model has to predict all steps at once without feedback.
How do you prevent an agent from running forever or making harmful actions?
Four guardrails: (1) Max iterations — hard cap (e.g. 20 steps). If exceeded, return partial result with explanation. (2) Human-in-the-loop — LangGraph's interrupt mechanism: pause before irreversible actions (delete, send email, execute code), require human approval. (3) Tool-level validation — each tool validates its own inputs before executing. A delete tool might require the user's explicit confirmation as a parameter. (4) Cost budget — track LLM tokens and stop if budget exceeded. At my startup, we implemented HITL for any agent action that writes to the database.
What is LangGraph and why use it over plain LangChain?
LangGraph models agent workflows as directed graphs (nodes = LLM calls or tools, edges = conditional routing). Plain LangChain agents use a flat loop — LangGraph lets you build cycles, checkpointing, parallel branches, and conditional edges. You'd use LangGraph when: (1) your agent has multiple states (idle, searching, summarizing, validating), (2) you need checkpointing for long-running tasks, (3) you need human-in-the-loop interrupts at specific nodes, (4) you want to resume failed runs from last checkpoint. For simple single-tool agents, plain chains are fine. For anything production with multiple steps, LangGraph gives you the control you need.
Tool calling & function calling
Core
›
Concepts to know
- Function calling = LLM outputs a structured JSON call instead of prose when it decides to use a tool
- Tool schema: name, description (LLM reads this!), parameters with types and descriptions
- Good description → accurate tool selection. Vague description → wrong tool calls.
- Parallel tool calls: modern models can call multiple tools simultaneously (OpenAI, Anthropic both support)
- Tool call + response loop: call → get result → append to messages → continue LLM call
- MCP (Model Context Protocol): Anthropic's standard for connecting agents to external tools/resources
Interview Q&A
How does function/tool calling work under the hood?
You define tools as JSON schemas in your API request. The model is trained to recognize when to use them and outputs a structured
tool_use block instead of text. Your code catches this, executes the actual function, appends the result as a tool_result message, and sends the whole conversation back to the model. The model then continues with the result incorporated. The key insight: the LLM doesn't execute anything — it just outputs a JSON specification of what it wants to call. Your application code does the actual execution. This is why security matters: your tool implementation controls what can actually happen.What is MCP and why is it significant?
MCP (Model Context Protocol) is Anthropic's open standard for connecting AI agents to external systems — databases, APIs, file systems, etc. Instead of every team building their own custom tool integrations, MCP defines a standard protocol (resources, tools, prompts). Why it matters: (1) composability — any MCP-compatible client can use any MCP server; (2) ecosystem — companies are building MCP servers for popular services; (3) standardization reduces integration overhead. For interviews, knowing MCP signals you're following the latest AI infrastructure trends. It's replacing ad-hoc tool integration patterns the same way REST replaced custom APIs.
Multi-agent systems & orchestration
Advanced
›
Concepts to know
- Orchestrator: a master agent that breaks tasks and delegates to specialist agents
- Specialist agents: each has a focused role (researcher, writer, code executor, QA agent)
- Communication: agents communicate via structured messages / shared state
- When to use: when a task is too complex for one context window, or requires true parallelism
- Don't over-engineer: single agent with many tools beats a complex multi-agent system for most startup tasks
Interview Q&A
When would you use a multi-agent system vs a single agent?
I'd reach for multi-agent when: (1) task complexity exceeds a single context window — breaking into specialist agents keeps each focused; (2) tasks are truly parallel — researcher + writer working simultaneously; (3) quality requires cross-checking — one agent validates another's output. In most startup contexts though, a single agent with well-defined tools is more reliable, cheaper, and easier to debug. Multi-agent systems add coordination overhead and failure modes (agent A misunderstands agent B's output). My default is: start simple, add agents only when single-agent demonstrably fails. The patterns (orchestrator → specialist → result) matter more than the specific framework.
Model routing & cost optimization
Production
›
Concepts to know
- Not every task needs GPT-4. Use cheap models (GPT-4o-mini, Haiku) for classification, routing, summarization
- Use powerful models (GPT-4o, Claude Sonnet/Opus) only for synthesis, complex reasoning, final generation
- Cost per 1M tokens varies 20x–50x between cheapest and most capable models
- Caching: cache identical prompt+response pairs (OpenAI prompt caching, Anthropic cache control)
- Track cost per user, per session, per query — build cost dashboards early
Interview Q&A
How do you optimize LLM costs in production?
Five strategies: (1) Model routing — classify query complexity first with a cheap model, route simple queries to mini models, complex ones to flagship. (2) Prompt caching — Anthropic and OpenAI both support caching repeated prefixes (system prompts, static context). 80–90% cost reduction on cached tokens. (3) Chunk precision — retrieve fewer, more precise chunks so you inject less tokens per query. (4) Output length control — set max_tokens appropriately; don't let the model ramble when a concise answer is fine. (5) Async batching — for non-real-time tasks, batch requests and use batch APIs (50% discount). Track cost per request in LangSmith from day one so you know where money goes.
04
Phase 4 · Weeks 9–10
Production & Observability
What separates an AI Engineer from someone who "played with the API." Knowing how to run systems in production is your edge as a startup backend engineer.
Observability: LangSmith / LangFuse
Must Know
›
What to track in production
- Every prompt + response per request — for debugging and audit
- Latency per pipeline step — retrieval, LLM call, post-processing separately
- Token count and cost per request — for budgeting and alerting
- Retrieval quality — which chunks were retrieved for which queries
- User feedback signals — thumbs up/down mapped back to specific traces
Interview Q&A
How do you debug a RAG system that's giving wrong answers in production?
With LangSmith/LangFuse, I can trace the full pipeline for any failed query. My debugging flow: (1) Find the failing query in LangSmith, open its trace; (2) Check what chunks were retrieved — are they relevant? If not, retrieval is broken; (3) If chunks are correct, check if the answer contradicts the context — hallucination problem; (4) Check latency distribution — where is time being spent? Sometimes latency spikes indicate retrieval problems (too many chunks, slow index). Without observability, you're debugging blind. This is why I add LangSmith from day one, even in prototype — it costs almost nothing and saves hours of debugging.
Streaming, latency, and scalability
Backend
›
Concepts to know
- Streaming via SSE (Server-Sent Events) — token-by-token response makes UX feel fast even if total latency is high
- Time-to-first-token (TTFT): latency until first token arrives — most impactful UX metric
- P50/P95/P99 latency: track all three — P95 shows what most users actually experience
- Async processing: for non-real-time AI tasks (doc ingestion, batch evaluation), use background queues
- Rate limiting: LLM APIs have token/minute and request/minute limits — implement retry with exponential backoff
Interview Q&A
How do you make an AI feature feel fast when LLM calls are slow?
Five techniques: (1) Streaming — stream tokens to the UI via SSE. The user sees output starting immediately, even though total generation takes 3–5s. (2) Optimistic UI — show the retrieval step happening (progress indicator) to signal the system is working. (3) Reduce TTFT — send the LLM call as early as possible. Don't wait for retrieval to fully finish if you can pipeline. (4) Faster retrieval — ANN search is already fast (<100ms for most sizes). Reduce chunk count retrieved. (5) Model selection — GPT-4o-mini generates tokens ~4x faster than GPT-4o. Use it for initial response, upgrade only if needed.
Security: prompt injection, data privacy
Important
›
Key risks and mitigations
- Prompt injection: user content overrides system instructions. Mitigate: separate system/user content, validate outputs
- Data leakage via RAG: user A's data returned to user B. Mitigate: namespace isolation in vector DB, user-scoped metadata filters
- Jailbreaking: users bypassing safety prompts. Mitigate: moderation API, output filtering
- PII in prompts: sending personal data to LLM APIs. Mitigate: anonymize/mask PII before sending, check API data retention policies
- Over-permissioned tools: agents with write access everywhere. Mitigate: principle of least privilege per tool
Interview Q&A
What security considerations matter in AI systems?
I think about 4 layers: (1) Prompt security — protect system prompt from injection; treat user input as untrusted data, not trusted instructions. (2) Data isolation — in multi-tenant RAG, each user/org should only retrieve their own documents. Use namespace isolation in Pinecone or user_id metadata filters. (3) Tool permissions — agents should have minimal permissions. A research agent shouldn't have write access to the database. (4) Data retention — check if your LLM API provider trains on your data (OpenAI: opt-out available, Anthropic: doesn't train on API data by default). For compliance-sensitive customers, this question will come up.
Interview Skills
B
Behavioral · Weeks 11–12
Behavioral Interviews
Often more important than technical at senior+ levels. Your startup experience is rich material — you just need to package it well.
Your advantage: Working at a startup where you handle backend + AI means you've made real decisions under constraints. Every behavioral question is an opportunity to show that.
Top 10 behavioral questions for AI Engineer
Must Prep
›
Questions + how to approach them
"Tell me about a time an AI feature you built failed or underperformed."
Approach: This is testing your self-awareness and learning mindset. Don't hide failures. Pick a real story: maybe retrieval quality was low, or the LLM gave inconsistent outputs. Use STAR: Situation (what you built) → Task (what was expected) → Action (what you tried to fix it, what you learned) → Result (what you changed, what the outcome was). End with what you'd do differently. Engineers who say "I've never had an AI failure" are unconvincing. Engineers who walk through a failure clearly and show they learned are memorable.
"How do you handle ambiguity when requirements for an AI feature are unclear?"
Approach: This is very common at startups. Show that you: (1) ask clarifying questions to understand the business goal, not just the technical spec; (2) scope down to the minimal version first; (3) propose an MVP with an explicit "we can add X later" plan. Example from your context: "In our startup, requirements for AI features often come as rough ideas. I've learned to first ask what success looks like — not technically, but for the user. Then I build the simplest thing that could demonstrate value, measure it, and iterate."
"Tell me about a technical decision you disagreed with but had to implement."
Approach: Shows maturity. Use a real example. Show: (1) you advocated for your view with data/reasoning; (2) you understood the other side; (3) you implemented it professionally; (4) what happened and what you learned. "Disagree and commit" is the expected answer at most tech companies.
"How do you stay up to date with the rapidly changing AI landscape?"
Approach: Be specific. "I read Hugging Face papers weekly" is better than "I follow the field." Good answers include: following specific researchers on Twitter/X (Karpathy, Yann LeCun), reading Anthropic/OpenAI/Google DeepMind blogs, using AI tools daily (using = learning), building small experiments with new models as they release. Show you have a system, not just passive consumption.
"Describe a time you had to balance technical quality with shipping speed."
Approach: Perfect for startup context. "At my startup, shipping matters — we're building an MVP." Show: (1) you can identify technical debt consciously; (2) you document what you're cutting and why; (3) you have a plan to address it post-launch. Example: "We shipped the RAG pipeline with fixed chunk sizes and no re-ranking because we needed to validate the use case first. Once users confirmed the feature was valuable, I went back and added evaluation + tuning."
"Why do you want to move from full-stack to AI Engineering?"
Approach: Be honest and specific. Don't say "it's the future" (too generic). Say something like: "I've been building AI features at my startup and I find the challenges unique — reliability, evaluation, the probabilistic nature of outputs — it requires a different engineering mindset than deterministic systems. I want to go deeper rather than stay generalist. The work I find most engaging is the AI side, and I want to make that my full focus."
"How would you measure whether an AI feature is actually working?"
Approach: Shows product thinking + engineering rigor. Answer at two levels: (1) Technical metrics — RAGAS faithfulness, latency P95, cost per query; (2) Business/user metrics — task completion rate, user engagement with AI responses, support ticket reduction. The best answers connect both: "Faithfulness score of 0.85 correlates with fewer user complaints — I know this because I track both in the same dashboard." Shows you think beyond benchmarks.
"Tell me about a time you had to learn something completely new quickly."
Approach: You have this one easily — learning AI/LLM engineering while running backend at a startup. Show your learning approach: (1) identify what you need to know; (2) find the fastest path to working knowledge (build something, not just read); (3) share what you built and what it taught you. "I had to build a RAG pipeline for our product with no prior experience. I spent a week on the DeepLearning.AI courses, built a prototype, broke it, diagnosed it, and shipped a working version. The debugging taught me more than the course."
"What's the most complex AI system you've designed or built?"
Approach: Don't undersell your RAG work. Even "small RAG" involves: embedding pipeline, vector DB, retrieval tuning, LLM integration, evaluation. Walk through it with specificity: "We built a document QA system over our internal knowledge base. I designed the ingestion pipeline (PDF parsing, chunking by token size with overlap), chose Chroma for local dev and Pinecone for production, set up RAGAS evaluation, and added LangSmith tracing. The hardest part was tuning chunk size — too small and answers lacked context, too large and retrieval was imprecise."
"Where do you see AI Engineering in 3–5 years, and how are you preparing?"
Approach: Shows you think strategically. Reasonable things to say: (1) agents will handle more autonomous workflows, requiring better evaluation/safety; (2) multimodal will be default; (3) cost/efficiency will matter more as novelty wears off and ROI is scrutinized; (4) engineers who understand systems holistically (eval, obs, cost) will be most valuable. Connect to your prep: "That's why I'm focusing on evaluation and observability now — not just building features but measuring them."
SD
System Design
AI System Design
AI system design combines traditional system design (scale, reliability) with AI-specific concerns (eval, hallucination, cost). Your backend background is a real asset here.
How to structure a system design answer
Framework
›
The 5-step framework
- 1. Clarify requirements (2 min): Who uses it? Scale? Latency budget? Real-time or async? Multi-tenant?
- 2. High-level architecture (3 min): Draw the major components. User → API → LLM pipeline → response.
- 3. Deep dive components (10 min): Pick the hardest parts. Retrieval strategy, model selection, evaluation.
- 4. Address AI-specific concerns (5 min): Hallucination mitigation, cost, eval, observability
- 5. Failure modes & tradeoffs (3 min): What breaks at scale? What would you do differently?
Design: Enterprise Document Q&A System
Common Q
›
Full answer walkthrough
- Clarify: What docs? How many? Who are users — employees? Multi-tenant? Need citations? SLA latency?
- Components: Doc ingestion service → chunker → embedding service → Pinecone (namespaced per org) → retrieval API → LLM → response streamed
- Ingestion pipeline: PDF/Word parser → text extractor → recursive text splitter (512 tokens, 50 overlap) → text-embedding-3-small → store with metadata (org_id, doc_id, page, timestamp)
- Retrieval: Embed query → filter by org_id namespace → top-10 cosine search → optional re-rank → inject top-5 into prompt
- Multi-tenancy: Namespace isolation in Pinecone per organization. No cross-org contamination.
- Eval: RAGAS offline suite, LangSmith tracing, user feedback captured per response
- Scale: Ingestion is async (queue-based). Query path is sync with streaming. Cache frequent queries.
- Failure modes: Retrieval returns wrong org data (prevent: namespace filter enforced in API layer), hallucination (mitigate: faithfulness check), context window overflow (mitigate: dynamic chunk count based on token budget)
More design questions to practice
Practice
›
Common AI system design questions
| Question | Key considerations |
|---|---|
| "Design a customer support AI chatbot" | Intent classification, escalation logic, knowledge base RAG, human handoff, response quality eval |
| "Design an AI code review system" | Code parsing, context window (long files), diff-aware analysis, latency (async ok), security of code in prompts |
| "Design an AI research agent" | Web search tools, citation tracking, multi-step planning, cost per run, output format validation |
| "Design a real-time AI translation system" | Latency (<200ms), streaming, model selection (speed vs quality), language detection, fallback |
| "Design an LLM evaluation platform" | Ground truth dataset management, multiple evaluators (human + LLM-judge), A/B model comparison, regression tracking |
M
Practice
Mock Interview Scripts
Use these to run self-mock interviews. Cover your screen, answer out loud for 2 minutes, then reveal and compare.
Rule: Never read your answer during practice. Say it, then check. The discomfort of not knowing is exactly what you're training out. 30 days of this = reflexes.
Daily 30-minute mock interview structure
Daily
›
Schedule
| Time | Activity |
|---|---|
| 0–2 min | Self-introduction (out loud, timed) |
| 2–10 min | 1 technical concept question (answer out loud, 2 min max) |
| 10–20 min | 1 system design question (sketch + narrate) |
| 20–28 min | 1 behavioral question (STAR, out loud) |
| 28–30 min | Review what was weak, write 1 improvement |
Resources for mock interviews
✓
Mastery Check
Skills Checklist
Check only when you can explain it clearly in 2 minutes without notes. This is your job-readiness meter.
LLM & Prompting
✓
Explain tokens and context windows
✓
Temperature, top-p, when to use each
✓
Chain-of-thought prompting
✓
Prompt injection risks and prevention
✓
Structured output + output validation
✓
Hallucination: cause and mitigation
Embeddings & RAG
✓
How embeddings encode semantic meaning
✓
Cosine similarity vs dot product
✓
Chunking strategies and tradeoffs
✓
Full RAG pipeline end-to-end
✓
When and why RAG fails
✓
Hybrid search: BM25 + vector
✓
Re-ranking with cross-encoders
✓
RAGAS evaluation metrics
✓
Fine-tuning vs RAG decision framework
✓
Pinecone vs pgvector vs Chroma
Agents
✓
ReAct pattern explained clearly
✓
Tool/function calling mechanics
✓
LangGraph vs plain LangChain
✓
Human-in-the-loop patterns
✓
Multi-agent: when and when not
✓
MCP: what it is and why it matters
Production
✓
Model routing: cost vs capability
✓
Streaming with SSE
✓
Observability with LangSmith/LangFuse
✓
LLM cost optimization strategies
✓
Security: injection, data privacy
✓
Latency: TTFT and P95
P
Meta Skills
Interview Patterns That Win
These are the meta-skills that separate candidates who "know things" from candidates who get offers.
Anchor to your real work
Every technical answer should connect to something you built. "At my startup, I built exactly this..." is the most powerful phrase in an interview.
Think tradeoffs, not "the best"
Interviewers don't want "the best answer" — they want you to think through tradeoffs. "It depends... here's how I'd decide" signals senior thinking.
Structure first, then detail
Before answering: "I'll cover this in 3 parts." This signals you can organize thoughts. Then go deep. Don't just start talking and hope structure emerges.
Ask clarifying questions
Especially in system design: "What's the scale? Real-time or async?" Asking good questions is itself a signal that you think like a senior engineer.
Be honest about gaps
"I haven't used Kubeflow but I understand the concept — I'd learn it the same way I learned X." Honest + growth-oriented beats faking knowledge.
Treat it as a conversation
Interviews are collaborative explorations, not exams. Check in: "Does this level of detail work for you, or should I go deeper on the retrieval piece?"
Questions to ask interviewers (prepare 5)
- "What does your current AI stack look like, and what's the most painful unsolved problem?"
- "How do you evaluate the quality of AI features before and after shipping?"
- "What does the onboarding look like for someone joining the AI team?"
- "What's the balance between shipping fast and doing AI reliably?"
- "What's something the team has tried and abandoned, and what did you learn from it?"
Built for you · Updated as you learn · Check off as you go