Basic Data Science Interview Questions
Basic Data Science Interview Questions
1. What is Data Science? Also, list the differences between supervised and
unsupervised learning.
The following are some of the important skills to possess which will come handy
when performing data analysis using Python.
The following will help to tackle any problem in data analytics and machine
learning.
Selection bias is a kind of error that occurs when the researcher decides who is
going to be studied. It is usually associated with research where the selection of
participants isn’t random. It is sometimes referred to as the selection effect. It is the
distortion of statistical analysis, resulting from the method of collecting samples. If
the selection bias is not taken into account, then some conclusions of the study may
not be accurate.
In the wide format, a subject’s repeated responses will be in a single row, and each
response is in a separate column. In the long format, each row is a one-time point
per subject. You can recognize data in wide format by the fact that columns
generally represent groups.
Data is usually distributed in different ways with a bias to the left or to the right or
it can all be jumbled up.
However, there are chances that data is distributed around a central value without
any bias to the left or right and reaches normal distribution in the form of a bell-
shaped curve.
The random variables are distributed in the form of a symmetrical bell-shaped
curve.
The goal of A/B Testing is to identify any changes to the web page to maximize or
increase the outcome of an interest. A/B testing is a fantastic method for figuring
out the best online promotional and marketing strategies for your business. It can
be used to test everything from website copy to sales emails to search ads
An example of this could be identifying the click-through rate for a banner ad.
In statistics and machine learning, one of the most common tasks is to fit
a model to a set of training data, so as to be able to make reliable predictions on
general untrained data.
Python would be the best option because it has Pandas library that provides
easy to use data structures and high-performance data analysis tools.
R is more suitable for machine learning than just text analysis.
Python performs faster for all types of text analytics.
Python vs R
The bivariate analysis attempts to understand the difference between two variables
at a time as in a scatterplot. For example, analyzing the volume of sale and
spending can be considered as an example of bivariate analysis.
Multivariate analysis deals with the study of more than two variables to
understand the effect of variables on the responses.
Cluster sampling is a technique used when it becomes difficult to study the target
population spread across a wide area and simple random sampling cannot be
applied. Cluster Sample is a probability sample where each sampling unit is a
collection or cluster of elements.
For eg., A researcher wants to survey the academic performance of high school
students in Japan. He can divide the entire population of Japan into different
clusters (cities). Then the researcher selects a number of clusters depending on his
research through simple or systematic random sampling.
Let’s continue our Data Science Interview Questions blog with some more
statistics questions.
15. Can you cite some examples where a false positive is important than a false
negative?
Let us first understand what false positives and false negatives are.
False Positives are the cases where you wrongly classified a non-event as an
event a.k.a Type I error.
False Negatives are the cases where you wrongly classify events as non-
events, a.k.a Type II error.
Example 2: Let’s say an e-commerce company decided to give $1000 Gift voucher
to the customers whom they assume to purchase at least $10,000 worth of
items. They send free voucher mail directly to 100 customers without any
minimum purchase condition because they assume to make at least 20% profit on
sold items above $10,000. Now the issue is if we send the $1000 gift vouchers to
customers who have not actually purchased anything but are marked as having
made $10,000 worth of purchase.
16. Can you cite some examples where a false negative important than a false
positive?
Example 3: What if you rejected to marry a very good person based on your
predictive model and you happen to meet him/her after a few years and realize that
you had a false negative?
17. Can you cite some examples where both false positive and false negatives
are equally important?
In the Banking industry giving loans is the primary source of making money but at
the same time if your repayment rate is not good you will not make any profit,
rather you will risk huge losses.
Banks don’t want to lose good customers and at the same point in time, they don’t
want to acquire bad customers. In this scenario, both the false positives and false
negatives become very important to measure.
18. Can you explain the difference between a Validation Set and a Test Set?
A Validation set can be considered as a part of the training set as it is used for
parameter selection and to avoid overfitting of the model being built.
On the other hand, a Test Set is used for testing or evaluating the performance of a
trained machine learning model.
In simple terms, the differences can be summarized as; training set is to fit the
parameters i.e. weights and test set is to assess the performance of the model i.e.
evaluating the predictive power and generalization.
The goal of cross-validation is to term a data set to test the model in the training
phase (i.e. validation data set) in order to limit problems like overfitting and get an
insight on how the model will generalize to an independent data set.
Machine Learning explores the study and construction of algorithms that can learn
from and make predictions on data. Closely related to computational
statistics. Used to devise complex models and algorithms that lend themselves to a
prediction which in commercial use is known as predictive analytics.
E.g. If you built a fruit classifier, the labels will be “this is an orange, this is an
apple and this is a banana”, based on showing the classifier examples of apples,
oranges and bananas.
E.g. In the same example, a fruit clustering will categorize as “fruits with soft skin
and lots of dimples”, “fruits with shiny hard skin” and “elongated yellow fruits”.
23. What are the various classification algorithms?
24. What is logistic regression? State an example when you have used logistic
regression recently.
For example, if you want to predict whether a particular political leader will win
the election or not. In this case, the outcome of prediction is binary i.e. 0 or 1
(Win/Lose). The predictor variables here would be the amount of money spent for
election campaigning of a particular candidate, the amount of time spent in
campaigning, etc.
The process of filtering used by most of the recommender systems to find patterns
or information by collaborating viewpoints, various data sources and multiple
agents.
Outlier values can be identified by using univariate or any other graphical analysis
method. If the number of outlier values is few then they can be assessed
individually but for a large number of outliers, the values can be substituted with
either the 99th or the 1st percentile values.
All extreme values are not outlier values. The most common ways to treat outlier
values
The extent of the missing values is identified after identifying the variables with
missing values. If any patterns are identified the analyst has to concentrate on them
as it could lead to interesting and meaningful business insights.
If there are no patterns identified, then the missing values can be substituted with
mean or median values (imputation) or they can simply be ignored. Assigning a
default value which can be mean, minimum or maximum value. Getting into the
data is important.
If 80% of the values for a variable are missing then you can answer that you would
be dropping the variable instead of treating the missing values.
31. How will you define the number of clusters in a clustering algorithm?
This is the widely used approach but few data scientists also use Hierarchical
clustering first to create dendrograms and identify the distinct groups from there.
Now that we have seen the Machine Learning Questions, Let’s continue our Data
Science Interview Questions blog with some Probability questions.
Probability of not seeing any shooting star in the period of one hour
= (0.8) ^ 4 = 0.4096
33. How can you generate a random number between 1 – 7 with only a die?
Any die has six sides from 1-6. There is no way to get seven equal outcomes
from a single rolling of a die. If we roll the die twice and consider the event
of two rolls, we now have 36 different outcomes.
To get our 7 equal outcomes we have to reduce this 36 to a number divisible
by 7. We can thus consider only 35 outcomes and exclude the other one.
A simple scenario can be to exclude the combination (6,6), i.e., to roll the
die again if 6 appears twice.
All the remaining combinations from (1,1) till (6,5) can be divided into 7
parts of 5 each. This way all the seven sets of outcomes are equally likely.
34. A certain couple tells you that they have two children, at least one of which
is a girl. What is the probability that they have two girls?
where B = Boy and G = Girl and the first letter denotes the first child.
From the question, we can exclude the first case of BB. Thus from the remaining 3
possibilities of BG, GB & BB, we have to find the probability of the case with two
girls.
35. A jar has 1000 coins, of which 999 are fair and 1 is double headed. Pick a
coin at random, and toss it 10 times. Given that you see 10 heads, what is the
probability that the next toss of that coin is also a head?
There are two ways of choosing the coin. One is to pick a fair coin and the other is
to pick the one with two heads.
36. What do you mean by Deep Learning and Why has it become popular
now?
Deep Learning is nothing but a paradigm of machine learning which has shown
incredible promise in recent years. This is because of the fact that Deep Learning
shows a great analogy with the functioning of the human brain.
Now although Deep Learning has been around for many years, the major
breakthroughs from these techniques came just in recent years. This is because of
two main reasons:
The increase in the amount of data generated through various sources
The growth in hardware resources required to run these models
GPUs are multiple times faster and they help us build bigger and deeper deep
learning models in comparatively less time than we required previously
Artificial Neural networks are a specific set of algorithms that have revolutionized
machine learning. They are inspired by biological neural networks. Neural
Networks can adapt to changing input so the network generates the best possible
result without needing to redesign the output criteria.
A gradient measures how much the output of a function changes if you change the
inputs a little bit. It simply measures the change in all weights with regard to the
change in error. You can also think of a gradient as the slope of a function.
Pytorch
TensorFlow
Microsoft Cognitive Toolkit
Keras
Caffe
Chainer
The Activation function is used to introduce non-linearity into the neural network
helping it to learn more complex function. Without which the neural network
would be only able to learn linear function which is a linear combination of its
input data. An activation function is a function in an artificial neuron that delivers
an output based on inputs
Autoencoders are simple learning networks that aim to transform inputs into
outputs with the minimum possible error. This means that we want the output to be
as close to input as possible. We add a couple of layers between the input and the
output, and the sizes of these layers are smaller than the input layer. The
autoencoder receives unlabeled input which is then encoded to reconstruct the
input.
45. What is a Boltzmann Machine?
Boltzmann machines have a simple learning algorithm that allows them to discover
interesting features that represent complex regularities in the training data. The
Boltzmann machine is basically used to optimize the weights and the quantity for
the given problem. The learning algorithm is very slow in networks with many
layers of feature detectors. “Restricted Boltzmann Machines” algorithm has a
single layer of feature detectors which makes it faster than the rest.
I hope this set of Data Science Interview Questions and Answers will help you in
preparing for your interviews. All the best!
Got a question for us? Please mention it in the comments section and we will get
back to you at the earliest.
Edureka has a specially curated Data Science course which helps you gain
expertise in Machine Learning Algorithms like K-Means Clustering, Decision
Trees, Random Forest, Naive Bayes. You’ll learn the concepts of Statistics, Time
Series, Text Mining and an introduction to Deep Learning as well. You’ll solve
real-life case studies on Media, Healthcare, Social Media, Aviation, HR. New
batches for this course are starting soon!!