Are you looking for Artificial Intelligence Interview Questions? If yes then start here.
What is AI?
AI is a branch of computers involved in the creation of intelligent machines that can perform tasks and think like humans. Some common examples are speech recognition, text recognition, planning and decision management, etc… AI does this through learning, problem-solving, and improvisation. AI uses techniques like machine learning and deep learning for achieving accurate results on various business cases and problems. The first person to envision AI was Alan Turing, who asked,
“Can a computer convince a human they’re communicating with another human?”
Why should you learn AI?
AI engineers are in high demand and AI is one of the top-paying jobs in the computer industry. AI engineers can apply various AI techniques like machine learning, deep learning, expert systems, etc… to make better systems every day. The best example is a self-driving car, which is on the track of constant development and betterment. On average, an AI engineer is paid anywhere from $171,715 to $257,530. Not only that, but the work of an AI engineer also is never boring – you will have one of the most analytical, challenging, and skillful jobs as an AI expert.
There are a lot of skills, but you don’t have to have all when you join, you can learn some through experience. Here are some essential skills –
- Mathematics, probability, and statistical knowledge
- Ability to understand and write algorithms
- Programming skills – C/C++/Java/Python/R
Other than the technical skills, here are some important soft skills –
- Analytical approach to problem-solving
- Patience to handle failure and try till you achieve desired results
- Keep oneself updated with the latest AI developments
- Ability to pick up new concepts and scenarios quickly
- Out of the box thinking and creative approach
- Curiosity and openness to new approaches and ideas
Top Artificial Intelligence Interview Questions and Answers
Most Artificial Intelligence Interview Questions and answers are technical and based on various simple and complex concepts, however, some questions will test your judgment and reasoning too. These questions are subjective and based on your understanding of the idea of artificial intelligence. Some typical questions asked are –
Question: Is AI good or bad?
Answer: Well, you can argue for both sides. AI is good because it can do repetitive or dangerous tasks that are performed by humans. Or you can say that it is bad because it is making us, humans, depend a lot on technology. There are justifications for both sides and there is no right or wrong.
Question: Do you think machines will surpass humans? What will happen if this becomes true in the future?
Answer: Again, you can answer yes or no. Yes, machines can surpass humans if they can think as humans, which looks a reality considering the advancements in technology. If this happens, a lot of tasks can be performed without errors that humans make otherwise. On the other hand, if machines start making all the decisions, there could be chaos in the existing systems. However, since humans are the ones controlling AI, machines can only work in tandem and never surpass humans.
Question: What are the AI technologies that you use every day?
Answer: There are many AI technologies that we use knowingly or unknowingly, for example, we use Alexa/Siri which uses Natural Language Processing. Robots are used in many places to perform repetitive tasks. Drones are used to capture images from any height and direction. Facebook performs face and image recognition.
Recently, there was news that UK researchers developed an AI tool (still in the research phase) to detect various types of brain injuries based on 600 different CT scans.
Question: Do you believe that self-driving cars will work like human driving someday?
Answer: With the current advancements in AI, it is only a matter of time before this happens – this could be one of the answers as true, there have been tremendous improvements in computer vision and image classification technologies. However, you could also argue that it is a far-fetched dream and can’t be as dynamic or accurate as human driving.
Question: Which one would you like to pursue – AI or data science – as a career choice?
Answer: Well, the answer to this wouldn’t change anything in your technical interview, the interviewer just wants to know what you think of both the fields. AI would be more of research-based work, which will require a lot of technical expertise, whereas for data science you would need business knowledge as well.
If the interviewer asks you subjective and opinion questions like these, remember that there is no right or wrong answer as long as you can justify your point with proper reasoning.
Now, for the technical AI interview questions –
Top AI Interview Questions and Answers
Question: What do you understand about AI? Give a simple example.
Answer: As we discussed above, AI is the intelligence possessed by machines by imitating humans. AI gives the power to machines to perform certain tasks and think in the same way as humans would, in certain situations. For example, through Natural language processing AI technology, we can communicate with machines via speech – like Alexa/Cortana/Siri can understand our queries and respond accordingly.
Question: If you were to build an AI system, what would you like to build?
Answer: Your answer can be based on what is the one job that you probably would want to automate. For example, a system that would enable people to maintain social distancing norms wherever they are and alert the police if someone is violating the same. Drones are already doing that, but someone needs to monitor it. This could be a system such that users can appreciate the benefits of maintaining social distancing.
Or you could ask for a home management system that can alert if there is a shortage of groceries, vegetables, and other essential items at home, set up appointments, read out daily news, etc…
A robot that can clean the house, chop vegetables, wash and fold clothes, etc… does seem like a reasonable system too!
Question: How is AI different from machine learning?
Answer: Machine learning is one of the branches of artificial intelligence. Therefore, we can say that AI encompasses machine learning. Machine learning algorithms are used by AI technologies to solve complex problems and make decisions. For example, recommendation systems, traffic predictions, fraud detection, marketing automation, etc… are all AI technologies that are based on machine learning algorithms.
Question: What is the association between AI and deep learning?
Answer: Deep learning is another branch of AI, just like machine learning, that uses various techniques to solve complex problems. Deep learning techniques like neural networks are used in customer research, data forecasting, pattern recognition, image classification, and recognition etc…. Here is a simple diagram that helps picture the relationship between AI, ML, and deep learning (DL).
Question: What is deep learning?
Answer: Deep learning is a subset of machine learning. In deep learning, computers can predict the output by extracting multiple layers of non-linear features from the input and then pass the same to a classifier. Note that it is important to transform the input into multiple layers, as a single layer wouldn’t be able to produce many features (it would perhaps give a blob, which isn’t a very useful feature). Some examples of deep learning are classifiers, neural networks, convolution, inception, etc…
Answer: AI and data science are correlated because of machine learning and deep learning algorithms used in data science for finding patterns in data and making predictions. Both machine learning and deep learning are branches of AI. Check out our AI vs Data Science article for more details.
Question: Explain the layers of a neural network.
Answer: There are three layers in a neural network –
- Input: This layer consists of input values. Input can be loaded from different data sources like file, database, web service, etc…
- Hidden: There can be many hidden layers that transform the input data received. For most problems, a single hidden layer is sufficient. The input data is propagated through the hidden layers in the forward direction using the activation function.
- Output: This layer gives the final output. It computes the output through the information received from the last hidden layer. The output layer has only one node.
Source – KDNuggets
Question: Explain the different branches (domains) of AI.
Answer: There are 6 branches or capabilities of AI –
- Machine learning – ML helps machines to understand large input datasets, apply models to the same using various algorithms, and get insights and predictions about the data.
- Neural network – NN tries to mimic a human brain and perform tasks using cognitive science and machines. Neural networks have three layers – input, hidden, and output. The neural network uses the concept of neurology.
- Robotics – robotics deals with the designing, creation, operation, and usage of robots. Robots can perform tasks that are otherwise difficult, dangerous, or monotonous for humans.
- Expert systems – expert systems can mimic the intelligence of a human brain to make decisions. Expert systems are purely based on reasoning and logic created using if-then-else statements and rules.
- Fuzzy logic – Fuzzy logic is used to modify uncertain information by measuring the degree to which a hypothesis is valid. The degree of truth can lie between 0 and 1, and there are more states than just 0 and 1.
- Natural language processing (NLP) – NLP enables humans to communicate with the machine using human language (natural language). Through NLP, the computer can also identify how a user would behave in certain scenarios, for example, analyze the tone of the text, recognize speech, analyze sentiments, etc…
Question: How many types of AI are there? Which is the most popular one?
Answer: There are many types of AI –
- Reactive Machines AI (Narrow AI or Weak AI) – machines can work on present data and present the outcome based on only current situations. These systems are not capable of forecasting the future based on past events or data. Such machines can perform certain predefined tasks.
- Strong AI – Strong AI is also known as general AI or Artificial General Intelligence (AGI). Such a system can think, act, and respond like a human would do. Strong AI is sub-categorized as –
- Limited Memory AI – the system has memory – but limited i.e. short-lived. Based on this, it can take immediate decisions for the future based on recent past actions. For example, self-driving cars.
- Theory Of Mind AI – As the name suggests, this type of AI focuses on the mind and emotional intelligence. A lot of research is going on in this field and advancements would mean capturing and mimicking human behavior and thoughts.
- Self-aware AI (super AI) – if machines become self-aware, they will be able to compete with human beings and even surpass them. Many Sci-fi movies show the same. However, in reality, this is far-fetched.
The most common type of AI is weak AI, also known as the Artificial Narrow Intelligence (ANI).
Question: What is fuzzy logic? Give some applications of fuzzy logic.
Answer: Generally, we try to interpret situations that have a 2-state answer – yes/no, true/false, good/bad etc….
However, in real-life, not all problems have a yes/no solution. There are more states than just 0 and 1 (truth and false). For example, if something is true, the degree of truth is determined using fuzzy logic. This value could be anywhere between 0 and 1.
One of the most important applications of fuzzy logic is in medical decision making, which helps physicians in diagnosis, image analysis, biomedical signal analysis, feature extraction, etc…
Fuzzy logic is also used in the underwater defense target recognition, mining and metal processing, decision systems for security trading, etc…
Question: How is natural language processing (NLP) useful? Give some examples.
Answer: With NLP, text can be analyzed to understand human speech. This helps in topic extraction, stemming, sentiment analysis, text summarization, speech extraction, etc… Voice assistants like Alexa, Cortana, and Siri use NLP to analyze human speech. Whatever a human speaks is converted to text, analyzed and the best response is found accordingly which is then sent back to the device. The device then converts the text into speech, which we hear in a human-like voice.
Question: What are Artificial Neural Networks (ANN)?
Answer: ANN is a model that imitates how a human brain analyses any information and processes the same. ANN is made of input, output, and hidden layers. In an ANN, all the neurons are connected through nodes. The hidden layer is nothing but a function (or set of functions) that processes the input information and generates an outcome. ANN has a set of rules called backpropagation which helps to go back to the hidden layer if the outcome is different from the expected one.
Question: What are the different types of ANN’s?
Answer: The most important types of artificial neural networks are –
- Feedforward neural network – the simplest type, where data passes through different input nodes until it reaches the output node. Data can move only in forward (single) direction and can consist of multiple hidden layers. They are used in AO technologies like computer vision and face recognition.
- Radial basis function neural network – this function (radial basis) calculates the relative distance between the center and a point. These NN’s have two layers and are widely applied for power restoration systems to resume power as soon as possible.
- Multilayer perceptron – this type has 3 or more layers and is used to classify data that cannot be linearly separated. Each node in one layer is connected to each node in the next. This type of NN is quite popular in speech recognition and machine translation technologies.
- Convolutional Neural Network – CNN uses a variation of multilayer perceptron and contains one or more convolutional layers. These layers are either pooled or interconnected. CNN is very effective for image classification, NLP, video recognition, signal processing, and recommendation as they apply the convolution operation on the input before it is passed to the next layer. This enables the network to be much deeper but still has fewer parameters.
- Recurrent Neural Network (RNN) – in this type, the output of a particular layer can be saved and fed to the input. This way we can predict the outcome of the layer and if it is wrong, the system can self-learn till the prediction is right. Each node acts as a memory cell. The first layer is the same as front propagation. This type is thus, also called Long Short-Term Memory (LSTM).
- Modular NN – In modular NN, there are independent networks that perform sub-tasks through individual computation. If there are complex computations, those can be broken down into independent network components, thus increasing the speed of computation. Each network is disconnected from the other.
- sequence-to-sequence models – these consist of two runs. Encoder and decoder process the input and output respectively. Both the encoder and decoder can use the same or different parameters. These models are extensively used in chatbots, Q&A systems, and machine translation.
Question: What is AIOps?
Answer: AIOps or Artificial Intelligence for IT operations combines human intelligence and algorithmic intelligence to provide more visibility and improve the performance of IT operations and systems. AIOps can automate workflows and perform algorithmic filtering to reduce noise levels.
Question: What is the T-test?
Answer: Turing test (T-test) is named after Alan Turing. It is a test of a machine’s intelligence and whether or not it can think and respond like a human. This test is a reference for scientists and researchers to check their progress on building AI systems.
Question: Do you know about reinforcement learning? How does it work?
Answer: Reinforcement learning is a type of machine learning algorithm in which the machine is self-trained to make a sequence of decisions. The computer does a lot of trial and error to achieve the required solution to a problem. There is a system of reward and punishment (penalty) for each action that the computer takes. Consider reinforcement learning as gameplay. The machine tries to understand how to perform a task to get the maximum rewards. An example is the training of the model to control autonomous cars.
Question: What is Markov’s decision process?
Answer: In real-life, we come across situations that are partly in our control and partly not. For example, arranging a cricket match – we can make all efforts to block the stadium, sell tickets, get organizers etc…, however, there is still uncertainty due to rain or other natural factors beyond our control. For such cases, the Markov Decision Process (MDP) provides a mathematical framework for modeling decision making. MDP is a memory-less random process based on the Markov property that states that the future is independent of the past when we know the present or current state.
Question: Which AI mechanism is used by self-driving cars?
Answer: Self-driving cars use the mechanism of autonomous driving. Autonomous vehicles have multiple sensors like cameras, radars, radio antenna, ultrasound, and other equipment, that help in capturing the surroundings and make the right move. These generate a lot of data that enable self-driving cars to make decisions.
Question: What are parametric models? How are they different from non-parametric models?
Answer: In parametric models, there is a fixed set of parameters used to build a probability model. On the other hand, parametric models have a flexible number of parameters. Some other differences are –
|Parametric models||Non-parametric models|
|a fixed set of parameters||parameters not fixed|
|makes strong assumptions about data and depends on the population distribution||very fewer assumptions and the methods are not dependent on the population distribution|
|used to test group means||tests medians|
|Example – logistic regression, Naïve Bayes||Example – decision tree, K nearest neighbor|
Question: What is reward maximization?
Answer: Reward maximization is a concept in reinforcement learning, where suitable action is taken to maximize the reward in a particular situation. It is done to ensure that the best path is followed by machines in a particular scenario. Think of a game where a person has to collect many coins to move to the next level. Each coin will help him move towards the next (reward) and so on. If the gamer takes the right path, he can reach the next level, however, if he doesn’t, he faces the wrath of bad elements like monsters that can eat him. To maximize his reward, the gamer has to always take the right path.
Question: Can overfitting occur in Neural networks? If yes, how can you avoid it?
Answer: Yes, it can and there are several ways to avoid it –
- Simplifying the model
- Early stopping
- Data augmentation
Check this detailed article from KDNuggets to know what these methods are.
Answer: It is a layer between input and output where artificial neurons take weighted inputs, transform them, and use an activation function to produce the output. The number of nodes depends on the problem and there is no single formula to calculate the same.
Question: What is the difference between grid search and random search?
Answer: Grid search and random search are the two methods to tune the settings (hyperparameters) of a machine learning model.
|Grid search||Random search|
|researchers set up a grid of the hyperparameter values and train the model for each of the multiple combinations||from the grid of hyperparameter values, random combinations of values are selected to train the model.|
|Very time-consuming and expensive method||controls the number of parameters to test, thus reducing the time and cost|
|All possible data combinations are tested||less number of iterations that depends on resources available and time|
Question: Do you know about Bayesian optimization? How is it done?
Answer: Bayesian optimization is done for global optimization of black-box functions i.e. functions that do not assume any functional forms. Since there is no form and the objective function is unknown, the Bayesian optimization strategy is to treat it as a random function. So, we place a prior over the function that captures beliefs about its behavior. These function evaluations (beliefs) are treated as data and based on this data the prior is updated to form posterior distribution, which in turn is used to construct a sampling criterion that determines the next query point. The two most common methods to define posterior distribution are Gaussian processes and the Parzen-Tree estimator. Information source – Wikipedia
Question: What are the model parameters?
Answer: Model parameters are configuration variables internal to a machine learning model that help to increase the accuracy of the model. They decide how to modify input data for the output to change. The value of a model parameter can be estimated from the data through estimation or learning.
Question: Do you know about any Deep learning frameworks? Explain any one framework.
Answer: There are many deep learning frameworks like PyTorch, Keras, Tensorflow, etc… They help in implementing deep learning models quickly and easily.
You can explain any of the deep learning frameworks that you know in brief.
For example, TensorFlow supports multiple languages to create models like Python, Java, C++, R. TensorFlow has a flexible architecture and is used for time series analysis, video analysis, image recognition, text-based applications, sound recognition, etc… You can simply install it using the pip command (pip install TensorFlow). Tensorflow is built on NumPy but has lazy initialization, i.e. the entire graph is built but runs only when the session calls it.
Question: How is NLP done? Explain in detail with one example.
Answer: NLP techniques rely on machine learning algorithms to infer insights from human inputs. The most common example is that of Alexa/Siri, which are virtual assistants that take audio input from humans and respond accordingly. Here is how Alexa responds to human queries –
- Humans ask a query, let us say, “What is the capital of India?”
- The machine (Alexa) captures the audio and sends it to the Alexa voice service on the cloud
- The voice is converted to text and the text is processed
- The appropriate response is formulated and converted back to audio
- This is played by the machine (Alexa)
Not only queries, but we can also ask Alexa to play songs, read the news, and many more. For every request, the process is the same.
Question: Suppose you have blogs/articles about a topic from various learned users. Which AI technology will you use to get useful insights from it? How?
Answer: This can be done through text analytics (text mining). It uses Natural language processing features to transform text (raw or unstructured) into a structured form so that data can be analyzed using Machine Learning algorithms.
Through text mining, we can identify relationships and facts about data easily and quickly. This information can then be presented in the form of tables, maps, charts for easy viewing.
Question: Give one example of how fuzzy logic is useful in real-life.
Answer: Most of the real-life problems involve some kind of uncertainty and the outcome depends on many factors, so fuzzy logic is useful in most of the problems. It is used extensively in facial pattern recognition, weather forecasting systems, medical diagnosis, stock trading, decision-making systems, etc… Many scientific and engineering applications use fuzzy logic too.
Question: What are hyperparameters used for?
Answer: Hyperparameters help determine the model parameter. They cannot be inferred directly from the data but are manually specified by a practitioner when we need to tune the model parameters for a machine learning algorithm.
Question: What are the components of fuzzy logic control (FLC)?
Answer: The major components of the Fuzzy controller or FLC are the fuzzifier, fuzzy inference rules, and the defuzzifier. Other than that, the knowledge base and rule base are also important components of FLC.
- Fuzzifier – this converts the crisp input values to fuzzy values.
- Fuzzy knowledge base – knowledge about all the fuzzy relationships between input and output is stored in this. From the fuzzifier, the input variables are fed to inference rules.
- Inference rules engine – this is a kernel that simulates human decisions through reasoning and approximation. It takes in the input from the fuzzifier and applies rules from the rule base.
- Rule base – contains the knowledge about the process
- Defuzzifier – converts the fuzzy output from the inference engine into crisp output values that can be fed to a plant or feedback system.
|Image processing||Computer vision|
|Various transformations like smoothing, stretching, sharpening, contrasting etc…. are done to the image to produce an output||The goal is to find information and insights from the input video or image|
|Aims at improving the quality of the image or enhance it for further processing||Applies image processing techniques and algorithms to emulate human vision like automatic driving, object recognition, etc…|
|No need for machine learning or comprehending the image, image processing just includes cosmetic improvements to the image||computer vision is used to enable machines to process the data (image and video) and make decisions like a human by applying machine learning techniques|
Question: What are expert systems? List the components.
Answer: An expert system is a machine or system that can make human-like decisions. These systems can solve complex problems using a set of rules and reasoning through a knowledge base. The expert system consists of two main components, the inference engine (rules) and the knowledge base (reasoning). Another component is the user interface through which the expert system interacts with a user, for example, command prompt, dialog box, etc…
Question: What is face verification/detection? Which algorithm is commonly used for the same?
Answer: Face recognition/verification/detection means finding a face based on its features and similarities by comparison and analysis, and representing the key patterns. It is an important AI interview question as this AI technology is used in many places – for example, Facebook uses face detection for tagging and other purposes, some smartphones use this technology to unlock the phone, etc…
The simplest algorithm used for face detection is the LBPH (Local Binary Pattern Histogram), which can recognize the front as well as the side of the face. Some other popular algorithms are PCA (Principal Component Analysis), Linear Discriminant Analysis, and the hidden Markov model.
Question: What is the difference between weak AI and strong AI?
|Weak AI||Strong AI|
|the response is pre-programmed and only known responses are possible||there are no set answers to a particular question; the responses can vary|
|the machine does not make any decisions or perform human-like thinking, for example, comprehending what a human speaks||the machine can think like a human and use clustering and association to process data|
|every output Y is a function of X, f(X)||a single function cannot define how the machine will respond to certain queries|
|Example, voice assistants like Alexa, Siri, a game of chess with the computer||AI-based games that can self-improve and give results that are not programmed in the system|
Question: What is a heuristic approach in gameplay? Give an example.
Answer: The heuristic approach uses techniques of intelligent guesswork, which makes it the best approach for gameplay. The heuristic technique is not necessarily always accurate but is the most practical method to satisfy immediate goals. For example, a game of chess, where there are thousands of pre-programmed moves and the computer can only guess what could be the best move based on the opponent, but can also be incorrect at times.
Question: What is robotics? Do you think robots are posing a danger to humans?
Answer: Robotics is a branch of AI that involves the design, construction, and working of robots. Robots are intelligent machines that can assist humans in performing routine tasks or tasks that can be dangerous for humans. A recent use for robots was to supply food and medicines in COVID hospitals, to avoid contact between humans and avoid getting infected.
As of today, robots are controlled by humans and do not pose any danger to humans. Machines taking over humans is still a far-fetched dream!
Question: What is collaborative filtering?
Answer: It is a technique used to process huge sets of data for detecting patterns, predict user preferences, building automatic recommender systems, etc…
In a narrow sense, these systems can make predictions about the likes and dislikes of a user based on the interests of other similar users. For example, if persons A & B both like the genre ‘comedy’, and person B likes a particular comedy movie M1, it is likely that person A will also like the same movie.
In a general sense, collaborative filtering can filter patterns or information that have collaboration between multiple data sources, agents, viewpoints, and more. Other than recommender systems, collaborative filtering is used for sensing and monitoring data, finding nearest neighbors of a data point, etc…
Question: What is the Hidden Markov Model? Where is it used?
Answer: It is a probabilistic framework, where the data is modeled as a series of outputs, generated by any of the hidden internal states. The probability of each state in the data is then determined by using inference algorithms. This model has many applications such as speech recognition systems, molecular biology, etc…
Question: What is the difference between inductive and deductive reasoning?
|Inductive reasoning||deductive reasoning|
|moves from a particular case (observation) and goes on to generalize the principle||A general principle, statement or hypothesis is applied to special cases through tests|
|Moves from observation to idea||moves from idea to observation|
|the process is observation -> pattern -> hypothesis -> theory||the process is theory -> hypothesis -> pattern -> observation|
|inductive reasoning makes observations that are turned into generalizations for how a particular thing works||deductive reasoning has theories that can prove an outcome|
|As the world is full of uncertainties, probabilities and partial knowledge, inductive reasoning is easy to apply||Hard to apply as it applies a set of facts that must be true.|
Question: When you play tic-tac-toe with the computer, which algorithm does the computer use to plan its next moves?
Answer: The algorithm used for a game of tic-tac-toe is the minimax algorithm, which evaluates moves that lead to a terminal state. The computer (AI) chooses a move with the maximum score when it has to play and chooses to move with the minimum score when the human has to play, to avoid losing to a human player. The minimax algorithm recursively goes to deeper levels until it finds a terminal. If the machine wins, it returns +10, else returns -10. If it is a draw, 0 will be returned.
Question: A company receives 1000’s of resumes per day. How can AI help in the faster and accurate selection of resumes to take the next step in the interview process?
Answer: Using text recognition and analysis, machine learning algorithms can scan for specific keywords in the resume that will help them filter candidates who do not match the requirements. Further, voice-based assistants can ask a standard set of questions to the shortlisted candidates over voice calls and select or reject them for the next level based on specific responses.
Question: Explain some ways in which AI is helping the essential workers to deal with COVID-19.
Answer: There are many ways in which AI is helping –
- Drones can capture and monitor various areas to ensure social distancing and supply essentials in containment zones
- Robots can take food and medicines to the patients admitted, ensuring a contactless transfer
- Early diagnosis and detection of the infection
- Drug research
- Apps like Arogya Setu use AI to identify potential cases and help curb the spread of the disease
Question: Which AI technology helps detect and prevent fraud?
Answer: Frauds can be detected and prevented using biometric data like fingerprints, DNA, retina scans, and facial patterns. Advanced biometric systems can collect data about the usage patterns, typing speed and other information from a user, and look for deviations to detect fraud and prevent it by alerting the user of suspicious activity. Read more on this in our AI technologies article.
Question: How does AI help in targeted marketing? Which algorithm can be used for the same?
Answer: In target marketing, specific segments of customers are targeted for focused marketing. For example, new fashion apparel would be trendier among people aged 20-35 years than those who are less or more in age. So, companies can focus their campaigns and advertisements keeping in mind this age group. There can be many other factors like gender, likes and dislikes, etc… for targeted marketing. There are many ML algorithms used for targeted marketing –
- Recommender system
- Market basket analysis
- Text analysis, classification and pattern search
Question: Suppose you want to buy bread. You pick some butter and eggs along with it. You see that many customers do the same – pick bread, butter, eggs and some also pick milk. You realize that bread-butter, bread-eggs, bread-milk make for a great combination, and that’s why many customers purchase them together! What is this type of analysis called? How can machines do the same type of analysis?
Answer: This type of analysis is called the market basket analysis. It analyses the items frequently purchased together to find correlations and helps companies promote sales by offering discounts on such bundles. For example, if you buy 2 packets of bread, you get 10% off on butter, etc… Many supermarkets use this technique to place items on their shelves, where items that are bought together are placed together. The two main algorithms used for market basket analysis are association rule mining and the Apriori algorithm. Learn more from our article on Unsupervised learning.
Question: Explain the Q-learning algorithm with an example.
Answer: Q-learning algorithm is a type of reinforcement algorithm, which involves an agent, set of states, and set of actions per state. In this algorithm, the agent knows the action to be performed under each state by finding the optimal policy. It is a model-free, value-based algorithm. The Q-value or action value improves the behavior of an agent in each iteration. This value is computed using the temporal difference or TD-update rule.
Question: Explain how image classification works.
Answer: Image classification can be done using deep neural networks. A neural network is fed with various images and classifies them into different categories. For example, dog, car, apple, plant are the categories, and images about each can be fed to the NN.
TensorFlow is the most common library used to implement deep learning frameworks.
Through supervised learning, we can train the network to understand how each of these items looks like (what does a dog look like? How to identify an apple? Etc…).
The most accurate NN to classify images is the Convolutional Neural Network (CNN). Once the NN is trained, it can identify images with good accuracy.
Question: What is the difference between minimax and maximin algorithms?
Answer: Both algorithms are used for game theory.
|minimax method tries to minimize the maximum loss in decision theory||maximin method tries to maximize the minimum gain in decision theory|
|based on the concept of zero-sum games, where one player’s gain is the same as the other person’s loss in the game||it is used for non-zero-sum games where a player tries to maximize his minimum gain in the game|
|used while referring to one’s loss||used while referring to one’s gain|
Question: What is alpha-beta pruning?
Answer: It is an adversarial search algorithm that is used for two-player computer games like tic-tac-toe, chess, etc… It seeks to reduce the number of nodes evaluated by the minimax algorithm in its search tree by pruning the branches that would not possibly influence the final decision for the next move.
Question: Explain the working of the minimax algorithm using an example.
Answer: The Minimax algorithm focuses on two-player games, one is the computer and the other is a human. The algorithm creates a tree of all possible moves of all the players to a certain depth. Each of the positions holds a heuristic value (+1, 0, or -1). The algorithm starts with the bottom of the tree and decides the best move that results in a +1 for self and -1 for the other player. It also prunes out all the bad moves along the traversal path.
Check out this interactive YouTube video for an example of how to create a stick game using this algorithm.
Question: What is the A-star algorithm?
Answer: A-star is a path search algorithm that uses graph traversal, i.e. starts with a particular starting node of a graph, and finds the least distance/shortest time to reach the goal node. A* does this by maintaining a tree of paths, that start at the beginning node and extend those till the termination criterion is satisfied. The extension is decided at each iteration based on the cost of the path and the estimation of the overall cost required to reach the goal through that path.
Question: Explain game theory with an example.
Answer: Game theory is a concept used in various fields like economics, computer science, mathematics, engineering, biology, etc… to study strategy and conflict. In-game theory, an agent’s success depends on what others choose. Game theory is used as a tool to understand various behaviors, such as market behavior, customer behavior, and behavior of companies, and make rational decisions when a conflict arises. An example is the simple game of UNO, where there are multiple decision-makers known as players, who have a set of strategies or actions that they can perform, which results in a set of outcomes of the game. Players get payoffs based on different outcomes. For example, if the last card of a player is 7 of red, and the person playing before him changes the color to something else, the outcome of the game will change. However, if the color remains red, the player wins the game.
Question: Which one is more accurate – supervised learning or unsupervised learning?
Answer: Supervised learning technique is considered to be more accurate because the output is already known, hence we can train the model and improve it using the labeled data. Supervised learning techniques learn from past experiences and data, that’s why they are more trustworthy and accurate.
Question: What are intelligent agents?
Answer: An intelligent agent is a program that makes decisions or performs services based on environment, experience, and user inputs. The programs autonomously gather information on a pre-programmed schedule or prompted by the user. Intelligent agents are also called bots.
For Intelligent systems with AI, the user input is taken through sensors like cameras or microphones, and the agent output is delivered through actuators, like a computer screen or speakers.
A good example is the virtual assistant Alexa, that takes input through microphones and delivers output through the speaker. Read more.
Question: What is the difference between breadth-first and depth-first search algorithm?
|Breadth-first (BFS)||Depth-first (DFS)|
|uses queue data structure – FIFO or first in first out||uses stack data structure – LIFO or last in first out|
|a vertex-based technique to find the shortest path in a graph||we may travel through more edges to reach the destination; visited vertices are stacked and popped out if no other vertices are there|
|suitable for searching vertices closer to the source||suitable for searching vertices that are far from the source|
|first, all the neighbors are identified and then the decision is made for the shortest path||The decision is made first, and then all the paths are explored, whichever path satisfies the decision most, is considered the best.|
Question: What is LSTM? What are its components?
Answer: LSTM (Long Short-Term Memory) is an improvement over Recurrent Neural Network (RNN) used for deep learning. It is a complex mechanism that tries to mimic the human brain and is capable of processing the entire sequence of data rather than just single points (images). This means that LSTM has feedback connections. LSTM are widely used in speech recognition, text recognition, and handwriting recognition systems, amongst other applications.
The components of LSTM are the various memory blocks called cells. Each cell transfers two important pieces of information to the next cell – the cell state and the hidden state. The memory blocks remember facts and manipulate them using three major regulators – the forget gate, input gate, and output gate.
- Input gate: controls the flow of new values into the cell
- Forget gate: controls how long value should remain in the cell
- Output gate: controls how a value can be used for computation of activation function
Question: Which is the best algorithm for image classification? Can we use other algorithms? Why or why not?
Answer: Convolutional Neural Networks (CNN) is the most widely used and one of the best techniques for image classification. With CNN, feature extraction is automatic and learning is more compared to other techniques like SVM, logistic regression, etc… This gives more accuracy and less error in the final output. With the other algorithms, a lot of time was spent on feature selection (extraction). CNN selects both local and global features automatically for image classification.
Question: Is there a way in which a program can improve itself? How?
Answer: Yes, programs can evolve through machine learning. Such algorithms are called genetic algorithms, that can improve by selecting the best possible solution, with a set of constraints. The program keeps repeating until it reaches a certain limit. Genetic algorithms are said to be the programmatic implementation of the ‘survival of the fittest’.
Question: Which programming language is best suited for robotics and why?
Answer: There are many languages but C++ and Python are the most preferred languages. Both are used in the Robot Operating system. C++ has many features like embedded programming, navigation, image processing, motor control, etc… that cater to robotics. Python comes with loads of libraries for machine learning and deep learning. Other than that, MATLAB is a good language to learn for robotics because it supports embedded programming, rapid prototyping, and image processing tools.
AI is a complex topic and there can be many more Artificial Intelligence Interview questions that will be asked by the interviewer. Most of the Artificial Intelligence Interview depends on your answer to the previous question. However, the interviewer tests your aptitude, thinking, and observation skills as well, along with the technical stuff. Through these top Artificial Intelligence Interview questions, you can get a fair idea of how the question patterns are and the common topics that are asked in most interviews. But this list is in no way exhaustive. There can be more questions, based on your experience level and if you have done any AI-related projects, you would be asked about that. Preparing the above questions should give you a good level of confidence to clear AI interviews.
You might be also interested in: