Artificial Intelligence - Edureka
Artificial Intelligence - Edureka
Artificial Intelligence - Edureka
edureka.co/blog/interview-questions/artificial-intelligence-interview-questions
Topics Covered
Machine Learning with Mahout (9 Blogs)
TensorFlow Certification Training (16 Blogs)
Artificial Intelligence and Machine Learning (20 Blogs)
SEE MORE
1/37
Ever since we realized how Artificial Intelligence is positively impacting the market,
nearly every large business is on the lookout for AI professionals to help them make their
vision a reality. In this Artificial Intelligence Interview Questions blog, I have collected the
most frequently asked questions by interviewers. These questions are collected after
consulting with Artificial Intelligence Certification Training Experts.
In case you have attended any Artificial Intelligence interview in the recent past, do paste
those interview questions in the comments section and we’ll answer them at the earliest.
You can also comment below if you have any questions in your mind, which you might
face in your Artificial Intelligence interview.
In this blog on Artificial Intelligence Interview Questions, I will be discussing the top
Artificial Intelligence related questions asked in your interviews. So, for your better
understanding I have divided this blog into the following 3 sections:
Q1. What is the difference between AI, Machine Learning and Deep
Learning?
2/37
Google’s Search Engine – Artificial Intelligence Interview Questions – Edureka
AI uses predictive analytics, NLP and Machine Learning to recommend relevant searches
to you. These recommendations are based on data that Google collects about you, such as
your search history, location, age, etc. Thus, Google makes use of AI, to predict what you
might be looking for.
3/37
Domains Of AI – Artificial Intelligence Interview Questions – Edureka
Machine Learning: It’s the science of getting computers to act by feeding them
data so that they can learn a few tricks on their own, without being explicitly
programmed to do so.
Neural Networks: They are a set of algorithms and techniques, modeled in
accordance with the human brain. Neural Networks are designed to solve complex
and advanced machine learning problems.
Robotics: Robotics is a subset of AI, which includes different branches and
application of robots. These Robots are artificial agents acting in a real-world
environment. An AI Robot works by manipulating the objects in it’s surrounding, by
perceiving, moving and taking relevant actions.
Expert Systems: An expert system is a computer system that mimics the decision-
making ability of a human. It is a computer program that uses artificial intelligence
(AI) technologies to simulate the judgment and behavior of a human or an
organization that has expert knowledge and experience in a particular field.
Fuzzy Logic Systems: Fuzzy logic is an approach to computing based on “degrees
of truth” rather than the usual “true or false” (1 or 0) boolean logic on which the
modern computer is based. Fuzzy logic Systems can take imprecise, distorted, noisy
input information.
Natural Language Processing: Natural Language Processing (NLP) refers to the
Artificial Intelligence method that analyses natural human language to derive useful
insights in order to solve problems.
4/37
Artificial Intelligence vs Machine Learning – Artificial Intelligence Interview Questions
– Edureka
Also, enroll in Artificial Intelligence Course to become proficient in this AI and ML.
5/37
In the above state diagram, the Agent(a0) was in State (s0) and on performing an Action
(a0), which resulted in receiving a Reward (r1) and thus being updated to State (s1).
Input Layer: This layer receives all the inputs and forwards them to the hidden
layer for analysis
Hidden Layer: In this layer, various computations are carried out and the result is
transferred to the output layer. There can be n number of hidden layers, depending
on the problem you’re trying to solve.
Output Layer: This layer is responsible for transferring information from the
neural network to the outside world.
6/37
Just like how our brain contains multiple connected neurons called neural network,
we can also have a network of artificial neurons called perceptron’s to form a Deep
neural network.
The simplest form of ANN, where the data or the input travels in one direction.
The data passes through the input nodes and exit on the output nodes. This neural
network may or may not have the hidden layers.
Here, input features are taken in batch wise like a filter. This will help the network
to remember the images in parts and can compute the operations.
Mainly used for signal and image processing
Works on the principle of saving the output of a layer and feeding this back to the
input to help in predicting the outcome of the layer.
Here, you let the neural network to work on the front propagation and remember
what information it needs for later use
This way each neuron will remember some information it had in the previous time-
step.
Autoencoders
7/37
These are unsupervised learning models with an input layer, an output layer and
one or more hidden layers connecting them.
The output layer has the same number of units as the input layer. Its purpose is to
reconstruct its own inputs.
Typically for the purpose of dimensionality reduction and for learning generative
models of data.
A Bayesian network is a statistical model that represents a set of variables and their
conditional dependencies in the form of a directed acyclic graph.
On the occurrence of an event, Bayesian Networks can be used to predict the likelihood
that any one of several possible known causes was the contributing factor.
For example, a Bayesian network could be used to study the relationship between diseases
and symptoms. Given various symptoms, the Bayesian network is ideal for computing the
probabilities of the presence of various diseases.
If you want to fast forward your career in AIML, then take up these Artificial
Intelligence and Machine Learning courses by Edureka that offers LIVE instructor-led
training, real-time projects, and certification.
8/37
Artificial Intelligence Intermediate Level Interview Questions
1. An agent
2. An environment
To understand this better, let’s suppose that our agent is learning to play counterstrike.
The RL process can be broken down into the below steps:
9/37
Counter-Strike Example – Artificial Intelligence Interview Questions – Edureka
1. The RL Agent (Player1) collects state S⁰ from the environment (Counterstrike game)
2. Based on the state S⁰, the RL agent takes an action A⁰, (Action can be anything that
causes a result i.e. if the agent moves left or right in the game). Initially, the action is
random
3. The environment is now in a new state S¹ (new stage in the game)
4. The RL agent now gets a reward R¹ from the environment. This reward can be
additional points or coins
5. This RL loop goes on until the RL agent is dead or reaches the destination, and it
continuously outputs a sequence of state, action, and reward.
To learn more about Reinforcement Learning you can go through this video recorded by
our Machine Learning experts.
10/37
In this video on “Reinforcement Learning Tutorial” you will get an in-depth
understanding about how reinforcement learning is used in the real world.
11/37
Markov’s Decision Process – Artificial Intelligence Interview Questions – Edureka
To briefly sum it up, the agent must take an action (A) to transition from the start state to
the end state (S). While doing so, the agent receives rewards (R) for each action he takes.
The series of actions taken by the agent, define the policy (π) and the rewards collected
define the value (V). The main goal here is to maximize rewards by choosing the optimum
policy.
To better understand the MDP, let’s solve the Shortest Path Problem using the MDP
approach:
In this problem,
You start off at node A and take baby steps to your destination. Initially, only the next
possible node is visible to you, thus you randomly start off and then learn as you traverse
through the network. The main goal is to choose the path with the lowest cost.
Since this is a very simple problem, I will leave it for you to solve. Make sure you mention
the answer in the comment section.
The RL agent works based on the theory of reward maximization. This is exactly why
the RL agent must be trained in such a way that, he takes the best action so that the
reward is maximum.
The collective rewards at a particular time with the respective action is written as:
12/37
The above equation is an ideal representation of rewards. Generally, things don’t work out
like this while summing up the cumulative rewards.
Let me explain this with a small game. In the figure you can see a fox, some meat and a
tiger.
Our RL agent is the fox and his end goal is to eat the maximum amount of meat
before being eaten by the tiger.
Since this fox is a clever fellow, he eats the meat that is closer to him, rather than the
meat which is close to the tiger, because the closer he is to the tiger, the higher are
his chances of getting killed.
As a result, the rewards near the tiger, even if they are bigger meat chunks, will be
discounted. This is done because of the uncertainty factor, that the tiger might kill
the fox.
13/37
Machine Learning Course Masters Program
Exploration, like the name suggests, is about exploring and capturing more information
about an environment. On the other hand, exploitation is about using the already known
exploited information to heighten the rewards.
Consider the fox and tiger example, where the fox eats only the meat (small) chunks
close to him but he doesn’t eat the bigger meat chunks at the top, even though the
bigger meat chunks would get him more rewards.
If the fox only focuses on the closest reward, he will never reach the big chunks of
meat, this is called exploitation.
But if the fox decides to explore a bit, it can find the bigger reward i.e. the big chunk
of meat. This is exploration.
14/37
Parametric vs Non Parametric model – Artificial Intelligence Interview Questions –
Edureka
15/37
They are used to define the number of hidden layers that must be present in a
network.
More hidden units can increase the accuracy of the network, whereas a lesser
number of units may cause underfitting.
Grid Search
Grid search trains the network for every combination by using the two set of
hyperparameters, learning rate and the number of layers. Then evaluates the model by
using Cross Validation techniques.
Random Search
It randomly samples the search space and evaluates sets from a particular probability
distribution. For example, instead of checking all 10,000 samples, randomly selected 100
parameters can be checked.
Bayesian Optimization
This includes fine-tuning the hyperparameters by enabling automated model tuning. The
model used for approximating the objective function is called surrogate model (Gaussian
Process). Bayesian Optimization uses Gaussian Process (GP) function to get posterior
functions to make predictions based on prior functions.
Q9. How does data overfitting occur and how can it be fixed?
Overfitting occurs when a statistical model or machine learning algorithm captures the
noise of the data. This causes an algorithm to show low bias but high variance in the
outcome.
More training data: Feeding more data to the machine learning model can help in
better analysis and classification. However, this does not always work.
Remove features: Many times, the data set contains irrelevant features or predictor
variables that are not needed for analysis. Such features only increase the complexity of
the model, thus leading to possibilities of data overfitting. Therefore, such redundant
variables must be removed.
Early stopping: A machine learning model is trained iteratively, this allows us to check
how well each iteration of the model performs. But after a certain number of iterations,
the model’s performance starts to saturate. Further training will result in overfitting, thus
16/37
one must know where to stop the training. This can be achieved by a mechanism called
early stopping.
17/37
Text Mining vs NLP – Artificial Intelligence Interview Questions – Edureka
Text Planning
Sentence Planning
Text Realization
18/37
Stemming algorithms work by cutting off the end or the beginning of the word, taking into
account a list of common prefixes and suffixes that can be found in an inflected word. This
indiscriminate cutting can be successful on some occasions, but not always.
Lemmatization, on the other hand, takes into consideration the morphological analysis of
the words. To do so, it is necessary to have detailed dictionaries which the algorithm can
look through to link the form back to its lemma.
Fuzzification Module − The system inputs are fed into the Fuzzifier, which
transforms the inputs into fuzzy sets.
19/37
Knowledge Base − It stores analytic measures such as IF-THEN rules provided by
experts.
Inference Engine − It simulates the human reasoning process by making fuzzy
inference on the inputs and IF-THEN rules.
Defuzzification Module − It transforms the fuzzy set obtained by the inference
engine into a crisp value.
Knowledge Base
It contains domain-specific and high-quality knowledge.
Inference Engine
It acquires and manipulates the knowledge from the knowledge base to arrive at a
particular solution.
User Interface
The user interface provides interaction between the user and the Expert System
itself.
20/37
Computer Vision And AI – Artificial Intelligence Interview Questions – Edureka
Therefore Computer Vision makes use of AI technologies to solve complex problems such
as Object Detection, Image Processing, etc.
In supervised classification, the images are manually fed and interpreted by the
Machine Learning expert to create feature classes.
In unsupervised classification, the Machine Learning software creates feature
classes based on image pixel values.
21/37
Image Smoothing – Artificial Intelligence Interview Questions – Edureka
“In the context of artificial intelligence(AI) and deep learning systems, game theory is
essential to enable some of the key capabilities required in multi-agent environments in
which different AI programs need to interact or compete in order to accomplish a goal.”
Q1. Show the working of the Minimax algorithm using Tic-Tac-Toe Game.
There are two players involved in a game:
The following approach is taken for a Tic-Tac-Toe game using the Minimax algorithm:
Step 1: First, generate the entire game tree starting with the current position of the game
all the way up to the terminal states.
22/37
Tic-Tac-Toe – Artificial Intelligence Interview Questions – Edureka
Step 2: Apply the utility function to get the utility values for all the terminal states.
Step 3: Determine the utilities of the higher nodes with the help of the utilities of the
terminal nodes. For instance, in the diagram below, we have the utilities for the terminal
states written in the squares.
Let us calculate the utility for the left node(red) of the layer above the terminal:
23/37
MIN{3, 5, 10}, i.e. 3.
Therefore, the utility for the red node is 3.
Step 5: Eventually, all the backed-up values reach to the root of the tree. At that point,
MAX has to choose the highest value:
i.e. MAX{3,2} which is 3.
Therefore, the best opening move for MAX is the left node(or the red one).
To summarize,
Alpha-beta Pruning
If we apply alpha-beta pruning to a standard minimax algorithm, it returns the same
move as the standard one, but it removes all the nodes that are possibly not affecting the
final decision.
24/37
Alpha-beta Pruning – Artificial Intelligence Interview Questions – Edureka
In this case,
Minimax Decision = MAX{MIN{3,5,10}, MIN{2,a,b}, MIN{2,7,3}}
= MAX{3,c,2}
=3
Hint: (MIN{2,a,b} would certainly be less than or equal to 2, i.e., c<=2 and hence
MAX{3,c,2} has to be 3.)
Q3. Which algorithm does Facebook use for face verification and how
does it work?
Facebook uses DeepFace for face verification. It works on the face verification
algorithm, structured by Artificial Intelligence (AI) techniques using neural network
models.
25/37
Face Verification – Artificial Intelligence Interview Questions – Edureka
Input: Scan a wild form of photos with large complex data. This involves blurry images,
images with high intensity and contrast.
Output: Final result is a face representation, which is derived from a 9-layer deep neural
net
Training Data: More than 4 million facial images of more than 4000 people
Result: Facebook can detect whether the two images represent the same person or not
Q4. Explain the logic behind targeted marketing. How can Machine
Learning help with this?
Target Marketing involves breaking a market into segments & concentrating it on a few
key segments consisting of the customers whose needs and desires most closely match
your product.
It is the key to attracting new business, increasing your sales, and growing the company.
The beauty of target marketing is that by aiming your marketing efforts at specific groups
of consumers it makes the promotion, pricing, and distribution of your products and/or
services easier and more cost-effective.
26/37
Recommender Systems: And association rules which can be used to analyze
your marketing data
Market Basket Analysis: Market basket analysis explains the combinations of
products that frequently
co-occur in transactions.
Data Extraction: At this stage data is either collected through a survey or web scraping
is performed. If you’re trying to detect credit card fraud, then information about the
customer is collected. This includes transactional, shopping, personal details, etc.
Data Cleaning: At this stage, the redundant data must be removed. Any inconsistencies
or missing values may lead to wrongful predictions, therefore such inconsistencies must
be dealt with at this step.
Data Exploration & Analysis: This is the most important step in AI. Here you study
the relationship between various predictor variables. For example, if a person has spent
an unusual sum of money on a particular day, the chances of a fraudulent occurrence are
very high. Such patterns must be detected and understood at this stage.
Building a Machine Learning model: There are many machine learning algorithms
that can be used for detecting fraud. One such example is Logistic Regression, which is a
classification algorithm. It can be used to classify events into 2 classes, namely, fraudulent
and non-fraudulent.
27/37
Model Evaluation: Here, you basically test the efficiency of the machine learning
model. If there is any room for improvement, then parameter tuning is performed. This
improves the accuracy of the model.
This problem statement can be solved using the KNN algorithm, that will classify the
applicant’s loan request into two classes:
1. Approved
2. Disapproved
The following steps can be carried out to predict whether a loan must be approved or not:
Data Extraction: At this stage data is either collected through a survey or web scraping
is performed. Data about the customers must be collected. This includes their account
balance, credit amount, age, occupation, loan records, etc. By using this data, we can
predict whether or not to approve the loan of an applicant.
Data Cleaning: At this stage, the redundant variables must be removed. Some of these
variables are not essential in predicting the loan of an applicant, for example, variables
such as Telephone, Concurrent credits, etc. Such variables must be removed because they
will only increase the complexity of the Machine Learning model.
Data Exploration & Analysis: This is the most important step in AI. Here you study
the relationship between various predictor variables. For example, if a person has a
history of unpaid loans, then the chances are that he might not get approval on his loan
applicant. Such patterns must be detected and understood at this stage.
28/37
Building a Machine Learning model: There are n number of machine learning
algorithms that can be used for predicting whether an applicant loan request is approved
or not. One such example is the K-Nearest Neighbor, which is a classification and a
regression algorithm. It will classify the applicant’s loan request into two classes, namely,
Approved and Disapproved.
Model Evaluation: Here, you basically test the efficiency of the machine learning
model. If there is any room for improvement, then parameter tuning is performed. This
improves the accuracy of the model.
Q7. You’ve won a 2-million-dollar worth lottery’ we all get such spam
messages. How can AI be used to detect and filter out such spam
messages?
To understand spam detection, let’s take the example of Gmail. Gmail makes use of
machine learning to filter out such spam messages from our inbox. These spam filters are
used to classify emails into two classes, namely spam and non-spam emails.
29/37
This stage is followed by model evaluation. In this phase, the model is tested using
the testing data set, which is nothing but a new set of emails. After which the
machine learning model is graded based on the accuracy with which it was able to
classify the emails correctly.
Once the evaluation is over, any further improvement in the model can be achieved
by tuning a few variables/parameters. This stage is also known as parameter tuning.
Here, you basically try to improve the efficiency of the machine learning model by
tweaking a few parameters that you used to build the model.
The last stage is deployment. Here the model is deployed to the end users, where it
processes emails in real time and predicts whether the email is spam or non-spam.
Q8. Let’s say that you started an online shopping business and to grow
your business, you want to forecast the sales for the upcoming months.
How would you do this? Explain.
This can be done by studying the past data and building a model that shows how the sales
have varied over a period of time. Sales Forecasting is one of the most common
applications of AI. Linear Regression is one of the best Machine Learning algorithms used
for forecasting sales.
When both sales and time have a linear relationship, it is best to use a simple linear
regression model.
In this example, the dependent variable ‘Y’ represents the sales and the independent
variable ‘X’ represents the time period. Since the sales vary over a period of time, sales is
the dependent variable.
Y=𝒃𝟎+𝒃𝟏 𝒙+ⅇ
Here,
Y = Dependent variable
𝒃𝟎 = Y-Intercept
30/37
𝒃𝟏 = Slope of the line
x = Independent variable
e = Error
Q9. ‘Customers who bought this also bought this…’ we often see this
when we shop on Amazon. What is the logic behind recommendation
engines?
E-commerce websites like Amazon make use of Machine Learning to recommend
products to their customers. The basic idea of this kind of recommendation comes from
collaborative filtering. Collaborative filtering is the process of comparing users with
similar shopping behaviors in order to recommend products to a new user with similar
shopping behavior.
31/37
Recommendation System Using AI – Artificial Intelligence Interview Questions –
Edureka
To better understand this, let’s look at an example. Let’s say a user A who is a sports
enthusiast bought, pizza, pasta, and a coke. Now a couple of weeks later, another user B
who rides a bicycle buys pizza and pasta. He does not buy the coke, but Amazon
recommends a bottle of coke to user B since his shopping behaviors and his lifestyle is
quite similar to user A. This is how collaborative filtering works.
Q10. What is market basket analysis and how can Artificial Intelligence be
used to perform this?
Market basket analysis explains the combinations of products that frequently co-occur
in transactions.
For example, if a person buys bread, there is a 40% chance that he might also buy butter.
By understanding such correlations between items, companies can grow their businesses
by giving relevant offers and discount codes on such items.
Market Basket Analysis is a well-known practice that is followed by almost every huge
retailer in the market. The logic behind this is Machine Learning algorithms such as
Association Rule Mining and Apriori algorithm:
Association rule mining is a technique that shows how items are associated with
each other.
Apriori algorithm uses frequent itemsets to generate association rules. It is based
on the concept that a subset of a frequent itemset must also be a frequent itemset.
For example, the above rule suggests that, if a person buys item A then he will also buy
item B. In this manner the retailer can give a discount offer which states that on
purchasing Item A and B, there will be a 30% off on item C. Such rules are generated
32/37
using Machine Learning. These are then
applied on items in order to increase sales
and grow a business.
Q11. Place an agent in any one of the rooms (0,1,2,3,4) and the goal is to
reach outside the building (room 5). Can this be achieved through AI? If
yes, explain how it can be done.
This problem can be solved by using the Q-Learning algorithm, which is a reinforcement
learning algorithm used to solve reward based problems.
Let’s represent the rooms on a graph, each room as a node, and each door as a link, like
so:
33/37
Reinforcement Learning – Artificial Intelligence Interview Questions – Edureka
Now let’s try to understand how Q-Learning can be used to solve this problem. The
terminology in Q-Learning includes the terms state and action:
In the figure, a state is depicted as a node, while “action” is represented by the arrows.
Suppose, the Agent traverses from room 2 to room5, then the following path is taken:
34/37
Next, we can put the state diagram and the instant reward values into a reward table or a
matrix R, like so:
The next step is to add another matrix Q, representing the memory of what the agent has
learned through experience.
Here, Q(state, action) and R(state, action) represent the state and action in the Reward
matrix R and the Memory matrix Q.
Note: The Gamma parameter has a range of 0 to 1 (0 <= Gamma > 1).
If Gamma is closer to zero, the agent will tend to consider only immediate rewards.
If Gamma is closer to one, the agent will consider future rewards with greater weight
Finally, by following the below steps, the agent will reach room 5 by taking the most
optimal path:
35/37
Reinforcement Learning – Artificial Intelligence Interview Questions – Edureka
Q12. The crop yield in India is degrading because farmers are unable to
detect diseases in crops during the early stages. Can AI be used for
disease detection in crops? If yes, explain.
Feature Extraction: This is done to extract information that can be used to find the
significance of a given sample. The Haar Wavelet transform can be used for texture
analysis and the computations can be done by using Gray-Level Co-Occurrence Matrix.
36/37
Classification: Finally, Linear Support Vector Machine is used for classification of leaf
disease. SVM is a binary classifier which uses a hyperplane called the decision boundary
between two classes. This results in the formation of two classes:
1. Diseased leaves
2. Healthy leaves
Therefore, AI can be used in Computer Vision to classify and detect disease by studying
and processing images. This is one of the most profound applications of AI.
So these are the most frequently asked questions in an Artificial Intelligence Interview.
However, if you wish to brush up more on your knowledge, you can go through these
blogs:
With this, we come to an end of this blog. I hope these Artificial Intelligence Interview
Questions will help you ace your AI Interview.
37/37