这是题库文档而非可运行代码,无需安装;部分题目只给链接、README 内无答案正文;答案分散在博客、YouTube、X 等外部站点,需自行访问
ai-engineering-interview-questions
amitshekhariitbhuApache-2.0活跃维护一份 AI 工程面试速查题库,覆盖 Agent、LLM 推理、微调、量化、MCP 等考点,帮求职者系统准备面试。
Your Cheat Sheet for AI Engineering Interview – Questions and Answers.
暂无版本3,632star +13 / 7 天646fork同步于 2026-11-10 23:41 UTC
AI 工程面试题库,按主题整理问题与答案链接,帮你系统准备 LLM、RAG、Agent 等岗位面试
一份 AI 工程面试速查题库,覆盖 Agent、LLM 推理、微调、量化、MCP 等考点,帮求职者系统准备面试。
核心能力
- 按 LLM 基础、RAG、Agent、微调等 15 个主题分章组织
- 覆盖 AI Engineer、LLM Engineer、MLOps 等十余种岗位
- 每题附博客、视频或推文链接作为参考答案
- 包含 KV cache、RoPE、GQA 等底层机制细节题
- 提供场景类问题,如上下文超限、结构化输出失败
容易踩的坑
内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选共 0 条
还没有人点评。第一个说出真实体验的人最有价值。
AI Engineering Interview Questions and Answers
AI Engineering Interview Questions and Answers - Your Cheat Sheet For AI Engineering Interviews
These interview questions and answers are helpful for roles such as:
- AI Engineer
- Gen AI Engineer
- LLM Engineer
- Agentic AI Engineer
- AI Agent Engineer
- Forward Deployed Engineer
- AI Solutions Architect
- AI Platform Engineer
- Applied AI Engineer
- MLOps Engineer
- LLMOps Engineer
Table of Contents
- Must Know
- LLM Fundamentals
- Prompt Engineering
- Retrieval-Augmented Generation (RAG)
- AI Agents and Agentic Systems
- Fine-Tuning and Model Adaptation
- Vector Databases and Embeddings
- AI System Design
- LLMOps and Production AI
- Evaluation and Testing
- AI Safety, Ethics, and Responsible AI
- Multimodal AI
- AI Infrastructure and Scalability
- Coding and Practical Implementation
- Behavioral and Scenario-Based Questions
Prepared and maintained by the Founder of Outcome School: Amit Shekhar
Follow Amit Shekhar
Follow Outcome School
I teach at Outcome School
Note: We will keep updating this with new questions and answers.
Must Know
- LLM
- RAG
- MCP
- Agent
- Fine-tuning
- Quantization
Learn about the LLM, RAG, MCP, Agent, Fine-tuning & Quantization: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
LLM Fundamentals
- What are foundation models, and how have they changed AI engineering?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- What is a Large Language Model (LLM), and how does it work?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization and How does an LLM work?
- Inside ChatGPT: What Happens After You Hit Enter?
- What is the Transformer architecture and how does it work?
- What are the key components of the Transformer architecture?
- Walk me through what happens, step by step, in one forward pass of a decoder-only Transformer.
- What is tokenization in LLMs?
- Explain BPE (Byte Pair Encoding).
- Answer: Byte Pair Encoding
- Explain WordPiece and SentencePiece.
- What is positional encoding, and why is it needed in Transformers?
- Answer: Positional Embeddings in LLMs
- What are embeddings?
- Answer: Embeddings in Machine Learning
- Explain the Query(Q), Key(K), and Value(V) in attention.
- What is self-attention, and how does it work in Transformers?
- Answer: Self Attention in Transformers
- What is Cross Attention in Transformers?
- Answer: Cross Attention in Transformers
- Why do we scale the dot product attention by √dₖ in the Transformer architecture?
- What is causal masking?
- Answer: Causal Masking in Attention
- What are multi-head attention mechanisms? Why use multiple attention heads?
- What are Feed-Forward Networks in LLMs?
- Answer: Feed-Forward Networks in LLMs
- What is Generative AI?
- Answer: What is Generative AI?
- What is the context window in LLMs, and why does it matter?
- Why is the context window limited in LLMs?
- What is temperature in the context of LLMs, and how does it affect output?
- Why is the first token slower than the rest in an LLM?
- Explain Top-p (nucleus) sampling and Top-k sampling. How do they differ?
- Compare greedy decoding, beam search, top-k, top-p, and temperature sampling. When does each fail?
- What are logits, and how are they used in text generation?
- What are stop tokens in LLMs, and how does an LLM know when to stop generating?
- Answer: Stop Tokens in LLMs
- What is the difference between a stop token and a stop sequence?
- Answer: Stop Tokens in LLMs
- What are skip connections (residual connections) in Transformers?
- What is the difference between open-source and closed-source LLMs? When would you choose one over the other?
- What is the difference between encoder-only, decoder-only, and encoder-decoder Transformer architectures?
- What is KV cache, and how does it speed up inference?
- Answer: What is KV Cache in LLMs?
- Estimate the KV cache memory needed to serve a large model. How does it constrain batch size and context length?
- Answer: KV Cache Compression
- KV Cache Compression
- Answer: KV Cache Compression
- What is model distillation, and how is it used with LLMs?
- What is Mixture of Experts (MoE), and how does it work in models like Mixtral?
- Answer: Mixture of Experts Explained
- What is the difference between dense and sparse models?
- Answer: Mixture of Experts Explained
- How does DeepSeek-V4 work?
- What is Flash Attention?
- Answer: Decoding Flash Attention in LLMs
- What is Cross-Entropy Loss?
- Answer: Math Behind Cross-Entropy Loss
- What is KL Divergence?
- What is Grouped-Query Attention (GQA), and how does it differ from Multi-Head Attention (MHA)?
- Answer: Grouped Query Attention
- How does Sliding Window Attention work?
- How do Attention Sinks work?
- Answer: How do Attention Sinks work?
- How does Rotary Position Embedding (RoPE) work, and why is it preferred over learned positional embeddings?
- Explain Layer Normalization
- Explain RMSNorm (Root Mean Square Layer Normalization)
- Why do modern Transformers use Pre-LayerNorm (Pre-Norm) instead of Post-LayerNorm?
- What are scaling laws (Chinchilla), and how do they guide model size vs training data decisions?
- Your LLM keeps ignoring your instructions. How do you make it follow structured output formats?
- Your LLM-powered tool hits the context window limit on long documents. How do you handle it?
- Your LLM does not admit when it does not know the answer. How do you make it say "I don't know"?
- Your LLM generates responses that are too verbose. How do you control response length?
- Your LLM memorized proprietary training data and leaks it in responses. How do you prevent this?
- Your LLM coding assistant generates outdated code using deprecated libraries. How do you fix it?
- Your tokenizer splits important domain terms into meaningless subword pieces. How do you fix it?
- Your Transformer's KV cache grows too large during long sequence generation. How do you manage memory?
- Answer: Paged Attention in LLMs
- Your Transformer runs out of memory on long documents due to quadratic self-attention. How do you scale it?
- Your distilled student model fails on the complex reasoning that the teacher model handled. How do you close the gap?
- After RLHF alignment, your LLM became safer but lost capability on hard tasks. How do you manage the alignment tax?
- Your RLHF-trained LLM is gaming the reward model instead of being genuinely helpful. How do you fix reward hacking?
- Your chatbot loses context after 10 turns in a conversation. How do you maintain a long conversation context?
- Answer: AI Agent Memory
- Your chatbot fails when users switch topics mid-conversation. How do you handle topic switches?
- Your QA system always generates an answer even when no answer exists in the context. How do you detect unanswerable questions?
- Your summarization system hallucinated facts not in the original article. How do you fix it?
- Your text generation repeats phrases in long outputs. How do you fix repetition?
- Transformers work on text, so can they also understand images?
- Small Language Models (SLMs)
- Answer: Small Language Models (SLMs)
- Large Reasoning Models (LRMs)
- Answer: Large Reasoning Models (LRMs)
- Jev and System One Models
- What are Autoregressive Models?
- Answer: Autoregressive Models
- Explain the difference between autoregressive and masked language modeling.
- Proximal Policy Optimization (PPO)
- Direct Preference Optimization (DPO)
- Group Relative Policy Optimization (GRPO)
- Recursive Language Models (RLMs)
- Answer: Recursive Language Models (RLMs)
- Continual Learning in LLMs
- Answer: Continual Learning in LLMs
- What is Recursive Self-Improvement (RSI)?
- How do Diffusion Language Models (DLMs) work?
- How Does LLM Watermarking Work?
- Answer: How Does LLM Watermarking Work?
- How do RNNs and Transformers differ?
Prompt Engineering
- What is prompt engineering, and why is it critical for AI applications?
- Explain zero-shot, one-shot, and few-shot prompting with examples.
- What is chain-of-thought (CoT) prompting, and when should you use it?
- Explain self-consistency prompting and how it improves reasoning.
- What is tree-of-thought prompting?
- Answer: How does Tree of Thoughts work?
- What is ReAct (Reasoning + Acting) prompting, and how does it work?
- Answer: ReAct Agent
- What is a system prompt, and how does it influence model behavior?
- How do you structure prompts for consistent structured output (JSON, XML)?
- What is prompt injection, and how do you defend against it?
- Answer: Prompt Injection in LLMs
- What is jailbreaking in LLMs, and what are common jailbreak techniques?
- How do you optimize prompts for cost and latency?
- What is the difference between prompt engineering and prompt tuning?
- What is a prompt template, and how do you design one for production use?
- How do you handle multi-turn conversations with LLMs?
- What is role prompting, and when is it effective?
- What is prompt chaining, and how do you design a chain of prompts for complex tasks?
- Answer: How does Prompt Chaining work?
- How do you evaluate and iterate on prompt quality?
- What are meta-prompts, and how can they be used to generate prompts?
- What are the common failure modes in prompting, and how do you debug them?
- How do you handle edge cases and adversarial inputs in prompt design?
- What is the "lost in the middle" problem in long-context prompting?
- What are output parsers, and why are they needed for production applications?
- How do you handle multi-language prompting effectively?
- Your few-shot prompting gives inconsistent results across similar inputs. How do you stabilize it?
- Your LLM classification system is too sensitive to prompt wording changes. How do you reduce prompt sensitivity?
- Your chatbot's system prompt containing proprietary business logic is being leaked by users. How do you prevent it?
- Your LLM agent is vulnerable to prompt injection that reveals the system prompt. How do you defend it?
- Answer: Prompt Injection in LLMs
- Your chain-of-thought prompting is not improving LLM accuracy on reasoning tasks. What do you fix?
- Your AI system works in English but fails for other languages. How do you add multilingual support?
- Your zero-shot cross-lingual transfer from English fails on other languages. How do you fix it?
Retrieval-Augmented Generation (RAG)
- What is Retrieval-Augmented Generation (RAG), and why is it important?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- Explain the architecture of a basic RAG system.
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- What are the key components of a RAG pipeline?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- What are chunking strategies, and how do you choose the right chunk size?
- Answer: Chunking Strategies for RAG
- Compare fixed-size chunking, semantic chunking, and recursive chunking.
- Answer: Chunking Strategies for RAG
- What is Contextual Retrieval, and how does it improve RAG?
- What are embedding models, and how do they convert text to vectors?
- Answer: What are Embeddings?
- How do you choose an embedding model for your RAG system?
- Explain Agentic RAG.
- Answer: Agentic RAG
- What is hybrid search, and why is it better than pure vector search?
- Answer: How does Hybrid Search work?
- What is re-ranking, and how does it improve RAG retrieval quality?
- Answer: How does a Reranker work?
- What is ColBERT, and how does late interaction retrieval work?
- Compare reranker architectures: cross-encoder, ColBERT, and LLM-based rerankers.
- How do you handle multi-document and multi-hop questions in RAG?
- Answer: Agentic RAG and GraphRAG
- What is the "lost in the middle" problem in RAG systems?
- How do you evaluate a RAG system? Explain faithfulness, relevance, and context precision/recall.
- Answer: LLM Evaluation
- Explain Self-RAG. How does the model decide when to retrieve?
- Answer: Agentic RAG
- What is GraphRAG, and when would you use it over traditional RAG?
- Answer: GraphRAG
- Vectorless RAG
- Answer: Vectorless RAG
- How do you handle structured data (tables, SQL databases) in a RAG pipeline?
- What are the common failure modes of RAG systems, and how do you debug them?
- How do you handle document updates and maintain freshness in a RAG system?
- How do you optimize RAG for latency in production?
- What is the role of metadata filtering in RAG systems?
- Answer: How does a Vector Database work?
- Compare RAG vs fine-tuning. When would you use each?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- Long context windows keep getting cheaper. When should you use retrieval (RAG) vs putting everything in the context window?
- What is query transformation in RAG (HyDE, query decomposition, step-back prompting)?
- How do you implement citation and source attribution in RAG?
- How do you scale a RAG system to millions of documents?
- What is parent-child chunking, and how does it improve retrieval?
- Answer: Chunking Strategies for RAG
- Your RAG system is hallucinating despite having the right context. How do you fix it?
- Your RAG chunk overlap causes redundant results. How do you reduce redundancy?
- Your RAG retrieval is too slow with a large knowledge base. How do you speed it up?
- Your RAG system returns duplicate results. How do you deduplicate?
- Your RAG system needs per-user access control on internal documents. How do you implement it?
- Your RAG system fails on domain-specific jargon. How do you fix it?
- Answer: How does Hybrid Search work?
- Your text-only RAG system now needs to handle images and tables. How do you extend it?
- Your RAG knowledge base gets updated frequently and needs versioning. How do you manage it?
- Your RAG system fails on multi-hop questions that require combining multiple facts. How do you fix it?
- Answer: Agentic RAG and GraphRAG
- Your enterprise RAG system returns contradictory answers from different source documents. How do you resolve conflicts?
- Your RAG system returns outdated answers from an evolving knowledge base. How do you keep it current?
- Your RAG system struggles with PDF documents containing tables and layouts. How do you fix PDF parsing?
AI Agents and Agentic Systems
- What is an AI agent, and how does it differ from a simple LLM call?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization and AI Agent Explained
- AI Agent Memory
- Answer: AI Agent Memory
- Harness Engineering in AI
- Answer: Harness Engineering in AI
- What matters more for an agentic coding tool like Claude Code: the model or the harness?
- Answer: Harness Engineering in AI and How does Claude Code work?
- Explain the ReAct (Reasoning + Acting) agent architecture.
- Answer: ReAct Agent
- What is the Plan-and-Execute agent pattern?
- Answer: Plan-and-Execute Agent
- What is tool use (function calling) in LLMs, and how does it enable agents?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization and How does Function Calling work in LLMs?
- What is the difference between structured output and function calling?
- How do you design and define tools for an AI agent?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- How does an agent decide when to call a tool versus answering from its own knowledge?
- What is the difference between single-agent and multi-agent systems?
- Answer: Multi-Agent Systems
- When do multi-agent systems break down, and when is a single agent the better choice?
- Answer: Multi-Agent Systems
- What is Model Context Protocol (MCP), and how does it standardize tool integration?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization and What is MCP (Model Context Protocol)?
- How does MCP differ from traditional function calling?
- What are AI SubAgents?
- Answer: AI SubAgents
- What are the different types of agent memory (short-term, long-term, episodic)?
- Answer: AI Agent Memory
- How do you handle agent failures and implement error recovery?
- What is an agent loop, and how does it decide when to stop?
- Answer: AI Agent Loop
- Context Engineering
- Answer: Context Engineering
- How does context compaction work?
- Loop Engineering
- Answer: Loop Engineering
- Graph Engineering
- Answer: Graph Engineering
- How AI Agents Communicate?
- Answer: How AI Agents Communicate
- What are Agent Skills?
- Answer: What are Agent Skills?
- How do you evaluate and test AI agents?
- Answer: AI Agent Evaluation
- What are the security risks of agentic systems, and how do you mitigate them?
- Answer: Prompt Injection in LLMs
- Your agent reads untrusted content (emails, web pages, documents) and can call tools. How do you prevent indirect prompt injection and data exfiltration?
- Answer: Prompt Injection in LLMs
- What is the difference between reactive and proactive agents?
- How do you manage token consumption and cost in long-running agent workflows?
- What is the human-in-the-loop pattern for agents, and when is it needed?
- How do you implement guardrails for AI agents to prevent harmful actions?
- Answer: How do LLM guardrails work?
- What is agent reflection, and how does it improve agent performance?
- Answer: Reflection Agent
- What is the difference between code-generating agents and tool-calling agents?
- How do you handle multi-modal inputs and outputs in agentic systems?
- How do you implement state management in complex agent workflows?
- Answer: How does LangGraph work?
- How do you build a customer support agent with escalation logic?
- What is agent orchestration, and how do you implement it?
- Answer: AI Orchestration
- What is Sakana Fugu, and how does it orchestrate a team of AI models?
- How do you build a code execution agent safely using sandboxed environments?
- Your AI agent is stuck in an infinite loop. How do you detect and break the cycle?
- Your AI agent gets conflicting answers from different tools. How does it reconcile them?
- Your AI agent burns too many tokens per task. How do you reduce token consumption?
- Your AI agent keeps exceeding its budget per task. How do you enforce budget limits?
- Answer: AI Agent Loop
- Your AI agent hallucinates tool capabilities and passes wrong inputs. How do you fix it?
- Your AI agent deleted a production database. How do you prevent irreversible actions?
- Your AI agent has many tools, but keeps picking the wrong one. How do you improve tool selection?
- Your AI agent takes too long to complete a task. How do you speed it up?
- Your long-running agent drifts after hours and confidently works on the wrong thing. How do you diagnose and fix it?
- Your LLM selects the right tool but extracts the wrong parameters. How do you fix parameter extraction?
- How do Computer-Use Agents work?
- Answer: How do Computer-Use Agents work?
- How do Browser Agents work?
- Answer: How do Browser Agents work?
- How does LangChain work?
- Answer: How does LangChain work?
- How does LangGraph work?
- Answer: How does LangGraph work?
- What is OKF (Open Knowledge Format)?
Fine-Tuning and Model Adaptation
- What is fine-tuning, and when should you fine-tune an LLM?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- Explain the difference between full fine-tuning and parameter-efficient fine-tuning (PEFT).
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- What is LoRA (Low-Rank Adaptation), and how does it work?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- What is QLoRA, and how does it enable fine-tuning on consumer hardware?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- How does fine-tuning work?
- Answer: How does fine-tuning work?
- Explain Prefix Tuning and Prompt Tuning. How are they different from LoRA?
- Answer: How does Prefix Tuning work?
- What is adapter-based fine-tuning?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- Explain the difference between pre-training, supervised fine-tuning (SFT), and preference optimization (RLHF/DPO).
- Answer: Decoding InstructGPT and How does Pretraining work?
- What is RLHF (Reinforcement Learning from Human Feedback), and how is it used to align LLMs?
- What is Deep RL from Human Preferences, the paper that started RLHF?
- Answer: Deep RL from Human Preferences
- Why did DPO displace PPO-based RLHF at many labs? When is online RL still better?
- What is instruction tuning, and why is it important for chat models?
- Answer: Decoding InstructGPT
- How do you prepare a dataset for fine-tuning an LLM?
- What is catastrophic forgetting, and how do you prevent it during fine-tuning?
- Answer: Continual Learning in LLMs
- When should you choose fine-tuning over RAG over prompt engineering?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization
- How do you evaluate a fine-tuned model's performance?
- Answer: LLM Evaluation
- What is synthetic data generation, and how do you use it for fine-tuning?
- What are the key hyperparameters for fine-tuning (learning rate, epochs, batch size, LoRA rank)?
- Do the GPU memory math for full fine-tuning a 7B model in bf16 with Adam. Now with LoRA and QLoRA.
- How do you fine-tune a model for a specific domain (legal, medical, finance)?
- What is continual pre-training, and when would you use it?
- How do you merge multiple LoRA adapters?
- What is the difference between SFT (Supervised Fine-Tuning) and alignment training?
- Answer: Decoding InstructGPT
- What is RLAIF (RL from AI Feedback), and how does it differ from RLHF?
- What is Constitutional AI, and how does it differ from RLHF?
- What is RLVR (Reinforcement Learning with Verifiable Rewards), and when does it beat a learned reward model?
- What is knowledge distillation for fine-tuning, and what are the legal considerations?
- Your fine-tuned LLM produces factually wrong outputs due to training data quality issues. How do you fix it?
- You must choose between LoRA and full fine-tuning for a domain-specific assistant. How do you decide?
- Your fine-tuned model memorized training data verbatim instead of learning patterns. How do you fix overfitting?
- Your fine-tuned LLM forgot its general capabilities after domain-specific fine-tuning. How do you fix catastrophic forgetting?
- Answer: Continual Learning in LLMs
- Your RLHF preference data has low annotator agreement. How do you ensure data quality?
Vector Databases and Embeddings
- What are embeddings in the context of AI engineering?
- Answer: Embeddings in Machine Learning
- How do embedding models convert text to vectors?
- Answer: What are Embeddings?
- What is Contrastive Learning, and how is it used to train embedding models?
- Answer: What is Contrastive Learning?
- What is the difference between sparse and dense embeddings?
- Explain cosine similarity, dot product, and Euclidean distance for vector search.
- What is a vector database, and how does it differ from a traditional database?
- Answer: How does a Vector Database work?
- How does Approximate Nearest Neighbor (ANN) search work?
- Compare HNSW, IVF, and flat indexes. How do you pick one, and what does recall@k cost in latency?
- How does an Embedding Cache work?
- How do you choose the right embedding model for your use case?
- What is embedding dimensionality, and how does it affect performance and cost?
- How do you handle embedding drift when the embedding model is updated?
- What are multi-modal embeddings, and how are they generated?
- Answer: Multimodal AI
- How do you index and query multi-tenant data in a vector database?
- What is quantization of embeddings, and how does it reduce storage costs?
- How do you benchmark and evaluate embedding model quality?
- What is the role of metadata in vector databases?
- Answer: How does a Vector Database work?
- How do you handle large-scale vector search with billions of vectors?
- What is hybrid search (combining keyword search with vector search)?
- Answer: How does Hybrid Search work?
- How do you fine-tune an embedding model for a specific domain?
- Answer: What is Contrastive Learning?
- Your vector database for RAG is consuming too much memory. How do you reduce it?
- Your vector database cannot scale to millions of embeddings. How do you fix the bottleneck?
- Your new embedding model has different dimensions from the existing vectors in production. How do you handle the mismatch?
- Your vector search returns irrelevant results despite high similarity scores. How do you fix it?
- You deployed a new embedding model, and search quality crashed overnight. How do you handle embedding drift?
- Your semantic search fails for short queries. How do you improve it?
AI System Design
- Design a Real-Time Voice AI Agent
- Design ChatGPT: Training to Serving (End to End)
- Design a RAG System (Chat with Your Documents)
- Design an enterprise RAG assistant over 10M documents with per-user permissions.
- Design Memory for a Personal AI Assistant
- Answer: AI Agent Memory and How does ChatGPT remember you?
- Design a Deep Research Agent
- Design a Multi-Agent Customer Support System
- Answer: Multi-Agent Systems
- Design an On-Device AI Assistant
- Design a Multimodal Search System (Text, Image, Video)
- Design an LLM Inference Platform (vLLM-as-a-Service)
- Answer: How does vLLM work? and LLM Inference Optimization
- Design an LLM Evaluation Platform
- Answer: LLM Evaluation
- Design a Text-to-Image Generation Service (Midjourney-like)
- Design a Music Generation Service (Suno-like)
- Design a Video Generation Service (Sora-like)
- Design an AI Coding Agent.
- Answer: How does Claude Code work? and How does Cursor work?
- Design a code generation and review system.
- Design a content moderation system using AI.
- Design a real-time AI recommendation system.
- Design an AI-powered email assistant.
- Design a medical diagnosis assistant using AI.
- Design a fraud detection system powered by LLMs.
- Design an AI-powered data extraction pipeline from unstructured documents.
- Design a Text-to-SQL system over a data warehouse with thousands of tables.
- Design a personalized learning assistant.
- Design an AI system for automated code migration.
- Design an AI-powered legal document review system.
- Design a conversational AI system with memory across sessions.
- Answer: AI Agent Memory and How does ChatGPT remember you?
- How do you design for latency vs quality trade-offs in AI systems?
- How do you implement caching strategies for LLM applications?
- How do you design rate limiting and cost management for AI APIs?
- How do you handle failover and fallback strategies for AI systems?
- How do you design an AI system for high availability and fault tolerance?
- How do you design an AI system that gracefully degrades when the model is unavailable?
- What are the key considerations for multi-region deployment of AI systems?
- Design an AI-powered search engine for an e-commerce platform.
- Design an AI gateway/proxy for managing LLM access across an organization.
- How do you design a RAG system that handles conflicting information across sources?
- How do you approach capacity planning for an AI system?
- Design a multi-tenant AI chatbot platform where each business gets a custom chatbot.
- Design an AI meeting summarizer system for thousands of meetings daily.
- Design an AI notification system that prioritizes instead of broadcasting.
- Design an AI-powered anomaly detection system for cloud infrastructure.
- Design an AI-powered document processing pipeline for financial institutions.
- Design an AI dynamic pricing engine.
- Design an AI resume screening system that handles 100K applications per week.
- Design an AI voice assistant architecture.
- Design a multi-agent workflow system where agents collaborate on complex tasks.
- Answer: Multi-Agent Systems
- Design a real-time AI transcription system for concurrent audio streams.
- Design an AI-powered live streaming content moderation system.
LLMOps and Production AI
- How does Prompt Caching work?
- Answer: How does Prompt Caching work?
- Prefill vs Decode
- Why is prefill compute-bound and decode memory-bandwidth-bound?
- What is chunked prefill, and why does it improve tail latency under mixed traffic?
- What is Prefill-Decode Disaggregation, and when does it pay off?
- Explain the AI product lifecycle from ideation to production.
- What is LLMOps, and how does it differ from traditional MLOps?
- How do you serve LLMs in production?
- What is model quantization?
- Answer: Explained in this video: AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, Quantization and How does Model Quantization work?
- Explain post-training quantization (PTQ) vs quantization-aware training (QAT). What breaks when you push weights to 2-4 bits?
- How do you monitor LLM applications in production?
- Answer: AI Agent Observability
- What is LLM observability?
- Answer: AI Agent Observability
- What are guardrails for LLMs, and how do you implement them?
- Answer: How do LLM guardrails work?
- How do you implement content filtering for AI outputs?
- Answer: How do LLM guardrails work?
- How do you estimate the cost of running an AI-powered feature in production?
- How do you optimize LLM inference costs in production?
- Answer: LLM Inference Optimization
- How do you implement A/B testing for LLM systems?
- What is CI/CD for AI applications, and how does it differ from traditional CI/CD?
- How do you version and manage prompts in production?
- What is model versioning, and how do you handle model rollbacks?
- How do you implement rate limiting and throttling for LLM APIs?
- How do you handle model updates and migrations without downtime?
- What is the role of feature flags in AI deployments?
- How do you implement logging and tracing for LLM applications?
- Answer: AI Agent Observability
- How do you handle PII and sensitive data in LLM inputs and outputs?
- What is a gateway pattern for LLM API management?
- How does Token Streaming work?
- Answer: How does Token Streaming work?
- How do you implement streaming responses for real-time AI applications?
- Answer: How does Token Streaming work?
- How does vLLM work?
- Answer: How does vLLM work?
- How does SGLang work?
- Answer: How does SGLang work?
- How does TensorRT-LLM work?
- Answer: How does TensorRT-LLM work?
- How does llama.cpp run LLMs on everyday hardware?
- How does Ollama work?
- Answer: How does Ollama work?
- When would you choose vLLM vs SGLang vs TensorRT-LLM?
- What are the key SLAs and metrics for production AI systems (latency, throughput, availability)?
- Cloud vs on-device Model Deployment for AI applications.
- How do you implement fallback strategies when the primary model is unavailable or rate-limited?
- How do you implement structured output from LLMs reliably in production?
- How do you handle long contexts efficiently in production (context compression, prefix caching)?
- What is semantic routing, and how do you implement it in a multi-model system?
- Answer: LLM Routing
- How do you manage secrets and API keys securely in LLM applications?
- Your LLM API has latency spikes during peak hours. How do you stabilize it?
- Your LLM endpoint's p99 latency doubled after a deploy with no model change. How do you diagnose it?
- Your LLM costs are too high in production. How do you reduce costs without degrading quality?
- Answer: LLM Routing and How does Semantic Caching work?
- Your application is hitting LLM provider rate limits during peak hours. How do you handle it?
- Your application depends on one LLM provider. How do you switch providers without downtime?
- Your AI system handles 100 requests/sec but crashes at 5000. How do you scale for concurrent requests?
- A traffic spike brings down your AI system. How do you handle peak traffic?
- One LLM provider outage took down your entire system. How do you eliminate single points of failure?
- Your multi-LLM pipeline fails when one model in the chain breaks. How do you handle orchestration failure?
- Answer: AI Orchestration
- Your AI pipeline has zero visibility into which step is failing. How do you add observability?
- Answer: AI Agent Observability
- You quantized your LLM, but accuracy dropped significantly. How do you minimize quantization loss?
- One failing AI component can take down your entire platform. How do you design graceful degradation?
Evaluation and Testing
- AI Agent Evaluation
- Answer: AI Agent Evaluation
- LLM Evaluation
- Answer: LLM Evaluation
- AI Agent Observability
- Answer: AI Agent Observability
- What is evaluation-driven development for AI applications?
- Why is AI only as good as our definition of done?
- How do you evaluate LLM outputs? What metrics do you use?
- Answer: LLM Evaluation
- Explain BLEU, ROUGE, and BERTScore. When would you use each?
- Answer: LLM Evaluation
- What is G-Eval, and how does it use LLMs for evaluation?
- Answer: LLM as a Judge
- What is LLM-as-a-judge evaluation, and what are its limitations?
- Answer: LLM as a Judge
- How do you conduct human evaluation for AI systems?
- Answer: LLM Evaluation
- What is red teaming, and how do you red team an LLM application?
- How do you detect and measure hallucinations in LLM outputs?
- What is adversarial testing for AI systems?
- How do you build a regression test suite for AI applications?
- What are benchmark suites (MMLU, HumanEval, GSM8K), and how do you interpret them?
- Answer: LLM Evaluation
- What is benchmark contamination, and how do you guard against it?
- Answer: LLM Evaluation
- Your new model version scores higher on every benchmark, but users say it got worse. Why does this happen, and how do you find the problem?
- How do you evaluate a RAG system end-to-end?
- Answer: LLM Evaluation
- How do you evaluate the quality of AI agents?
- Answer: AI Agent Evaluation
- How would you evaluate an autonomous coding agent? Why can SWE-bench pass rates be misleading?
- Answer: AI Agent Evaluation
- What is the difference between offline and online evaluation for AI systems?
- How do you measure factual consistency in LLM outputs?
- How do you evaluate multi-turn conversation quality?
- What is the role of golden datasets in AI evaluation?
- How do you build an eval set when there is no labelled ground truth and domain experts are expensive?
- How do you implement continuous evaluation for production AI systems?
- How do you evaluate bias in AI model outputs?
- How do you compare two models or prompts in a statistically rigorous way?
- How do you evaluate the robustness of an LLM application across input variations?
- What are the key differences between evaluating traditional ML vs LLM applications?
- How do you set up an evaluation framework from scratch for a new LLM application?
- Answer: LLM Evaluation
- Your model passes one fairness metric but fails another. How do you handle conflicting audit results?
- Your model was fair at deployment, but became biased 6 months later. How do you monitor continuously?
- An external auditor cannot reproduce your model's results. How do you ensure audit reproducibility?
- How do you structure red teaming for an LLM chatbot before launch?
- How do you red team a multimodal model where text-only safety tests miss cross-modal attacks?
AI Safety, Ethics, and Responsible AI
- What are hallucinations in LLMs, and how do you mitigate them?
- What is prompt injection, and what are the different types (direct, indirect)?
- Answer: Prompt Injection in LLMs
- How do you implement input and output guardrails for AI systems?
- Answer: How do LLM guardrails work?
- What is AI alignment, and why is it important?
- How do you detect and mitigate bias in AI systems?
- What are the key data privacy considerations (GDPR, CCPA) when building AI applications?
- How do you handle PII in LLM inputs and outputs?
- What is explainability in AI, and why does it matter?
- What is the difference between interpretability and explainability?
- What is mechanistic interpretability, and why do AI labs invest in it?
- How