Interview prep
NLP & LLMs interview questions
68 of the most common NLP & LLMs questions for data and AI interviews — each with a worked answer, the trap to avoid, and a link to learn it properly. Embeddings, attention, RAG, prompting, evaluation.
Filter by role
- What is an AI agent, and how does it differ from a single LLM call? Easy
- What is chain-of-thought prompting and when does it help? Easy
- What is Chain-of-Thought prompting and how does it aid reasoning? Easy
- What is a context window in an LLM and why does its size matter? Easy ·OpenAI·Anthropic·Google
- Why is cosine similarity preferred over Euclidean distance for comparing text vectors? Easy ·Google·Amazon·Microsoft
- What are embeddings, and how do you measure similarity between them for vector search? Easy
- How does an LLM generate text — what is next-token prediction and autoregression? Easy ·OpenAI·Anthropic·Google
- What are n-grams and when should you use them in NLP? Easy ·Google·Amazon
- What prompt engineering techniques should every LLM practitioner know? Easy
- What is Retrieval-Augmented Generation (RAG) and how does a basic RAG pipeline work? Easy
- What is sequence padding and why is it necessary for batch training? Easy ·Google·Amazon·Meta
- What is the difference between stemming and lemmatization? Easy ·Amazon·Microsoft
- What are stop words and when should you remove them? Easy ·Amazon·Microsoft
- How do you reliably get structured outputs (JSON, typed objects) from an LLM? Easy ·OpenAI·Anthropic·Google
- How do temperature, top-k, and top-p sampling control LLM generation? Easy
- What is TF-IDF and how does it improve on raw bag-of-words counts? Easy ·Google·Amazon·Microsoft
- What are tokens in an LLM and why is API pricing per token rather than per word or character? Easy ·OpenAI·Anthropic·Google
- What do 'parameters' mean in a language model and what do they actually store? Easy ·OpenAI·Google·Meta
- What is a vector database and how does it enable semantic retrieval? Easy
- What is Retrieval-Augmented Generation (RAG) and why is it used? Easy ·OpenAI·Google·Microsoft
- What is tokenization in NLP and why does it matter? Easy ·Google·Amazon·Meta
- Why do dense word embeddings outperform one-hot vectors? Easy ·Google·Meta·Amazon
- What is the difference between encoder models like BERT and decoder models like GPT? Medium ·Google·OpenAI·Meta
- How does Byte-Pair Encoding (BPE) tokenization work? Medium ·OpenAI·Google·Meta
- What is catastrophic forgetting and how does parameter-efficient fine-tuning help avoid it? Medium
- What causes hallucinations in LLMs and how do you mitigate them? Medium
- What chunking strategies exist for RAG and how do you choose between them? Medium
- What are chunking strategies in RAG, and how do you choose chunk size? Medium
- Compare RAG and fine-tuning. When would you use each? Medium
- What is constrained decoding and how does it guarantee structured outputs like valid JSON? Medium
- How do you evaluate LLM outputs, and what is LLM-as-a-judge? Medium
- How do you evaluate the quality of an LLM or RAG system? Medium ·Cohere·Databricks·Anthropic
- Explain the ReAct agent pattern and how it compares to Plan-and-Execute and Reflexion. Medium
- When should you use prompt engineering versus fine-tuning to adapt an LLM? Medium ·OpenAI·Anthropic·Google
- What is GGUF, and what does a quantization tier like Q4_K_M mean? Medium
- How does GloVe differ from Word2Vec in learning word embeddings? Medium ·Google·Stanford·Meta
- What is hybrid search and why is it often better than pure vector search? Medium
- What is a KV cache and how does it speed up LLM inference? Medium
- In LlamaIndex, what are nodes and query engines, and how is RAG exposed as a tool to an agent? Medium
- What is LoRA and how does it make fine-tuning parameter-efficient? Medium
- What is the Model Context Protocol (MCP) and what problem does it solve? Medium
- How do multimodal vision-language models combine images and text, and what role does CLIP play? Medium
- What are out-of-vocabulary (OOV) words and how do modern NLP systems handle them? Medium ·Google·Meta·Amazon
- What is the difference between pretraining, fine-tuning, instruction-tuning, and RLHF? Medium ·OpenAI·Anthropic·Google
- What is prompt injection and how do you defend against it? Medium ·Anthropic·OpenAI·Microsoft
- What is prompt injection, and what is the difference between direct and indirect injection? Medium
- What are reasoning models, and what is test-time compute? Medium
- What techniques reduce LLM cost and latency in production? Medium ·OpenAI·Anthropic·Google
- What is the difference between retrieval and reranking in a RAG pipeline? Medium ·Google·Microsoft·Cohere
- What is hybrid search and when should you use semantic vs keyword retrieval? Medium
- What is the difference between temperature, top-k, and top-p sampling in LLMs? Medium ·OpenAI·Anthropic·Google
- How do function/tool calling and LLM agents work at a high level? Medium ·OpenAI·Anthropic·Google
- What is tool use or function calling in LLMs, and how do you design good tools for an agent? Medium
- What types of memory do agents use, and what is context engineering and compaction? Medium
- What is vectorless retrieval (PageIndex), and when would you use it over a vector database? Medium
- What causes LLM hallucinations and how can they be reduced? Medium ·OpenAI·Anthropic·Google
- How does Word2Vec work, and what is the difference between Skip-gram and CBOW? Medium ·Google·Meta·Amazon
- Why are smaller language models (SLMs) sometimes preferable to larger ones? Medium ·Google·Meta·Anthropic
- What is the key difference between Word2Vec embeddings and BERT's contextual embeddings? Medium ·Google·Meta·OpenAI
- What biases affect LLM-as-a-judge evaluations, and how do you mitigate position bias? Hard
- What distinguishes QLoRA from LoRA? Hard
- What is the KV cache in a transformer and why does it matter for inference? Hard ·OpenAI·Anthropic·Google
- When the KV cache doesn't fit in GPU VRAM, what are your options? Hard ·Nvidia·Together
- Your RAG system is hallucinating even though the correct context was retrieved. How do you debug it? Hard
- When should you use RAG vs fine-tuning vs a long-context model? Hard ·OpenAI·Anthropic·Google
- When should you use a multi-agent system versus a single agent, and what is the supervisor versus swarm pattern? Hard
- How does RLHF work and what problem does it solve? Hard ·OpenAI·Anthropic·Google
- How would you defend an LLM application against prompt injection? Hard
No questions tagged for that role yet.