Artificial intelligence questions are almost predictable, whether it's your upcoming AI viva or a placement interview for a machine learning role. Questions like: What is AI? How do AI, ML, and deep learning differ? What are supervised, unsupervised, and reinforcement learning? What is overfitting? Or how does an LLM work? are the most common ones. But these just scratch the surface. Employers want to know whether you can use artificial intelligence smartly in the role. Every role in every industry uses AI, but the depth of understanding varies. This article collects top AI interview questions and answers, from AI viva questions and answers for students to generative and agentic AI questions for experienced candidates. Every answer is short enough to say aloud and precise enough to defend.
The stakes are higher than they were just two years ago. Stanford HAI’s 2026 AI Index Report found that generative AI reached 53% population adoption within three years, faster than the PC or the internet. Similarly, the World Economic Forum’s Future of Jobs Report 2025 ranks AI and big data as the fastest-growing skill set through 2030.
Interviewers now expect freshers to explain classic concepts like search algorithms and the bias-variance tradeoff, and also to talk sensibly about transformers, RAG, hallucinations, and AI agents.
This 2026 edition is curated by the AnalytixLabs faculty team, who have trained AI and data science professionals for over a decade. Questions marked as viva favorites are the ones examiners ask most often in university practicals.
How to Use These AI Interview and Viva Questions
An AI viva and an AI job interview test the same concepts in different ways. A viva examiner wants a crisp definition and one example. A hiring manager wants the definition, a trade-off, and evidence that you have used the idea in a project.
Each answer below starts with the one-line version you can say in a viva, then adds the depth an interviewer will probe.
Section | Best for | What it covers |
|---|---|---|
Basic AI questions (1–15) | Viva, freshers, non-tech roles | Definitions, types of AI, AI vs ML vs DL, tools |
Machine learning questions (16–30) | Freshers, analyst and ML roles | Learning types, algorithms, overfitting, evaluation |
Search, logic and reasoning (31–40) | University viva, CS graduates | BFS/DFS, A*, minimax, fuzzy logic, expert systems |
Deep learning and NLP (41–50) | ML and DL engineer roles | Neural networks, CNN, RNN/LSTM, transformers |
Generative AI, LLMs and agentic AI (51–60) | GenAI, LLM and AI engineer roles | RAG, fine-tuning, hallucination, agents, evaluation |
Ethics, governance and scenarios (61–65) | All levels, especially experienced | Bias, explainability, regulation, case questions |
If you have one evening, revise questions 1–15, 16–22 and 51–55. Those are the AI viva questions and answers that come up in almost every exam and screening round.
Basic Artificial Intelligence Interview Questions and Answers
These basic questions on artificial intelligence with answers appear in nearly every AI viva and first-round interview. Keep answers to 30–60 seconds and always add one real example.

1. What is artificial intelligence? Give some real-life applications.
Viva answer: Artificial intelligence is the branch of computer science that builds systems able to perform tasks that normally need human intelligence, such as perceiving, reasoning, learning, and using language.
Interview depth: John McCarthy coined the term in the 1955 Dartmouth proposal. Modern AI is mostly data-driven: systems learn patterns from data rather than following hand-written rules. Everyday applications include fraud alerts on UPI and card payments, ETA prediction in Google Maps, recommendation feeds on Netflix and Instagram, spam filtering, voice assistants, medical image screening, and generative assistants such as ChatGPT, Gemini, and Claude.
➡️ Additional read: 15 Real World Applications of Artificial Intelligence
2. What are the types of AI based on capability?
Artificial Narrow Intelligence (ANI), or weak AI: Performs specific tasks well. Every AI system deployed today is narrow, including large language models, Siri, and self-driving software.
Artificial General Intelligence (AGI), or strong AI: Would match humans across any intellectual task and transfer learning between domains. AGI does not yet exist; whether and when it will is still debated.
Artificial Superintelligence (ASI): Would exceed human ability in virtually every field. It is a theoretical concept.
Examiners often ask for a real-world example of AGI or ASI, expecting you to name a famous humanoid robot like Sophia or a chatbot like ChatGPT. Avoid it by stating clearly that no AGI or ASI exists today: Sophia combines scripted dialogue with narrow AI components, and most researchers still classify LLMs as narrow AI despite their broad abilities. Close by saying AGI and ASI remain theoretical, which shows you can tell an impressive system from a generally intelligent one.
3. What are the types of AI based on functionality?
There are 4 types of AI based on functionality.
Reactive machines: AI that responds only to the current input using fixed rules, with no memory and no ability to learn from past experience.
Limited memory: AI that uses recent or stored past data to make better decisions, the category that covers almost all AI in use today.
Theory of mind: A future type of AI that understands others' beliefs, intentions, and emotions and adjusts its behavior accordingly.
Self-aware: A hypothetical AI with consciousness and a sense of its own existence, able to reflect on its own internal states.
Type | What it does | Example |
|---|---|---|
Reactive machines | Respond to current input only; no memory of past states | IBM Deep Blue (chess, 1997) |
Limited memory | Use recent past data to inform decisions | Self-driving cars tracking nearby vehicles; most ML models |
Theory of mind | Would model other agents’ beliefs, intentions, and emotions | Research stage only |
Self-aware | Would have consciousness and a sense of self | Hypothetical |
4. What is the difference between strong AI and weak AI?
Strong AI is hypothetical AI with human-level general intelligence that understands reason and learns across domains, not just the tasks it was built for.
Weak AI is AI designed for one specific task or a narrow set of tasks. It can do that task well but has no general understanding beyond it. All AI in use today is weak AI.
Strong AI | Weak AI |
|---|---|
Hypothetical machine intelligence equal to human general intelligence | Systems designed and trained for a specific task or domain |
Would understand, reason, and transfer knowledge across domains | Performs well inside its domain but cannot generalize beyond it |
Does not exist today | Powers all current AI products |
Example: none yet; often discussed through thought experiments like Searle’s Chinese Room | Examples: Alexa, Google Translate, ChatGPT, fraud-detection models |
5. Are AI and machine learning the same?
No. AI is the broad goal of building intelligent systems. Machine learning (ML) is one way to achieve it: instead of programming explicit rules, you give an algorithm data and let it learn the rules. For example, a chess engine using hand-coded search rules is AI but not ML, but a spam filter trained on labeled emails is both.
➡️ Additional reads:
6. What is the difference between AI, machine learning, deep learning, and generative AI?
Think of four nested circles. AI is the outermost field. Machine learning is the subset that learns from data. Deep learning is the subset of ML that uses multi-layer neural networks and learns features directly from raw data such as images, audio, and text. Generative AI is a subset of deep learning whose models create new content, such as text, images, or code, rather than only classifying or predicting.
Example chain: an AI system that recognizes a stop sign (deep learning) inside a self-driving stack (AI) trained on labeled images (ML); a model that writes the incident report afterward is generative AI.

➡️ For more details, read Data Science vs. Machine Learning vs. AI vs. Deep Learning
7. What is an agent in AI? What is PEAS?
An agent is anything that perceives its environment through sensors and acts on it through actuators to achieve a goal. This is the framing used in Russell and Norvig’s standard textbook, Artificial Intelligence: A Modern Approach.
Agents are specified with PEAS: Performance measure, Environment, Actuators, Sensors. If we put it in use in real time for (for instance) a self-driving taxi: P = safety and trip time, E = roads and traffic, A = steering and brakes, S = cameras, lidar, and GPS.

8. What are the types of agents in AI?
Simple reflex agents act on the current percept using condition-action rules (a thermostat).
Model-based reflex agents keep an internal state of the world they cannot see directly.
Goal-based agents choose actions that move them toward a goal, often using search or planning.
Utility-based agents pick the action with the highest expected utility when several paths reach the goal.
Learning agents improve their performance from experience.
Today’s LLM-powered “agentic AI” systems combine goal-based planning with tool use; see question 58.
➡️ Read more: AI Agents: Types, Use Cases, and How to Build Them
9. What is the Turing Test? Is it still relevant?
Alan Turing proposed the “imitation game” in his 1950 paper Computing Machinery and Intelligence. A human judge chats by text with a machine and a human; if the judge cannot reliably tell which is which, the machine passes. Modern chatbots can often fool people in short conversations, so researchers now treat the test as a historical milestone. Researchers now measure capability with task benchmarks for reasoning, coding, and safety.
10. Where is AI used? Name its main domains.
Main subfields: machine learning, deep learning, natural language processing (NLP), computer vision, speech recognition, robotics, expert systems, fuzzy logic, and planning and search.
Industry uses include fraud detection and credit scoring in banking, demand forecasting in retail, medical imaging in healthcare, predictive maintenance in manufacturing, and chatbots and copilots across customer service and software development.
11. Which programming languages are popular for AI?
Python dominates because of its ecosystem: NumPy, pandas, scikit-learn, PyTorch, TensorFlow, and Hugging Face. Other languages have specific roles: R for statistics, Julia for high-performance numerical work, C++ and CUDA for performance-critical inference, Java and Scala for enterprise and big-data pipelines, and Lisp and Prolog in classical symbolic AI.
You may also like to read: Top 50 Python Interview Questions for Data Science
12. What are the most widely used AI tools and frameworks in 2026?
Classical ML: scikit-learn, XGBoost, LightGBM
Deep learning: PyTorch (the default in research), TensorFlow and Keras, JAX
Pretrained models and LLMs: Hugging Face Transformers, OpenAI, Anthropic and Google APIs, open-weight models such as Llama, Mistral and Qwen
LLM apps and agents: LangChain, LangGraph, LlamaIndex, vector databases such as FAISS, Pinecone and pgvector
MLOps: MLflow, Docker, Kubernetes, cloud platforms (AWS SageMaker, Google Vertex AI, Azure ML)
Older frameworks like Theano, Caffe, and Microsoft CNTK are no longer actively developed. Mention them only as history.
13. What are the roles of scikit-learn, Keras, TensorFlow and PyTorch?
scikit-learn is the standard Python library for classical ML: preprocessing, feature selection, regression, classification, clustering, and model evaluation. It builds on NumPy and SciPy.
TensorFlow, developed by Google, is an end-to-end platform for training and deploying neural networks, with strong support for production and mobile deployment.
Keras is a high-level neural network API. Since Keras 3, it runs on top of TensorFlow, PyTorch, or JAX.
PyTorch, created at Meta AI and now governed by the PyTorch Foundation under the Linux Foundation, uses dynamic computation graphs and is the most common framework in research and LLM development.
➡️ Read more: Ultimate Python Data Science Libraries to Learn
14. What is the difference between inductive, deductive, and abductive reasoning?
Inductive reasoning draws general rules from specific examples, as machine learning models learn patterns from training data.
Deductive reasoning applies a general rule to a specific case to reach a conclusion that must be true if the rule is true, as in rule-based and expert systems.
Abductive reasoning infers the most likely explanation for an observation, as in diagnosis systems that work backward from symptoms to a probable cause.

Inductive | Deductive | Abductive |
|---|---|---|
Generalizes from specific examples to a rule | Applies general rules to reach a certain conclusion | Infers the most likely explanation for an observation |
“Every swan I have seen is white, so swans are white” | “All humans are mortal; Socrates is human; so Socrates is mortal” | “The grass is wet, so it probably rained” |
Basis of machine learning: models generalize from training data | Basis of rule-based and logic systems, such as expert systems and Prolog | Used in diagnosis systems and fault detection |
Conclusion is probable, not guaranteed | Conclusion is guaranteed if premises are true | Conclusion is a best guess that may be revised |
15. What is the difference between statistical AI and classical (symbolic) AI?
Classical or symbolic AI, dominant from the 1950s to the 1980s, represents knowledge as explicit symbols and rules and reasons through logic and search. Expert systems are the classic example.
Statistical AI learns patterns and probabilities from data, as in machine learning and deep learning. Symbolic AI is transparent but brittle; statistical AI is flexible but harder to explain. Neuro-symbolic AI tries to combine the two.
Machine Learning Questions for AI Interviews
Most artificial intelligence interview questions for freshers come from machine learning. Interviewers want to see that you can pick an algorithm, explain why, and evaluate it honestly.
✅ Explore our Machine Learning with Python learning module for a quick recap.

16. What is machine learning? What are its types?
Machine learning is the study of algorithms that improve at a task through experience (data) without being explicitly programmed for every case. The main types are:
Supervised learning: It learns from labeled examples (loan default yes/no).
Unsupervised learning: It finds structure in unlabelled data (customer segments).
Semi-supervised learning: It uses a small labeled set plus a large unlabeled set.
Self-supervised learning: It creates labels from the data itself, such as predicting the next word. This is how LLMs are pretrained.
Reinforcement learning: Learns by trial and error from rewards.
➡️ Additional read: Different Types of Machine Learning Algorithms
17. What is the difference between supervised and unsupervised learning?
Supervised learning: The model learns from labeled data, where each example comes with the correct answer, so it can predict outcomes for new data, such as flagging spam emails.
Unsupervised learning: The model finds hidden patterns or groups in unlabelled data on its own, such as segmenting customers by buying behavior.
For detailed understanding, read our guide on Supervised and Unsupervised Learning in Machine Learning.
Supervised learning | Unsupervised learning |
|---|---|
Trained on labeled data: each input has a known output | Trained on unlabelled data: no target variable |
Goal: predict the label for new data | Goal: discover groups, patterns, or structure |
Tasks: regression and classification | Tasks: clustering, dimensionality reduction, association rules |
Examples: house price prediction, churn prediction, spam detection | Examples: customer segmentation, anomaly detection, market basket analysis |
Accuracy is measured directly against labels | Evaluation is harder; uses metrics like silhouette score or business review |
18. Explain reinforcement learning. How does it work?
In reinforcement learning (RL), an agent interacts with an environment. At each step, it observes a state, takes an action, and receives a reward. Over many episodes, it learns a policy, a mapping from states to actions, that maximizes cumulative reward. The core tension is exploration (trying new actions) versus exploitation (using what already works).
Landmark Examples: DeepMind’s AlphaGo, which beat Go champion Lee Sedol in 2016 (Nature paper), and reinforcement learning from human feedback (RLHF), which OpenAI used to align InstructGPT and which shaped modern chat assistants.
19. What is Q-learning?
Q-learning is a model-free RL algorithm that learns the value Q(s, a) of taking action a in state s. After each step, it updates the estimate toward the reward received plus the discounted value of the best next action:
Q(s,a) \leftarrow Q(s,a) + \alpha \left[ r + \gamma \max_{a'} Q(s',a') - Q(s,a) \right]Here α is the learning rate, and γ is the discount factor.
Deep Q-Networks (DQN) replace the Q-table with a neural network, which lets DeepMind’s agents learn to play Atari games from raw pixels.
20. What are the common machine learning algorithms?
Supervised:
Linear regression for continuous targets (regression only)
Logistic regression and Naive Bayes for classification
Decision trees, k-nearest neighbors (KNN), support vector machines, random forests, and gradient boosting (XGBoost, LightGBM), which handle both regression and classification
Unsupervised:
K-means and hierarchical (agglomerative) clustering
DBSCAN, a density-based method that finds clusters of arbitrary shape and flags outliers
Principal component analysis (PCA) for dimensionality reduction
Association rule mining (Apriori, FP-Growth), used in market basket analysis to find products bought together and drive “frequently bought together” recommendations
21. What is the difference between parametric and non-parametric models?
Parametric models: These models assume a fixed form for the data and learn a fixed set of parameters, such as in linear regression.
Non-parametric models: These models make few assumptions about the data’s form and let their complexity grow with the data, such as k-nearest neighbors or decision trees.
➡️ Related reading: The same distinction applies to hypothesis testing. See Parametric vs. Non-Parametric Tests: Which One to Use?
Parametric models | Non-parametric models | |
|---|---|---|
Parameters | Fixed number, regardless of data size | Number grows with the training data |
Assumptions | Strong assumptions about the data’s form (for example, linearity) | Few assumptions about the data’s form |
Examples | Linear regression, logistic regression, Naive Bayes | KNN, decision trees, kernel SVM |
Strengths | Fast, need less data, easy to interpret | Flexible, can fit complex patterns |
Weaknesses | Underfit when assumptions are wrong | Slower, need more data, prone to overfitting |
➡️ Read more: How to Choose the Best Algorithm for Your Applied AI & ML Solution
22. What is the bias-variance tradeoff? How do you detect overfitting?
Bias is error from overly simple assumptions; a high-bias model underfits and performs poorly on both training and test data. Variance is error from sensitivity to the particular training set; a high-variance model overfits, scoring well on training data but poorly on unseen data.
Making a model more complex usually lowers bias and raises variance, so the goal is the complexity that minimizes total test error.
You detect overfitting by comparing training and validation performance, for example 98% training accuracy against 74% validation accuracy. Fixes include more data, simpler models, regularisation, dropout, early stopping and cross-validation.
23. What is regularization in machine learning?
Regularisation adds a penalty for model complexity to the loss function, helping the model generalize better. L1 (Lasso) penalizes the absolute size of coefficients and can shrink some to exactly zero, which performs feature selection. L2 (Ridge) penalizes squared coefficients and shrinks them smoothly. Elastic Net combines both. In neural networks, dropout, weight decay and early stopping play the same role.
➡️ Additional read: What Is Regularization in Machine Learning?
24. What is the difference between model parameters and hyperparameters?
Model parameters are values a model learns from the training data, such as weights in a neural network or coefficients in linear regression.
Hyperparameters are settings you choose before training to control how the model learns, such as the learning rate, number of trees, or tree depth.
Model parameters | Hyperparameters | |
|---|---|---|
Definition | Learned from the training data | Set before training to control how learning happens |
Who sets them | The training algorithm | The practitioner or a tuning process |
Examples | Weights and biases in a neural network, coefficients in regression, split points in a tree | Learning rate, number of trees, tree depth, batch size, number of epochs, number of layers |
➡️ For more details, read: Hyperparameters and Parameters: Optimization, Examples, and Tuning Techniques
25. What methods are used for hyperparameter tuning?
Grid search tries every combination in a predefined grid. It is thorough but expensive.
Random search samples combinations at random. Bergstra and Bengio (2012) showed it often finds good settings faster than grid search.
Bayesian optimization builds a probabilistic model of the objective and picks the most promising next settings. Libraries include Optuna and Hyperopt.
Successive halving and Hyperband stop weak configurations early to save compute.
26. What is gradient descent? What are its variants?
Gradient descent minimizes a loss function by repeatedly moving the parameters a small step in the direction of the negative gradient:
\theta \leftarrow \theta - \eta \, \nabla_\theta J(\theta)Here η is the learning rate: too high and training diverges, too low and it crawls. Batch gradient descent uses the full dataset per step, stochastic gradient descent (SGD) uses one example, and mini-batch uses a small batch, which is standard in deep learning.
Adaptive optimizers such as Adam and AdamW adjust the learning rate per parameter and are the default for training transformers.
27. What are ensemble methods? Explain bagging and boosting.
Ensembles combine several models to improve accuracy and stability over any single model.
Bagging (parallel): Trains models independently on bootstrap samples and averages or votes on their predictions. It mainly reduces variance. Example: random forest.
Boosting (sequential): Trains each new model to correct the errors of the previous ones. It mainly reduces bias. Examples: AdaBoost, Gradient Boosting, XGBoost, LightGBM, CatBoost.
Stacking: Feeds the predictions of several base models into a meta-model.
On tabular business data, gradient-boosted trees still often outperform deep learning, a point worth making in interviews.
28. How do you evaluate a classification model?
Start with the confusion matrix (true and false positives and negatives). From it come precision (of predicted positives, how many were right), recall (of actual positives, how many were caught), F1-score (their harmonic mean), and ROC-AUC.
Accuracy alone is misleading on imbalanced data: a fraud model that predicts “not fraud” for every transaction can be 99.8% accurate and useless. Choose the metric that matches the business cost, such as recall for cancer screening or precision for spam filtering.
29. What is cross-validation? What is data leakage?
K-fold cross-validation splits the data into k parts, trains on k−1 parts, tests on the remaining one, and repeats k times, averaging the scores. It gives a more reliable estimate of performance than a single split.
Data leakage happens when information from outside the training data, such as future values or the test set, sneaks into training. Typical causes include scaling the full dataset before splitting or using a feature known only after the outcome. Leakage can produce great validation scores but poor production results.
30. Scenario: How would you use AI for fraud detection?
Frame the problem: Binary classification (fraud or not), plus anomaly detection for new fraud patterns.
Collect data: Transaction amount, time, merchant, device, location, velocity features, and customer history.
Clean and engineer features: Handle missing values; build features such as “transactions in the last hour”.
Handle class imbalance: Fraud is often well under 1% of transactions, so use class weights, undersampling, or SMOTE.
Model: Start with logistic regression as a baseline, then gradient boosting; add an isolation forest or autoencoder for anomalies.
Evaluate: Precision, recall, and PR-AUC, using a time-based split to avoid leakage.
Deploy and monitor: Real-time scoring, explainability for flagged cases, and retraining as fraud patterns drift.
Search, Logic and Reasoning Questions (Popular in AI Viva)
These standard topics come straight from university AI syllabi. They are among the most common AI viva questions and answers, and they still appear in interviews for robotics, gaming, and optimization roles.

31. What is the difference between breadth-first search (BFS) and depth-first search (DFS)?
Breadth-first search (BFS) explores a graph level by level, visiting every neighbor of a node before going deeper, and finds the shortest path in unweighted graphs.
Depth-first search (DFS) explores as far as possible along one branch before backtracking, using less memory but with no guarantee of the shortest path.
BFS | DFS | |
|---|---|---|
Data structure | Queue (FIFO: first in, first out) | Stack or recursion (LIFO: last in, first out) |
Order | Explores all nodes at one depth before going deeper | Goes as deep as possible along a branch, then backtracks |
Shortest path | Guarantees the shortest path in unweighted graphs | Does not guarantee the shortest path |
Memory | High: stores the whole frontier, O(b^d) | Low: stores one path, O(b·m) |
Completeness | Complete for finite branching | Can get stuck in infinite paths |
Here b is the branching factor, d is the depth of the shallowest solution, and m is the maximum depth.
32. What are uniform cost search and bidirectional search?
Uniform cost search always expands the node with the lowest total path cost g(n), using a priority queue. It finds the cheapest path when step costs differ; with equal step costs, it behaves like BFS.
Bidirectional search runs two searches at once, one forward from the start and one backward from the goal, and stops when they meet. This cuts the work from roughly b^d to 2·b^(d/2).
33. What is iterative deepening depth-first search (IDDFS)?
IDDFS runs depth-limited DFS repeatedly with limits 0, 1, 2, and so on, until it finds the goal. It combines BFS’s completeness and shortest-path guarantee (for equal step costs) with DFS’s low memory use. Re-expanding shallow nodes costs little because most nodes sit at the deepest level.
34. What is a heuristic function? What makes it admissible?
A heuristic function h(n) estimates the cost from node n to the goal, guiding informed search toward promising branches. It is admissible if it never overestimates the true cost, and consistent if the estimate never drops by more than the step cost between neighbors. For route planning, straight-line distance is a classic admissible heuristic.
35. What is the A* search algorithm?
A* finds the lowest-cost path by expanding the node with the smallest value of:
f(n) = g(n) + h(n)where g(n) is the cost so far, and h(n) is the heuristic estimate to the goal. With an admissible heuristic, A* is complete and optimal. It is widely used in maps, robotics, and video-game pathfinding.
36. What is the minimax algorithm? Explain its terms.
Minimax is a recursive algorithm for two-player, zero-sum games such as chess or tic-tac-toe. The MAX player picks the move with the highest value and assumes the MIN player will pick the lowest. Key terms:
Game tree: All possible moves and positions
Initial state: The starting board and whose turn it is
Successor function: The legal moves from a position
Terminal state: A position where the game ends
Utility function: The numeric value of a terminal state (win +1, draw 0, loss −1)
37. What is alpha-beta pruning?
Alpha-beta pruning speeds up minimax by skipping branches that cannot change the final decision.
Alpha is the best value MAX can guarantee so far; beta is the best value MIN can guarantee. When alpha ≥ beta, the rest of that branch is pruned.
It returns the same result as minimax, and with good move ordering it can roughly double the searchable depth.
38. What is fuzzy logic? Where is it used?
Fuzzy logic handles partial truth: a value can be 0.7 “hot” instead of strictly true or false. It uses membership functions and IF-THEN rules, for example, “IF temperature is high AND humidity is high THEN fan speed is fast”. It is used in washing machines, air conditioners, anti-lock braking, camera autofocus, metro train control, and some medical decision support systems.
39. What is an expert system? What are its components and characteristics?
An expert system is a rule-based AI program that captures a human expert’s knowledge in a narrow domain to give advice or decisions. Stanford’s MYCIN, built in the 1970s to recommend antibiotics, is the textbook example. Its three core components are:
Knowledge base: Domain facts and IF-THEN rules
Inference engine: Applies the rules using forward chaining (data to conclusion) or backward chaining (goal to supporting facts)
User interface: Lets users ask questions and see explanations
Good expert systems are reliable, consistent, fast, and able to explain their reasoning. Their limits are that they cannot learn on their own and become costly to maintain as the rule base grows.
40. What is first-order predicate logic (FOPL)?
FOPL extends propositional logic with objects, predicates, and quantifiers, so it can express statements like “every student has a roll number”. Its building blocks are constants, variables, predicates, functions, logical connectives (¬, ∧, ∨, →, ↔), the universal quantifier ∀, the existential quantifier ∃, and equality. Example: ∀x (Student(x) → ∃y RollNumber(x, y)). Inference in FOPL uses rules such as unification and resolution, which Prolog implements.
Deep Learning and NLP Interview Questions
These questions separate candidates who have trained neural networks from those who have only read about them. Expect follow-ups such as “what happened when you changed the learning rate?”

41. What is an artificial neural network? What is a perceptron?
An artificial neural network (ANN) is a model made of layers of connected units (neurons). Each neuron computes a weighted sum of its inputs, adds a bias, and passes the result through an activation function. Stacking many layers lets the network learn complex, non-linear patterns.
The perceptron, introduced by Frank Rosenblatt in 1958, is the simplest neural network: a single neuron that acts as a binary linear classifier. Because it can only draw a straight decision boundary, a single perceptron cannot learn XOR. Multi-layer perceptrons with non-linear activations solve this.
➡️ Related reads:
Activation Functions In Neural Networks - Its Components, Uses & Types.
Understanding Perceptron: The Founding Element of Neural Networks.
42. What are activation functions? Why are they needed?
Activation functions add non-linearity; without them, any stack of layers collapses into one linear model. Common choices:
Function | Output range | Typical use |
|---|---|---|
Sigmoid | 0 to 1 | Binary output layer |
Tanh | −1 to 1 | Older RNN hidden layers |
ReLU | 0 to ∞ | Default for hidden layers in CNNs and MLPs |
GELU | Roughly −0.17 to ∞ | Transformers such as BERT and GPT |
Softmax | Probabilities summing to 1 | Multi-class output layer |
Sigmoid and tanh saturate at extreme values, causing vanishing gradients in deep networks. ReLU largely avoids it.
43. What is backpropagation?
Backpropagation computes how much each weight contributed to the error. After a forward pass produces a prediction and a loss, the algorithm applies the chain rule backward through the layers to get the gradient of the loss with respect to every weight. An optimizer such as SGD or Adam then uses those gradients to update the weights. Rumelhart, Hinton, and Williams popularised the method in 1986.
44. What are the key hyperparameters of a neural network?
Learning rate: Controls how big a step the model takes when updating its weights after each batch. Too high, and training becomes unstable; too low, and it learns very slowly, making it one of the most important settings to tune.
Batch size: The number of training examples the model processes before it updates its weights. Smaller batches give noisier but more frequent updates, while larger batches are more stable but need more memory.
Number of epochs: How many times the model goes through the entire training dataset. Too few epochs cause underfitting, and too many can cause overfitting.
Number of layers and neurons: Decides the network’s capacity, or how complex a pattern it can learn. More layers and neurons can capture richer patterns but increase training cost and the risk of overfitting.
Activation functions: The functions that add non-linearity to each neuron’s output, so the network can learn complex relationships. ReLU is the usual choice for hidden layers, while sigmoid or softmax are used in output layers for classification.
Optimizer and momentum: The optimizer updates the weights using gradients, such as SGD, Adam, or AdamW. Momentum carries forward part of the previous update, which speeds up training and helps the model move past small dips in the loss.
Regularisation: Techniques that stop the network from memorizing the training data. Dropout randomly switches off a fraction of neurons during training, and weight decay penalizes large weights.
➡️ For more deep learning questions: Top 40 Deep Learning Interview Questions
45. What is a convolutional neural network (CNN)? How is it used in computer vision?
A CNN uses convolutional layers that slide small learnable filters across an image to detect local features such as edges, then textures, then object parts.
Pooling layers reduce spatial size, and fully connected layers make the final prediction. Weight sharing makes CNNs far more efficient than fully connected networks on images. AlexNet’s win in the 2012 ImageNet challenge kick-started the deep learning era.
Computer vision applications include image classification, object detection (YOLO), segmentation for medical scans, OCR, factory quality inspection, and face verification.
Facebook’s DeepFace (2014) used a deep network to reach near-human accuracy in face verification. Meta later shut down Facebook’s face recognition system in 2021 over privacy concerns, a useful example if you are asked about AI ethics. Vision transformers (ViT) now compete with CNNs on many tasks.
46. What are RNNs, LSTMs and GRUs?
A recurrent neural network (RNN) processes sequences one step at a time and passes a hidden state forward, giving it a short memory. Plain RNNs struggle with long sequences because gradients vanish or explode.
Long short-term memory (LSTM) networks add a cell state and three gates (input, forget, output) that control what to store and discard, so they can learn long-range dependencies.
Gated recurrent units (GRU) simplify LSTM to two gates and train faster. Bidirectional RNNs read the sequence both ways. For most language tasks, transformers have replaced RNNs, but LSTMs remain common in time-series forecasting.
47. What are autoencoders, GANs and diffusion models?
Autoencoders compress input into a small latent representation and reconstruct it. They are used for dimensionality reduction, denoising, and anomaly detection: a high reconstruction error flags an unusual input.
Generative adversarial networks (GANs) pit a generator, which creates fake samples, against a discriminator, which tries to spot them. GANs produced the first photorealistic synthetic faces. (Also read: How GANs are transforming AI)
Diffusion models learn to reverse a gradual noising process, turning random noise into an image step by step. They power tools like Stable Diffusion and most modern image generators.
48. What is NLP? What are its components and applications? How is it different from text mining?
Natural language processing (NLP) is the area of AI that enables machines to understand, interpret, and generate human language. It has two halves: natural language understanding (NLU), which maps text to meaning (intent, entities, sentiment), and natural language generation (NLG), which produces text from data or meaning.
Applications include chatbots, machine translation, summarisation, sentiment analysis, named entity recognition, question answering, speech-to-text and search. For Indian languages, government initiatives such as Bhashini build translation and speech models across 22 scheduled languages.
Text mining extracts patterns, trends, and statistics from large text collections, such as word frequencies or topic clusters. NLP focuses on understanding language structure and meaning. In practice, text mining uses NLP techniques.
➡️You may also like to read: Top Natural Language Processing (NLP) Interview Questions
49. What is the difference between stemming and lemmatization? What about information retrieval and information extraction?
Stemming chops word endings with crude rules, so “studies” becomes “studi”. It is fast but may produce non-words. Lemmatization uses vocabulary and grammar to return the dictionary form, so “studies” becomes “study” and “better” becomes “good”. It is slower but more accurate.
Information retrieval (IR) finds relevant documents for a query, as a search engine does. Information extraction (IE) pulls structured facts out of text, such as names, dates, and relationships, through tasks like named entity recognition and relation extraction. Modern RAG systems (question 53) combine both.
50. What is a transformer? How does the attention mechanism work?
The transformer, introduced in the 2017 paper Attention Is All You Need, is the architecture behind BERT, GPT, Gemini, Claude, and Llama. It replaces recurrence with self-attention: each token computes how much to attend to every other token in the sequence, so the model captures context in parallel instead of step by step.
Each token is projected into a query (Q), key (K), and value (V) vector, and attention is computed as:
\text{Attention}(Q,K,V) = \text{softmax}\left(\frac{QK^{\top}}{\sqrt{d_k}}\right)VMulti-head attention runs several of these in parallel, and positional encodings tell the model the order of tokens. Encoder models such as BERT excel at tasks like classification. Decoder models such as GPT generate text one token at a time. Encoder-decoder models such as T5 handle translation and summarisation.
Generative AI, LLM and Agentic AI Interview Questions
In 2026, almost every AI interview includes at least one question on large language models (LLMs). For GenAI and AI engineer roles, this section is the core of the interview. Stanford’s 2026 AI Index reports that AI agents’ success on the Terminal-Bench real-world task benchmark rose from 20% in 2025 to 77.3% in 2026, which is why agent design questions are now common.

51. What is generative AI? How does a large language model work?
Generative AI refers to models that create new content, such as text, images, audio, video, or code, by learning the patterns of their training data. A large language model is a transformer (question 50) trained in stages:
Pretraining: the model reads trillions of tokens of text and learns to predict the next token. This self-supervised step gives it grammar, facts, and reasoning patterns.
Instruction tuning: it is fine-tuned on instruction-response examples so it follows requests.
Alignment: techniques such as RLHF or constitutional AI make it more helpful, honest and harmless.
At inference, the model generates one token at a time, sampling from a probability distribution over its vocabulary each time.
52. What are tokens, context windows, embeddings and temperature?
Tokens are the units an LLM reads and writes, usually word pieces. In English, one token is roughly three-quarters of a word; Indian-language text often needs more tokens per word.
The context window is the maximum number of tokens a model can consider at once, including the prompt and its answer.
Embeddings are dense numeric vectors that represent meaning, so similar texts sit close together in vector space. They power semantic search and RAG.
Temperature controls randomness in sampling. Low values (0–0.3) give focused, repeatable answers; higher values give more varied, creative output.
53. What is retrieval-augmented generation (RAG)?
RAG, introduced by Lewis et al. (2020), grounds an LLM’s answer in external documents. The pipeline:
Ingest: Split documents into chunks and convert each chunk into an embedding.
Store: Save the embeddings in a vector database such as FAISS, Pinecone, or pgvector.
Retrieve: Embed the user’s question and fetch the most similar chunks, often combined with keyword search (hybrid search) and a re-ranker.
Generate: Pass the retrieved chunks to the LLM with instructions to answer only from them and cite sources.
RAG reduces hallucination, keeps answers current without retraining, and lets companies use private data. Common failure points are poor chunking, weak retrieval, and the model ignoring the retrieved context.
54. When would you use prompt engineering, RAG, or fine-tuning?
Approach | Use it when | Cost and effort |
|---|---|---|
Prompt engineering | The model already has the knowledge; you need better instructions or format | Lowest; minutes to hours |
RAG | The model needs private, large or frequently changing knowledge | Medium; needs a retrieval pipeline |
Fine-tuning | You need a consistent style, format or narrow skill the model lacks, or a smaller, cheaper model for one task | Highest; needs curated training data |
Start with prompting, add RAG for knowledge, and fine-tune only for behavior. Parameter-efficient fine-tuning methods such as LoRA train small adapter matrices instead of all weights, dramatically cutting cost.
55. What is hallucination in LLMs? How do you reduce it?
A hallucination is a fluent, confident output that is false or unsupported, such as an invented citation or a wrong figure. It happens because LLMs are trained to produce plausible text, not to verify facts, and because their knowledge has a cut-off date. Ways to reduce it:
Ground answers with RAG and require citations to the retrieved sources
Instruct the model to say “I don’t know” when the context lacks the answer
Lower the temperature for factual tasks
Use tools such as calculators, search, and databases for facts and arithmetic
Add automated checks, such as a second model or rules that verify claims against sources
Keep a human reviewer in the loop for high-stakes outputs
56. What are the main prompt engineering techniques?
Zero-shot prompting: A clear instruction with no examples
Few-shot prompting: Two to five worked examples that show the format and reasoning you want
Chain-of-thought: Asking the model to reason step by step before answering, which improves maths and logic tasks
Role and system prompts: Setting the model’s persona, rules, and constraints
Structured output: Asking for JSON or a fixed schema so the output can be parsed by code
Prompt chaining: Breaking a complex task into a sequence of smaller prompts
57. How do you evaluate an LLM or a GenAI application?
Public benchmarks such as MMLU or SWE-bench compare base models, but they rarely predict how your application performs. For an application, build a task-specific evaluation set of real questions with expected answers, then measure:
Correctness and groundedness: Is the answer right and supported by the retrieved sources?
Retrieval quality: Did the system fetch the right chunks (recall@k)?
Safety: Does it refuse harmful requests and resist prompt injection?
Latency and cost per query
Teams often use LLM-as-a-judge, where a strong model grades outputs against a rubric, and validate it with periodic human review.
58. What is agentic AI? How is an AI agent different from a chatbot?
A chatbot responds to one message at a time. An AI agent is given a goal and works toward it over multiple steps: it plans, calls tools such as search, code execution, APIs, and databases, observes the results, and decides what to do next until the task is done. The ReAct pattern (reason, then act, then observe) underpins many agents.
Key building blocks are the LLM as the reasoning engine, tools, memory, and an orchestration loop. Standards such as the Model Context Protocol (MCP) let agents connect to external tools and data consistently. Anthropic’s engineering guide Building Effective Agents advises starting with the simplest workflow that works and adding autonomy only when needed, a point worth quoting in interviews.
➡️ Read more: What is Agentic AI – A Technical Guide for Beginners
59. What are multi-agent systems? What are the risks of AI agents?
A multi-agent system splits work across specialized agents, for example, a planner, a researcher, a coder, and a reviewer, coordinated by an orchestrator. Frameworks include LangGraph, CrewAI and AutoGen.
Risks interviewers expect you to name:
Prompt injection: malicious instructions hidden in web pages, emails, or documents that hijack the agent. It tops the OWASP Top 10 for LLM Applications.
Excessive agency: an agent with more permissions than it needs takes harmful actions.
Compounding errors: small mistakes multiply across many steps.
Cost and latency: long agent loops consume many tokens.
Mitigations include least-privilege tool access, human approval for irreversible actions, sandboxed execution, step limits, logging and evaluation of full agent trajectories.
➡️ Related read: AI Agents: Types, Use Cases, and Steps to Build an AI agent
60. Scenario: Design an AI assistant for a bank’s customer support.
A strong answer walks through the system, not just the model:
Scope: Start with high-volume, low-risk queries such as card status, KYC documents, and branch timings.
Knowledge: RAG over approved policy documents and FAQs, with citations in every answer.
Actions: Read-only tools for account lookups behind strong authentication; anything that moves money needs explicit confirmation.
Language: Support English, Hindi, and regional languages, using multilingual models or translation services.
Guardrails: Block requests for other customers’ data, detect prompt injection, and avoid giving investment advice.
Privacy and compliance: Mask personal data in logs and follow India’s Digital Personal Data Protection Act, 2023, and RBI guidelines.
Fallback: Hand off to a human agent with the conversation summary when confidence is low, or the customer is frustrated.
Evaluation: Measure resolution rate, test-set accuracy, escalation rate, and customer satisfaction, and review samples weekly.
AI Ethics, Governance and Scenario Questions
Interviewers increasingly test judgment, not just knowledge. Stanford’s 2026 AI Index notes that documented AI incidents rose to 362 in 2025 from 233 in 2024, so expect at least one question on risk.

61. What is bias in AI? Give an example and explain how to reduce it.
AI bias is systematic unfairness in a model’s outputs, usually inherited from skewed training data, proxy features, or flawed labels.
Two widely cited cases: Amazon scrapped an experimental recruiting tool in 2018 after it learned to downgrade CVs that mentioned women’s colleges and groups, and MIT’s Gender Shades study found commercial facial-analysis systems were far less accurate for darker-skinned women.
To reduce bias, we need to audit training data for representation, remove or test proxy features (a PIN code can act as a proxy for income or community), measure fairness metrics across groups, rebalance or reweight data, and keep humans in the loop for consequential decisions such as lending and hiring.
62. What is explainable AI (XAI)? Why does it matter?
Explainable AI is a set of methods that make a model’s decisions understandable to people. It matters for trust, debugging, and regulation: a bank must be able to tell a customer why a loan was declined. Common techniques:
SHAP assigns each feature a contribution to an individual prediction, based on Shapley values from game theory.
LIME fits a simple, interpretable model around one prediction to approximate the complex model locally.
Feature importance and partial dependence plots show global behavior.
Inherently interpretable models, such as linear models and shallow trees, are often the right choice when stakes are high.
63. What are the key principles and regulations for responsible AI?
Most frameworks converge on fairness, transparency, accountability, privacy, safety, and human oversight. Know these four:
Framework | Region | Key idea |
|---|---|---|
India AI Governance Guidelines (MeitY, November 2025) | India | Seven principles, including Trust, People First, Fairness and Equity, and Accountability; a pro-innovation approach that applies existing laws wherever possible |
Digital Personal Data Protection Act, 2023 | India | Consent, purpose limitation and data-principal rights for personal data used in AI systems |
European Union | Risk-based rules: unacceptable-risk uses banned, high-risk systems tightly regulated, transparency duties for chatbots and general-purpose models; obligations phase in from 2025 | |
United States (voluntary) | Four functions to manage AI risk: Govern, Map, Measure, Manage |
64. Scenario: Your model performed well in testing but is getting worse in production. What do you do?
This is usually data drift (input distributions change, for example, new customer segments) or concept drift (the relationship between inputs and outcome changes, for example, new fraud tactics). A structured answer:
Confirm the drop with monitored metrics and rule out pipeline bugs, such as a broken feature or a schema change.
Compare distributions of recent inputs against training data using tests like population stability index (PSI) or Kolmogorov-Smirnov.
Check for training-serving skew: features computed differently in production than in training.
Retrain on recent data, possibly with time-weighted samples, and validate on a recent hold-out period.
Prevent recurrence with MLOps: automated monitoring, alerts, scheduled retraining and model versioning with tools such as MLflow.
65. What interests you most about AI? Tell me about an AI project you have built.
There is no model answer here, which is why it matters. Interviewers use it to judge genuine motivation and depth. Pick one use case you care about and know well, such as crop disease detection for farmers or multilingual chatbots for government services, and explain why it matters to you.
For the project question, use the STAR structure: the Situation and problem, the Task you owned, the Actions you took (data, model choice, what failed and what you changed), and the measurable Result. Be ready to defend every line on your CV. Saying “I tried X, it overfit, so I switched to Y” shows more skill than a perfect-sounding summary.
➡️ For hands-on project ideas, read: 18 (Interesting) Artificial Intelligence Project Ideas
Quick-Fire AI Viva Questions and Answers
Examiners often close a practical exam with rapid one-line questions. These short AI viva questions and answers cover syllabus topics that rarely need more than a sentence.

Questions | One-line answers |
|---|---|
What is a hidden Markov model (HMM)? | A probabilistic model of a sequence of hidden states that produce observable outputs; used in early speech recognition and part-of-speech tagging |
What is the Markov property? | The next state depends only on the current state, not on the full history |
What is a Bayesian network? | A directed acyclic graph of variables and their conditional probabilities, used for reasoning under uncertainty, for example in medical diagnosis |
What is the Tower of Hanoi used to teach? | Recursion and state-space search; n disks need 2^n − 1 moves |
What is a constraint satisfaction problem (CSP)? | A problem defined by variables, domains, and constraints, such as Sudoku or timetabling, solved with backtracking and constraint propagation |
What is hill climbing, and its main weakness? | A local search that always moves to a better neighbor; it can get stuck at local maxima, plateaus, and ridges |
What is simulated annealing? | A local search that sometimes accepts worse moves, with decreasing probability, to escape local optima |
What is a genetic algorithm? | An optimization method inspired by evolution, using selection, crossover and mutation on a population of solutions |
What is partial-order planning? | Planning that fixes the order of actions only where necessary, leaving independent steps unordered |
Forward chaining vs backward chaining? | Forward starts from known facts and derives conclusions; backward starts from a goal and works back to supporting facts |
What is knowledge representation? | How facts about the world are encoded for reasoning: logic, semantic networks, frames, rules, or ontologies |
What is game theory’s link to AI? | It models decisions among rational agents and underpins minimax, multi-agent systems, and auction design |
What is a hash table? | A data structure that maps keys to values through a hash function for near-constant-time lookup |
What is an epoch? | One full pass of the training algorithm through the entire training dataset |
What is a confusion matrix? | A table of true positives, false positives, true negatives, and false negatives for a classifier |
What is transfer learning? | Reusing a model trained on one task as the starting point for another, such as fine-tuning ImageNet weights for X-ray classification |
What is a token in an LLM? | The basic unit of text an LLM processes, usually a word or word piece |
What is prompt injection? | An attack where crafted text makes an LLM ignore its instructions or leak data |
What is Prolog? | A logic programming language based on first-order logic, used in classical AI and expert systems |
Who is called the father of AI? | John McCarthy, who coined the term “artificial intelligence” in 1955 |
How to Prepare for an AI Interview or Viva

Master the fundamentals first. Questions 1–30 make up most first-round screens. If you can explain them clearly with an example, you clear the bar.
Build one project end to end. A deployed RAG chatbot, a fraud model with a Streamlit front end, or a fine-tuned classifier on GitHub gives you material for every follow-up question.
Practice saying answers aloud. A viva rewards the one-line definition; an interview rewards definition, trade-off, and example. Time yourself to 60 seconds.
Know the current landscape. Skim the Stanford AI Index highlights and McKinsey’s State of AI survey so you can discuss how companies actually use AI.
Research the employer. Know its products and where AI fits in them. A question about how they evaluate their models shows real interest.
Be honest about gaps. “I haven’t used that, but here is how I would approach it” beats a bluff every time. Never list a tool on your CV that you cannot discuss.
Prepare questions for the interviewer, such as how the team moves models from prototype to production, or how success is measured.
Conclusion
The best artificial intelligence interview questions and answers are the ones you can explain in your own words, with an example from your own work. Use this list in three passes: definitions first, then trade-offs, then projects and scenarios.
You may also like to read:
FAQs on Artificial Intelligence Interview Questions
1. What are the most common artificial intelligence interview questions?
The most frequently asked are: What is AI? What is the difference between AI, ML, and deep learning? What are supervised, unsupervised, and reinforcement learning? What is overfitting and the bias-variance tradeoff? How does a neural network learn? What is a transformer? What is RAG, and how do you reduce hallucinations? Expect at least one project or scenario question too.
2. What questions are asked in an AI viva?
AI viva questions focus on syllabus definitions: types of AI, intelligent agents and PEAS, the Turing Test, BFS vs DFS, A* search, heuristics, minimax and alpha-beta pruning, expert systems, fuzzy logic, first-order logic and basic machine learning. See questions 1–15, 31–40 and the quick-fire table above.
3. How should I answer AI questions in an interview as a fresher?
Give a one-line definition, add one real example, and mention a trade-off or limitation. Then connect it to something you built. Interviewers value clear reasoning over memorized jargon.
4. What are the four types of artificial intelligence?
By functionality, the four types are reactive machines, limited memory, theory of mind, and self-aware AI. Only the first two exist today. By capability, AI is classified as narrow (ANI), general (AGI), and superintelligent (ASI); only narrow AI exists today.
5. Do AI interviews in 2026 include generative AI questions?
Yes. Even for data science and ML roles, interviewers now commonly ask about LLMs, prompt engineering, RAG, fine-tuning, hallucinations, and AI agents. Questions 51–60 cover these.
6. Which programming language should I prepare for an AI interview?
Python. Be comfortable with NumPy, pandas, scikit-learn, and either PyTorch or TensorFlow, and expect a short coding exercise on data manipulation or model evaluation.