Section 1: AI & ML Foundations
Q1. What is Artificial Intelligence (AI)?
Artificial Intelligence refers to the simulation of human intelligence in machines programmed to think, learn, and make decisions. AI encompasses a broad spectrum — from rule-based expert systems to advanced self-learning algorithms. In practice, AI systems can recognize speech, identify images, make recommendations, drive vehicles, and generate content. The goal is to create systems that can perform tasks that would normally require human cognition, including reasoning, problem-solving, perception, and language understanding.
Q2. What is the difference between AI, Machine Learning, and Deep Learning?
AI is the broadest concept — any technique that enables machines to mimic human behavior. Machine Learning is a subset of AI where algorithms learn patterns from data without being explicitly programmed for each scenario. Deep Learning is a further subset of ML that uses multi-layered artificial neural networks to automatically extract complex features from raw data. Think of it as nested circles: AI contains ML, which contains DL. In 2026, most practical AI systems — from chatbots to autonomous driving — rely on deep learning as their core engine.
Q3. What are the main types of Machine Learning?
There are three primary types:
- Supervised Learning: The model trains on labeled data (input-output pairs). Examples include classification (spam detection) and regression (price prediction).
- Unsupervised Learning: The model finds hidden patterns in unlabeled data. Examples include clustering (customer segmentation) and dimensionality reduction (PCA).
- Reinforcement Learning: An agent learns by interacting with an environment, receiving rewards or penalties for actions. Used in robotics, game AI, and recommendation systems.
A fourth emerging category is Self-Supervised Learning, where models generate their own labels from data — this is the foundation of modern LLMs like GPT and Claude.
Q4. What is Overfitting and Underfitting?
Overfitting occurs when a model learns the training data too well — including its noise and outliers — resulting in excellent training performance but poor generalization to new data. Underfitting happens when a model is too simple to capture the underlying patterns in the data, performing poorly on both training and test sets.
To combat overfitting: use regularization (L1/L2), dropout, early stopping, data augmentation, or cross-validation. To combat underfitting: increase model complexity, add more features, train longer, or reduce regularization. The goal is to find the sweet spot — the bias-variance tradeoff — where the model generalizes well.
Q5. Explain Gradient Descent and its variants.
Gradient Descent is the optimization algorithm used to minimize the loss function during model training. It iteratively adjusts model parameters in the direction of steepest descent of the loss.
- Batch Gradient Descent: Computes gradients using the entire dataset. Stable but slow on large datasets.
- Stochastic Gradient Descent (SGD): Updates weights after each individual sample. Fast but noisy.
- Mini-Batch GD: Processes small batches of data — the standard approach in practice.
- Adam Optimizer: Combines momentum and adaptive learning rates. Most commonly used in 2026 for training neural networks and LLMs.
Section 2: Neural Networks & Deep Learning
Q6. What is a Neural Network and how does it work?
A neural network is a computational model inspired by the structure of the human brain. It consists of layers of interconnected nodes (neurons), where each connection carries a weight. Data enters through the input layer, passes through one or more hidden layers where transformations occur, and exits through the output layer.
Each neuron applies a weighted sum of its inputs, adds a bias term, then passes the result through an activation function (like ReLU, Sigmoid, or Softmax). During training, the network adjusts weights via backpropagation and gradient descent to minimize prediction error.
Q7. What are Convolutional Neural Networks (CNNs)?
CNNs are specialized neural networks designed primarily for processing grid-like data such as images. They use convolutional layers that apply learnable filters to detect features (edges, textures, shapes), followed by pooling layers that reduce spatial dimensions while preserving important information. CNNs are the backbone of image classification, object detection, facial recognition, and medical imaging. Architectures like ResNet, EfficientNet, and Vision Transformers (ViT) have pushed state-of-the-art performance in computer vision tasks.
Q8. What are Recurrent Neural Networks (RNNs) and LSTMs?
RNNs are neural networks designed for sequential data. They maintain a hidden state that carries information from previous time steps, making them suitable for tasks like language modeling and time-series prediction. However, standard RNNs suffer from the vanishing gradient problem — they struggle to learn long-range dependencies.
LSTMs (Long Short-Term Memory) networks solve this with gating mechanisms (forget gate, input gate, output gate) that control what information to retain or discard. While transformers have largely replaced RNNs for NLP tasks, LSTMs remain relevant for time-series forecasting and certain sequential workloads.
Q9. What is the Transformer architecture?
The Transformer, introduced in the 2017 paper "Attention Is All You Need," is the architecture behind virtually all modern LLMs. Instead of processing data sequentially like RNNs, Transformers use a self-attention mechanism that allows every token in a sequence to attend to every other token simultaneously. This enables massive parallelization during training.
Key components include: Multi-Head Self-Attention (captures relationships between all positions), Positional Encoding (injects sequence order information), Feed-Forward Networks (per-position processing), and Layer Normalization. The encoder-decoder structure powers models like T5, while decoder-only variants power GPT and Claude.
Q10. What are activation functions and why are they important?
Activation functions introduce non-linearity into neural networks, enabling them to learn complex patterns beyond simple linear relationships.
- ReLU (Rectified Linear Unit): f(x) = max(0, x). Most widely used in hidden layers — fast, simple, mitigates vanishing gradient.
- Sigmoid: Outputs between 0 and 1. Used for binary classification output layers.
- Softmax: Outputs probability distribution across multiple classes. Used in multi-class classification.
- GELU (Gaussian Error Linear Unit): Used in Transformers (BERT, GPT). Smoother than ReLU with better training dynamics.
- Swish: f(x) = x · sigmoid(x). Self-gated, performs well in deep networks.
Section 3: Natural Language Processing (NLP)
Q11. What is NLP and what are its key tasks?
Natural Language Processing is the branch of AI focused on enabling machines to understand, interpret, and generate human language. Key NLP tasks include:
- Text Classification: Sentiment analysis, spam detection, topic categorization
- Named Entity Recognition (NER): Identifying people, places, organizations in text
- Machine Translation: Translating between languages
- Text Summarization: Extractive or abstractive summarization
- Question Answering: Extracting answers from context
- Text Generation: Producing coherent, contextual text
Modern NLP is almost entirely powered by Transformer-based models, with pre-trained LLMs achieving state-of-the-art results on virtually every benchmark.
Q12. What are Word Embeddings?
Word embeddings are dense vector representations of words in a continuous vector space, where semantically similar words are mapped to nearby points. Unlike one-hot encoding (sparse, high-dimensional), embeddings capture semantic relationships. For example, the vector for "king" minus "man" plus "woman" approximates the vector for "queen."
Key approaches: Word2Vec (skip-gram, CBOW), GloVe (global co-occurrence statistics), and modern contextual embeddings from models like BERT where the same word gets different vectors based on context (e.g., "bank" in finance vs. river).
Q13. What is Tokenization in the context of LLMs?
Tokenization is the process of breaking text into smaller units (tokens) that the model can process. Modern LLMs use subword tokenization methods rather than splitting by words or characters:
- BPE (Byte Pair Encoding): Used by GPT models. Merges frequent character pairs iteratively.
- WordPiece: Used by BERT. Similar to BPE but uses likelihood-based merging.
- SentencePiece: Language-agnostic tokenizer that works directly on raw text.
Tokenization directly impacts model performance, context window usage, and cost (API pricing is often per-token). Understanding token count is essential for working with LLMs in production.
Section 4: Large Language Models (LLMs)
Q14. What is a Large Language Model (LLM)?
An LLM is a deep learning model with billions (or trillions) of parameters, trained on massive text corpora to understand and generate human language. They use the Transformer architecture and learn statistical patterns of language during pre-training on diverse internet text. Leading LLMs in 2026 include GPT-4o, Claude (Anthropic), Gemini (Google), LLaMA (Meta), and Mistral.
LLMs can perform a wide range of tasks — text generation, summarization, translation, code generation, reasoning, and multi-modal understanding — often without task-specific fine-tuning, through a capability called in-context learning.
Q15. What is RAG (Retrieval-Augmented Generation)?
RAG is an architecture pattern that enhances LLM responses by combining information retrieval with text generation. Instead of relying solely on what the LLM learned during training, RAG first searches an external knowledge base (documents, databases, APIs) for relevant context, then feeds that context alongside the user's query to the LLM.
The typical RAG pipeline: 1) User asks a question → 2) Query is embedded using a vector model → 3) Semantic search retrieves top-K relevant document chunks from a vector database (Pinecone, Weaviate, Azure AI Search) → 4) Retrieved chunks are injected into the LLM prompt as context → 5) LLM generates a grounded answer with citations.
RAG solves key LLM limitations: hallucination, stale training data, and lack of domain-specific knowledge.
Q16. What is Prompt Engineering?
Prompt engineering is the discipline of designing, structuring, and optimizing inputs to LLMs to achieve desired outputs. It is one of the most practical AI skills in 2026. Key techniques include:
- Zero-Shot Prompting: Asking the model to perform a task with no examples.
- Few-Shot Prompting: Providing 2-5 examples in the prompt to guide output format and quality.
- Chain-of-Thought (CoT): Instructing the model to reason step-by-step before answering.
- System Messages: Setting persona, constraints, and behavior rules for the model.
- Structured Output: Requesting JSON, XML, or specific formats to enable programmatic parsing.
Effective prompt engineering can dramatically improve accuracy, reduce hallucination, and eliminate the need for fine-tuning in many use cases.
Q17. What is Fine-Tuning vs. Transfer Learning?
Transfer Learning is the broader concept of taking a model pre-trained on a large general dataset and applying it to a specific task. The model's learned representations transfer to the new domain, requiring far less training data.
Fine-Tuning is a specific form of transfer learning where you continue training a pre-trained model on your domain-specific dataset, adjusting its weights. Modern variants include:
- Full Fine-Tuning: All model parameters are updated. Expensive but thorough.
- LoRA (Low-Rank Adaptation): Only trains small adapter layers. Efficient and popular in 2026.
- QLoRA: Combines quantization with LoRA for fine-tuning large models on consumer hardware.
- RLHF (Reinforcement Learning from Human Feedback): Aligns model outputs with human preferences.
Q18. What are Hallucinations in LLMs and how do you mitigate them?
Hallucinations occur when an LLM generates content that is factually incorrect, fabricated, or unsupported by evidence — but presents it confidently as truth. This is a fundamental limitation because LLMs are probabilistic text generators, not knowledge databases.
Mitigation strategies:
- RAG: Ground responses in retrieved, verified documents.
- Temperature Control: Lower temperature (0.0-0.3) for factual tasks reduces creative fabrication.
- Constrained Decoding: Restrict output to valid schemas or known entity lists.
- Citation Requirements: Prompt the model to cite sources and verify them programmatically.
- Multi-Agent Verification: Use a second model to fact-check the first model's output.
- Fine-Tuning: Train on domain-specific, high-quality data to improve factual accuracy.
Section 5: AI Ethics, Safety & Model Deployment
Q19. What are the key ethical concerns in AI?
AI ethics encompasses the moral principles guiding the development and deployment of AI systems. Key concerns include:
- Bias & Fairness: Models trained on biased data perpetuate and amplify societal biases in hiring, lending, and criminal justice.
- Privacy: AI systems that process personal data must comply with GDPR, CCPA, and emerging AI regulations.
- Transparency & Explainability: Users have a right to understand how AI decisions affect them (XAI — Explainable AI).
- Job Displacement: Automation of cognitive tasks raises workforce transition challenges.
- Deepfakes & Misinformation: Generative AI can create convincing fake content.
- Autonomous Weapons: Military applications of AI raise existential safety questions.
In 2026, the EU AI Act is fully in effect, and organizations must classify their AI systems by risk level and implement appropriate governance.
Q20. How do you deploy a Machine Learning model to production?
Deploying an ML model involves moving it from development to a production environment where it serves real users. The typical pipeline:
- Model Serialization: Save the trained model (ONNX, TensorFlow SavedModel, PyTorch .pt, pickle).
- API Wrapping: Expose the model via a REST API using FastAPI, Flask, or Azure Functions.
- Containerization: Package the model + dependencies in a Docker container for reproducibility.
- Orchestration: Deploy containers on Kubernetes (AKS), Azure ML Endpoints, or AWS SageMaker.
- Monitoring: Track latency, accuracy drift, input distribution shifts, and error rates.
- CI/CD for ML (MLOps): Automate training, testing, and deployment using tools like MLflow, Azure DevOps, or GitHub Actions.
Q21. What is MLOps and why does it matter?
MLOps (Machine Learning Operations) applies DevOps principles to the ML lifecycle. It bridges the gap between data science experimentation and production engineering. Key components:
- Version Control: Track models, datasets, and experiments (MLflow, DVC, Weights & Biases).
- Automated Pipelines: Reproducible training and evaluation pipelines.
- Model Registry: Central repository for approved production models.
- A/B Testing: Compare model versions in production with real traffic.
- Drift Detection: Monitor for data drift and concept drift that degrades model performance over time.
MLOps is essential because only ~15% of ML projects reach production without it. Organizations with mature MLOps practices deploy models 10x faster.
Q22. What is Model Quantization?
Quantization reduces the precision of model weights from 32-bit floating point (FP32) to lower-bit representations like FP16, INT8, or even INT4. This dramatically reduces model size and inference latency while preserving most accuracy.
Popular approaches: Post-Training Quantization (PTQ) — applied after training, quick but may lose some accuracy; Quantization-Aware Training (QAT) — quantization is simulated during training for better accuracy preservation; GPTQ/GGUF — community formats for running large LLMs locally on consumer hardware. Quantization is critical for deploying LLMs on edge devices, mobile, and cost-efficient cloud inference.
Section 6: Advanced & Scenario-Based Questions
Q23. How would you build a customer support chatbot using LLMs?
A production-grade customer support chatbot in 2026 typically uses this architecture:
- Knowledge Base: Ingest FAQs, product docs, and support tickets into a vector database (Azure AI Search, Pinecone).
- RAG Pipeline: Use semantic search to retrieve relevant context for each user query.
- LLM Orchestration: Use a framework like Semantic Kernel, LangChain, or Azure AI Studio to manage prompt templates, conversation history, and tool calling.
- Guardrails: Implement content filters, topic boundaries, and escalation rules to prevent off-topic or harmful responses.
- Multi-Channel Deployment: Deploy to web widget, Microsoft Teams, WhatsApp via Azure Bot Service.
- Feedback Loop: Collect thumbs-up/down from users to continuously improve responses via RLHF or prompt refinement.
Q24. What is the difference between Semantic Search and Keyword Search?
Keyword Search matches exact terms in documents using inverted indexes (like Elasticsearch). It is fast and predictable but misses semantic intent — searching "car repair" won't find documents about "automobile maintenance."
Semantic Search uses embedding models to convert text into dense vectors and compares meaning rather than words. A query about "how to fix my vehicle" will match documents about "car repair guide" because their vector representations are similar. In practice, the best systems use Hybrid Search — combining keyword (BM25) and semantic (vector) scores for optimal relevance. This is the default approach in Azure AI Search, Weaviate, and Qdrant in 2026.
Q25. What are AI Agents and how do they differ from simple chatbots?
AI Agents are autonomous systems that can plan, reason, use tools, and take actions to accomplish goals — going far beyond simple question-answering chatbots.
Key differences:
- Planning: Agents decompose complex tasks into sub-tasks and execute them sequentially or in parallel.
- Tool Use: Agents can call APIs, run code, query databases, search the web, and interact with external systems.
- Memory: Agents maintain short-term (conversation) and long-term (persistent) memory across sessions.
- Autonomy: Unlike chatbots that respond to each message independently, agents can take multi-step actions with minimal human intervention.
Frameworks for building AI Agents in 2026 include AutoGen (Microsoft), CrewAI, LangGraph, and Semantic Kernel. Enterprise adoption is rapidly growing for tasks like code generation, data analysis, and workflow automation.