100 Interview Q/A
Prepare for LLM interviews with 100 beginner-friendly questions and answers covering core concepts, prompting, APIs, retrieval, evaluation, deployment, performance, and safety.
1. What is a Large Language Model (LLM)?
A Large Language Model (LLM) is an AI model trained on large amounts of text to understand and generate human-like language. It can answer questions, write content, summarize text, translate languages, and generate code.
2. What does LLM stand for?
- Large — Trained using a massive amount of text.
- Language — Works with human language.
- Model — A trained AI system that predicts and generates text.
3. What are LLMs used for?
- Chatbots
- Content writing
- Code generation
- Translation
- Text summarization
- Customer support
- Research assistance
- Education
4. Name some popular LLMs.
- GPT
- Claude
- Gemini
- Llama
- Mistral
- Gemma
- Qwen
- Different models have different strengths, licensing, and deployment options.
5. What is a Transformer?
A Transformer is the neural network architecture used by most modern LLMs. It allows the model to understand relationships between words and process text efficiently.
6. Why are Transformers better than older sequence models?
- Process text more efficiently.
- Handle long documents better.
- Support parallel processing.
- Learn relationships between words more effectively.
7. What is a token?
A token is a small piece of text processed by an LLM. A token may represent a word, part of a word, punctuation, or another text fragment, depending on the tokenizer.
8. What is tokenization?
Tokenization is the process of breaking text into tokens before the model processes it.
Sentence:
I love Python.
Possible tokens:
["I", "love", "Python", "."]9. What is context in an LLM?
Context is the information the model uses to understand the current conversation or prompt. Better context usually leads to more relevant responses.
10. What is a prompt?
A prompt is the instruction or question given to an LLM to generate a response.
Explain CSS Flexbox.11. What is Prompt Engineering?
Prompt Engineering is the practice of writing clear and effective prompts to guide an AI model toward better responses.
12. What is inference?
Inference is the process of generating a response after a trained model receives a prompt. It is different from training, where the model learns from data.
13. What is Fine-Tuning?
Fine-Tuning is the process of further training an existing model on additional data to improve its performance for a specific task or domain.
14. What is LoRA?
LoRA (Low-Rank Adaptation) is a technique that adapts an existing model by training a small number of additional parameters instead of updating the entire model.
15. What is Quantization?
Quantization reduces the precision of a model's numerical values to decrease memory usage and improve inference efficiency, often with only a small impact on performance.
16. What is Temperature?
- Lower Temperature → More consistent responses.
- Higher Temperature → More varied and creative responses.
17. What is Top-k Sampling?
Top-k sampling limits the model to choosing the next word from a fixed number of the most likely candidates.
18. What is Top-p Sampling?
Top-p (Nucleus Sampling) selects candidate words until their combined probability reaches a chosen threshold, making the selection more flexible than Top-k.
19. What is Prompt Routing?
Prompt Routing directs a user's request to the most appropriate prompt, workflow, or model based on the type of task.
20. What is Model Evaluation?
Model Evaluation measures how well an LLM performs by checking factors such as accuracy, instruction following, clarity, consistency, and safety.
21. Why is Model Evaluation important?
- Improve quality.
- Compare models.
- Find weaknesses.
- Monitor performance.
- Build reliable AI systems.
22. What is AI Safety?
AI Safety focuses on reducing harmful, misleading, or inappropriate outputs while encouraging responsible use of AI systems.
23. Why is AI Safety important?
It helps build AI systems that are more reliable, responsible, and suitable for real-world applications.
24. What is an LLM API?
An LLM API allows software applications to communicate with a hosted language model through code.
25. Why use an API instead of hosting a model yourself?
- Reduces infrastructure requirements.
- Speeds up development.
- Simplifies maintenance.
- Provides access to powerful models.
26. What is Hosting?
Hosting means running a language model on hardware or servers so users and applications can interact with it.
27. What is Scaling?
Scaling is increasing the capacity of an AI system to handle more users, requests, or workloads while maintaining good performance.
28. What is Performance in an LLM?
Performance refers to how efficiently and effectively an LLM generates responses, including speed, accuracy, reliability, and resource usage.
29. What factors affect LLM performance?
- Model size
- Hardware
- Prompt quality
- Optimization techniques
- Infrastructure
30. What is context length?
Context length is the amount of text an LLM can consider in a single request. Longer context windows allow the model to work with larger conversations or documents.
31. What is a multimodal model?
A multimodal model can work with more than one type of input or output, such as text and images. Capabilities vary depending on the model and application.
32. What is a system prompt?
A system prompt provides high-level instructions that guide how an AI assistant should behave throughout a conversation.
33. What is a user prompt?
A user prompt is the question or instruction entered by the user to request a response from the AI.
34. What is hallucination in an LLM?
A hallucination occurs when an LLM generates information that is incorrect, unsupported, or fabricated while presenting it as if it were accurate.
35. Can hallucinations be completely eliminated?
No. Hallucinations can be reduced through better prompts, retrieval methods, evaluation, and testing, but they cannot currently be guaranteed to disappear entirely.
36. What is Retrieval-Augmented Generation (RAG)?
RAG is a technique that retrieves relevant information from external sources and provides it to the model before generating a response.
37. Why is RAG useful?
- Access up-to-date information.
- Reduce hallucinations.
- Improve answer relevance.
- Use private or company-specific data.
38. What is an AI Agent?
An AI Agent is a system that uses an LLM together with tools, workflows, or external services to complete tasks rather than only generating text.
39. What is Prompt Chaining?
Prompt Chaining breaks a complex task into multiple prompts that are processed step by step.
40. What is the difference between Prompt Routing and Prompt Chaining?
- Prompt Routing chooses the best workflow.
- Prompt Chaining completes a task through multiple sequential prompts.
41. What is caching in AI applications?
Caching stores previously generated or frequently requested results so they can be reused without repeating the same computation.
42. Why is caching useful?
- Improve response times.
- Reduce repeated processing.
- Lower infrastructure costs.
- Improve user experience.
43. What programming language is commonly used with LLMs?
Python is the most widely used language for developing AI and LLM applications because of its extensive ecosystem of AI libraries and tools.
44. Give a simple Python example of a prompt.
This example stores a prompt in a variable. In a real application, the prompt would be sent to an LLM API.
prompt = "Explain JavaScript arrays."
print(prompt)45. What are some real-world applications of LLMs?
- Chatbots
- Programming assistants
- Education
- Customer support
- Translation
- Healthcare support
- Research
- Business automation
46. Why should developers test LLM applications?
Testing helps verify that the application produces accurate, consistent, safe, and reliable responses before it is used in real-world situations.
47. What skills are important for working with LLMs?
- Prompt Engineering
- Python
- API integration
- AI Safety
- Model Evaluation
- RAG
- AI Agents
- Cloud Computing
48. What is the biggest challenge when using LLMs?
Some common challenges include maintaining accuracy, reducing incorrect responses, protecting user privacy, controlling costs, and ensuring reliable performance.
49. Why are LLMs becoming so popular?
LLMs can automate many language-based tasks, improve productivity, support learning, and assist developers and businesses across a wide range of industries.
50. Why should you learn Large Language Models?
LLMs are transforming how people build software, automate workflows, and interact with technology. Learning them opens opportunities in AI development, Prompt Engineering, AI engineering, automation, research, and many other technology careers.
51. What is the difference between an LLM and traditional software?
Traditional software follows fixed rules written by programmers. An LLM generates responses by recognizing patterns learned during training, making it more flexible for language-related tasks.
52. Can an LLM learn new information during a conversation?
No. A conversation may influence the current interaction, but it does not permanently update the model's knowledge. Permanent improvements require updating or retraining the model.
53. Why are prompts important?
Prompts tell the model what task to perform. Clear prompts usually produce more accurate and useful responses than vague prompts.
54. What is a context window?
A context window is the amount of information an LLM can consider in a single request, including the prompt and previous conversation.
55. Why is a larger context window useful?
It allows the model to work with longer conversations, larger documents, and more detailed instructions.
56. What is inference time?
Inference time is the time an LLM takes to generate a response after receiving a prompt.
57. What is latency?
Latency is the delay between sending a request and receiving the first part of the response.
58. What is throughput?
Throughput measures how many requests an AI system can process within a given period.
59. Why is GPU hardware commonly used with LLMs?
GPUs can perform many calculations simultaneously, making them well suited for AI workloads such as training and inference.
60. Can LLMs run on CPUs?
Yes. Smaller or optimized models can run on CPUs, although performance may differ compared to systems with compatible GPUs or AI accelerators.
61. What is model deployment?
Model deployment is the process of making a trained model available for real users through an application or API.
62. What is the difference between training and inference?
- Training teaches the model using data.
- Inference uses the trained model to answer user requests.
63. What is model optimization?
Model optimization improves efficiency by reducing memory usage, improving response speed, or lowering computing requirements.
64. Name some model optimization techniques.
- Quantization
- Efficient inference
- Caching
- Prompt optimization
- Load balancing
65. Why is prompt quality important?
A well-written prompt helps the model understand the task and usually produces more accurate and relevant responses.
66. What is a prompt template?
A prompt template is a reusable prompt containing placeholders that can be filled with different inputs.
Explain {topic} for beginners.67. What is a system instruction?
A system instruction defines how the AI should behave throughout a conversation, such as acting as a teacher or software developer.
68. What is prompt optimization?
Prompt optimization is the process of improving prompts to generate better and more consistent responses.
69. What is prompt testing?
Prompt testing evaluates prompts using different inputs to determine which versions produce the best results.
70. Why should prompts be tested?
Testing helps identify unclear instructions, improve response quality, and increase consistency.
71. What is zero-shot prompting?
Zero-shot prompting asks the AI to complete a task without providing any examples.
72. What is one-shot prompting?
One-shot prompting provides one example before asking the AI to perform the task.
73. What is few-shot prompting?
Few-shot prompting provides several examples to help the model understand the expected output.
74. What is role prompting?
Role prompting assigns a role to the AI, such as "You are an experienced Python instructor."
75. What is chain-of-thought prompting?
Chain-of-thought prompting encourages the model to solve problems through logical steps. Developers should use reasoning techniques responsibly and avoid expecting exposure of hidden internal reasoning.
76. What is structured prompting?
Structured prompting organizes instructions into clear sections such as role, task, context, and expected output.
77. Why are XML and JSON prompts useful?
They organize information into a structured format that is easier for applications to process consistently.
78. What is Markdown prompting?
Markdown prompting uses headings, bullet lists, tables, and code blocks to organize prompts and responses clearly.
79. What is response consistency?
Response consistency means the model produces similar-quality answers for similar prompts.
80. Why is consistency important?
It improves user trust and creates a more predictable experience, especially in business and customer support applications.
81. What is an embedding?
An embedding is a numerical representation of text that helps AI systems compare meanings and relationships between pieces of information.
82. Where are embeddings commonly used?
- Semantic search
- Recommendation systems
- RAG applications
- Document similarity
- Information retrieval
83. What is semantic search?
Semantic search finds information based on meaning instead of matching only exact keywords.
84. What is vector search?
Vector search compares embeddings to find information with similar meaning.
85. What is a vector database?
A vector database stores embeddings and allows efficient similarity searches for AI applications.
86. Why are vector databases important in RAG?
They help retrieve relevant information that can be provided to the LLM before generating a response.
87. What is prompt injection?
Prompt injection is an attempt to manipulate an AI application's instructions or behavior through specially crafted user input. Applications should be designed to reduce this risk.
88. How can developers improve AI security?
- Validate user input.
- Protect API keys.
- Apply access controls.
- Test applications regularly.
- Follow secure coding practices.
89. Why is monitoring important after deployment?
Monitoring helps identify errors, performance issues, unexpected behavior, and opportunities for improvement.
90. What is logging?
Logging records important events and system activity to help developers troubleshoot and improve applications.
91. What is an AI workflow?
An AI workflow is a sequence of steps that processes user input, generates a response, and returns the result.
92. Why is workflow automation useful?
It reduces manual work, improves efficiency, and allows AI to complete repetitive tasks.
93. What is a production environment?
A production environment is the live system where real users access the AI application.
94. What is a development environment?
A development environment is where developers build, test, and improve applications before releasing them.
95. Why is version control important in AI projects?
Version control helps teams track changes, collaborate efficiently, and restore previous versions when needed.
96. What should developers measure when evaluating an LLM application?
- Accuracy
- Response time
- Resource usage
- Reliability
- User satisfaction
- Safety
97. What industries use LLMs?
- Education
- Healthcare
- Finance
- Software development
- Marketing
- Customer support
- Research
- Manufacturing
- Retail
- Government
98. What are the benefits of learning LLMs?
Learning LLMs helps you build AI applications, automate tasks, improve productivity, and prepare for careers in AI, software development, and machine learning.
99. What is the future of Large Language Models?
LLMs are expected to become more efficient, more capable, and more integrated into software and business workflows. Future improvements may include better reasoning, multimodal capabilities, and stronger AI agents.
100. How would you explain Large Language Models in one sentence during an interview?
A Large Language Model is an AI system trained on vast amounts of text that can understand, generate, and assist with human language for tasks such as answering questions, writing content, coding, summarizing information, and supporting many real-world applications.