Blog Details

img
Data Science

Latest Data Science interview questions and answers 2024

Administration / 21 Mar, 2024

Q.1 What do you understand by the term Normal Distribution?

                              

Normal Distribution is also known as Gaussian Distribution. It is a type of probability distribution that is symmetric about the mean. 

it shows that the data is closer to the mean and the frequency of occurrences in data are far from the mean.

 

Q2. What is Data Science?

An interdisciplinary field that constitutes various scientific processes, algorithms, tools, and machine learning techniques working to help 

find common patterns and gather sensible insights from the given raw input data using statistical and mathematical analysis is called Data Science.

The following figure represents the life cycle of data science.

                                  

 

· It starts with gathering the business requirements and relevant data.

· Once the data is acquired, it is maintained by performing data cleaning, data warehousing, data staging, and data architecture.

· Data processing does the task of exploring the data, mining it, and analyzing it which can be finally used to generate the summary of the insights extracted from the data.

· Once the exploratory steps are completed, the cleansed data is subjected to various algorithms like predictive analysis, regression, text mining, 

recognition patterns, etc depending on the requirements.

· In the final stage, the results are communicated to the business in a visually appealing manner. This is where the skill of data visualization, 

reporting, and different business intelligence tools come into the picture.

· 

Q3. Which are the important steps of Data Cleaning?

Different types of data require different types of cleaning, the most important steps of Data Cleaning are:

1. Data Quality

2. Removing Duplicate Data (also irrelevant data)

3. Structural errors

4. Outliers

5. Treatment for Missing Data

Data Cleaning is an important step before analysing data, it helps to increase the accuracy of the model. This helps organisations to make an informed decision.

Data Scientists usually spends 80% of their time cleaning data.

 

Q4. What is the difference between Supervised Learning and Unsupervised Learning?

Ans. Supervised Machine Learning requires labelled data for training while Unsupervised Machine Learning does not require labelled data. 

It can be trained on unlabelled data.

To elaborate, supervised learning involves training of the model with a target value whereas unsupervised has 

no known results to learn and it has a state-based or adaptive mechanism to learn by itself. Supervised learning involves high computation 

costs whereas unsupervised learning has low 

training cost. Supervised learning finds applications in classification and regression tasks whereas unsupervised learning finds applications in clustering and association rule mining.

 

Q5.  What are some of the techniques used for sampling? What is the main advantage of sampling?

Data analysis can not be done on a whole volume of data at a time especially when it involves larger datasets. It becomes crucial to take 

some data samples that can be used for representing the whole population and then perform analysis on it. While doing this, it is very much 

necessary to carefully take sample data out of the huge data that truly represents the entire dataset.

 

 

 

There are majorly two categories of sampling techniques based on the usage of statistics, they are:

· Probability Sampling techniques: Clustered sampling, Simple random sampling, Stratified sampling.

· Non-Probability Sampling techniques: Quota sampling, Convenience sampling, snowball sampling, etc.

 

Q6. Explain Normal Distribution

Ans. Normal Distribution is also called the Gaussian Distribution. It is a type of probability distribution such that most of the values lie near

 the mean. It has the following characteristics:

· The mean, median, and mode of the distribution coincide

· The distribution has a bell-shaped curve

· The total area under the curve is 1

· Exactly half of the values are to the right of the centre, and the other half to the left of the centre

Q7. How is logistic regression done?

Logistic regression measures the relationship between the dependent variable (our label of what we want to predict) and one or more independent 

variables (our features) by estimating probability using its underlying logistic function (sigmoid).

 



The formula and graph for the sigmoid function are as shown:

 

 

 

Q8. What Is K-Means Clustering?

K-means is an unsupervised learning algorithm used for problems having to do with clustering data. It follows the sequence of steps described below: 

1. Choose how many clusters to create and assign it as k. 

2. Choose k points from the dataset randomly, which will serve as the centroids. 

3. Take each data point and group it with the closest centroid. This will lead to the formation of k clusters. 

4. Calculate the variance in the dataset and assign a new centroid for each cluster accordingly.

5. Now repeat the third step by reassigning each data point with the new centroids. 

6. If any reassignments have taken place, then repeat the fourth step. If not, the model is ready. 

 

Q9. What Is the Difference Between Data Modeling and Database Design?

A data model is a conceptual model showing the different entities from which data is sourced and the relationships between them. Database design, 

on the other hand, is the process of building a schema based on how a database is constructed. 

 

Q.10 What are the probability axioms?

The fundamental rules that control the behaviour and characteristics of probabilities in probability theory and statistics are referred to 

as the probability axioms, sometimes known as the probability laws or probability principles.

There are three fundamental axioms of probability:

1. Non-Negativity Axiom

1. Normalization Axiom

1. Additivity Axiom

 

Q11. What is the ER model in SQL?

The structure and relationships between the data entities in a database

 are represented by the Entity-Relationship (ER) model, a conceptual framework used in database architecture. The ER model is 

frequently used in conjunction with SQL for creating the structure of relational databases even though it is not a component of the SQL language itself.

 

Q12. Name two examples of sampling techniques.

Data scientists with technical experience and knowledge will be able to name two sampling techniques and, crucially, explain 

their usefulness. Two examples they may mention include non-probability and probability sampling. Look out for applicants who can explain

 these techniques in the context of their recent work or projects.

 

Q13. Explain what long data formats are.

Candidates who have worked with long data formats will have the technical knowledge to respond to this data science interview question. 

An ideal response will explain that datasets in long data formats have columns for different variable types and extra columns for the variables’ values.

 

Q14. What is data transformation?

The process of transforming data from one structure, format, or representation into another is referred to as data transformation. 

In order to make the data more suited for a given goal, such as analysis, visualisation, reporting, or storage, this procedure may

 involve a variety of actions and changes to the data. Data integration, cleansing, and analysis depend heavily on data transformation, 

which is a common stage in data preparation and processing pipelines.

 

Q15.  What is the logistic function (sigmoid function) in logistic regression?

Sigmoid Function: It is a mathematical function which is characterized by its S- shape curve. Sigmoid functions have the tendency to squash a data point to lwith

0 and 1. This is why it is also called Squashing function, which is given as:    

 

 

     

Q16.  How are KNN and K-means clustering different?

Firstly, KNN is a supervised learning algorithm. In order to 

train this algorithm, we require

 labeled data. K-means is an unsupervised learning algorithm that looks for patterns that are intrinsic to the data. 

The K in KNN is the number of nearest data points. On the contrary, the K in K-means specify the number of centroids.

 

Q17. Explain A/B testing.

To perform a hypothesis testing of a randomized experiment with two variables A and B, we 

make use of A/B testing. A/B testing is used to optimize web-pages based on 

user preferences where small changes are added to web-pages that are delivered to a 

sample of users. Based on their reaction to the web-page and reaction of the rest of the audience to the original page, we can carry out this statistical experiment.

 

Q18. WHAT IS CROSS-VALIDATION?

Cross-validation is essentially a technique used to assess how well a model performs on a 

new, independent data set. The simplest

 example of cross-validation is when you split your data into two groups: training data and testing data. You use the training 

data to build the model and the testing data to test the model.

 

 Q19. Explain K-Fold Cross-Validation.

Cross-validation is a technique used to estimate the efficacy of a machine learning model. The parameter, k, is a tally of the number of groups that a dataset can be split up into. 

The process starts with the entire dataset being shuffled in a random manner. It is then divided into k groups, also known as folds. The following procedure is applied to each unique fold: 

1. Assign one fold as a test fold and the remaining k-1 folds as a test set. 

2. Begin training the model on the training set. For each cross-validation iteration, train a new model that’s independent of the models used in prior iterations. 

3. Validate the model on the test set and save the result of each iteration. 

4. Average out the results from each iteration to obtain the final score. 

 

Q20.  What are some unique skills that you can bring to the team as a data scientist?

As a data scientist, I bring expert knowledge in machine learning, statistical modeling, and data visualization. My ability to translate

 complex data into actionable insights is valuable. I have proficiency in programming languages like Python, R, and SQL, crucial for

 data manipulation and analysis. Additionally, my experience with 

big data platforms and tools, along with strong problem-solving 

skills, uniquely position me to contribute.

 

Q21. What is marginal probability?

A key idea in statistics and probability theory is marginal probability, which is also known as marginal distribution. With reference

 to a certain variable of interest, it is the likelihood that an event will occur, without taking into account the results of other variables.

 Basically, it treats the other variables as if they were “marginal” or irrelevant and concentrates on one.

Marginal probabilities are essential in many statistical analyses, including estimating anticipated values, computing conditional 

probabilities, and drawing conclusions about certain variables of interest while taking other variables’ influences into account.

 

Q22. What is Bayes’ Theorem and when is it used in data science?

The Bayes theorem predicts the probability that an event connected to any condition would occur. It is also taken into account 

in the situation of conditional probability. The probability of “causes” formula is another name for the Bayes theorem.

In data science, Bayes’ Theorem is used primarily in:

1. Bayesian Inference

1. Machine Learning

1. Text Classification

1. Medical Diagnosis

1. Predictive Modeling

When working with ambiguous or sparse data, Bayes’ Theorem is very helpful since it enables data scientists to continually

 revise their assumptions and come to more sensible conclusions.

 

Q23. What is your most favored strategy to clean a big data set and why?

My most favored strategy is iterative cleaning, where data is cleaned in stages or chunks, rather than all at once. This approach, 

often combined with automation tools, is efficient and manageable for large datasets. It allows for quality checks at each stage,

 minimizes the risk of data loss, and enables timely error detection.

 

Q24. Why is Python used for Data Cleaning in DS?

Data Scientists and technical analysts must convert a huge amount of data into effective ones. Data Cleaning includes

 removing malwared records, outliners, inconsistent values, redundant formatting etc. Matplotlib, Pandas etc are the most used Python Data Cleaners.

 

Q25. How R is Useful in the Data Science Domain?

Here are some ways in which R is useful in the data science domain:

· Data Manipulation and Analysis: R offers a comprehensive collection of libraries and functions that facilitate proficient 

data manipulation, transformation, and statistical analysis.

· Statistical Modeling and Machine Learning: R offers a wide range of packages for advanced statistical modeling and 

machine learning tasks, empowering data scientists to build predictive models and perform complex analyses.

· Data Visualization: R’s extensive visualization libraries enable the creation of visually appealing and insightful plots, charts, and graphs.

· Reproducible Research: R supports the integration of code, data, and documentation, facilitating reproducible 

workflows and ensuring transparency in data science projects.

 

Q26. How will you handle missing values in data?

There are several ways to handle missing values in the given data-

· Dropping the values

· Deleting the observation (not always recommended).

· Replacing value with the mean, median and mode of the observation.

· Predicting value with regression

· Finding appropriate value with clustering

 

Q27.  What is a confusion matrix?

A confusion matrix is a table that delineates the performance of a supervised learning algorithm. It provides a summary

 of prediction results on a classification problem. With the help of confusion matrix, you can not only find the errors made by the predictor but also the type of errors.

 

Q28. Explain Dimensionality Reduction and Its Benefits.

Dimensionality reduction is the process of eliminating the redundant variables or features being studied in a machine 

learning environment. The benefits of dimensionality reduction are: 

· It reduces the storage requirements of machine learning projects. 

· It’s easier to interpret the results of a machine learning model. 

· It’s easier to visualize results when the dimensionality is reduced to two or three parameters, making 2D and 3D visualizations possible. 

 

Q29.  Explain the ROC Curve.

ROC curves are graphs that depict how a classification model performs at different classification thresholds. 

The graph is plotted with the True Positive Rate (TPR) on the y-axis and the False Positive Rate (FPR) on the x-axis. 

The TPR is expressed as the ratio between the number of true positives and the sum of the number of true positives and

 false negatives. The FPR is the ratio between the number of false positives in a dataset and the sum of the number of false positives and true negatives. 

 

Q30.  Explain A/B testing.

To perform a hypothesis testing of a randomized experiment with two variables A and B, 

we make use of A/B testing. A/B testing is used to optimize web-pages based 

on user preferences where small changes are added to web-pages that are delivered 

to a sample of users. Based on their reaction to the web-page and reaction of the rest of the audience to the original page, we can carry out this statistical experiment.

 

Q31.  What are the main components of a SQL query?

A relational database’s data can be retrieved, modified, or managed via a SQL (Structured Query Language) query. 

The operation of a SQL query is defined by a number of essential components, each of which serves a different function.

1. SELECT

1. FROM

1. WHERE

1. GROUP BY

1. HAVING

1. ORDER BY

1. LIMIT

1. JOIN

 

Q32.  What is a primary key?

A relational database table’s main key, also known as a primary keyword, is a column that is unique for each record. 

It is a distinctive identifier.The primary key of a relational database must be unique. Every row of data must have a primary key value and none of the rows can be null.

 

Q33.  How will you create a series from a given list in Pandas?

We will the list to the Series() function.

ser1 = pd.Series(mylist)

 

Q34. How can you compute significance using p-value?

After a hypothesis test is conducted, we compute the significance of the results. 

The p-value is present between 0 and 1. If the p-value is less than 0.05, then it means that we cannot reject the null hypothesis. 

However, if it is greater than 0.05, then we reject the null hypothesis.

 

Q35.  What is the difference between recall and precision?

Recall is the fraction of instances that have been classified as true. On the contrary, precision is a measure of weighing instances 

that are actually true. While recall is an approximation, precision is a true value that represents factual knowledge.

Q36. What is the difference between long format data and wide format data?

 

Long Format Data

Wide Format Data

A long format data has a column for possible variable types and a column for the values of those variables.

Whereas, Wide data has a column for each variable.

Each row in the long format represents a one-time point per subject. As a result, each topic will contain many rows of data.

The repeated responses of a subject will be in a single row, with each response in its own column, in the wide format.

This data format is most typically used in R analysis and for writing to log files at the end of each experiment.

This data format is most widely used in data manipulations, and stats programmes for repeated measures ANOVAs and is seldom used in R analysis.

A long format contains values that do repeat in the first column.

A wide format contains values that do not repeat in the first column.

Use df.melt() to convert the wide form to long form

use df.pivot().reset_index() to convert the long form into wide form

 

Q37. Why is Python used for data cleaning in DS?

Data Scientists have to clean and transform huge data sets into a form that they can work with. It is important to deal with redundant

 data for better results by removing nonsensical outliers, malformed records, missing values, inconsistent formatting, etc.

Python libraries such as  Matplotlib, Pandas, Numpy, Keras, and SciPy are extensively used for data cleaning and analysis. 

These libraries are used to load and clean the data and do effective analysis. For instance, you might decide to remove outliers that are beyond a certain standard deviation from the mean of a numerical column.

 

mean = df["Price"].mean();

 

std = df["Price"].std();

 

threshold = mean + (3 * std);  # Set a threshold for outliers

 

df = df[df["Price"] < threshold]  # Remove outliers

Hence, this is how the process of data cleaning is done using python libraries in the field of data science.

 

Q38. List differences between DELETE and TRUNCATE commands.

DELETE command is used in conjunction with WHERE clause to delete some rows from the table. This action can be rolled back.

However, TRUNCATE is used to delete all the rows of a table and this action cannot be rolled back.

 

Q39. What do you mean by Data Integrity?

With data integrity, we can define the accuracy as well as the consistency of the data. This integrity is to be ensured over the entire life-cycle.

 

Q40. What is box cox transformation?

In order to transform the response variable so that the data meets its required assumptions, we make use of Box Cox Transformation. 

With the help of this technique, we can transform non-normal dependent variables into normal shapes. We can apply a broader number of tests with the help of this transformation.

 

Q41. What is k-fold cross-validation?

In k-fold cross-validation, we divide the dataset into k equal parts. After this, we loop over the entire dataset k times. In each iteration of the loop, one 

of the k parts is used for testing, and the other k − 1 parts are used for training. Using k-fold cross-validation, each one of the k parts

 of the dataset ends up being used for training and testing purposes.

 

Q42. What is Deep Learning?

Deep Learning is a kind of Machine Learning, in which neural networks are used to imitate the structure of the human brain, and just like

 how a brain learns from information, machines are also made to learn from the information that is provided to them.

Deep Learning is an advanced version of neural networks to make the machines learn from data. In Deep Learning, the neural networks 

comprise many hidden layers (which is why it is called ‘deep’ learning) that are connected to each other, and the output of the previous layer is the input of the current layer.

 

Q43.  What is entropy in a decision tree algorithm?

Entropy is the measure of randomness or disorder in the group of observations. It also determines how a decision tree switches to split data.

 Entropy is also used to check the homogeneity of the given data. If the entropy is zero, then the sample of data is entirely homogeneous, and 

if the entropy is one, then it indicates that the sample is equally divided

 

Q44. How do you handle missing or NULL values in a database table?

Missing or NULL values can arise due to various reasons, such as incomplete data entry, optional fields, or data extraction processes.

1. Replace NULL with Placeholder Values

1. Handle NULL Values in Queries

1. Use Default Values

 

Q45.  What is a support vector machine (SVM), and what are its key components?

Support Vector machines are a type of Supervised algorithm which can be used for both Regression and Classification problems. 

In SVMs, the main goal is to find a hyperplane which will be used to segregate different data points into classes. Any new data point 

will be classified based on this defined hyperplane.

Support Vector machines are highly effective when dealing with high dimensionality space and can handle non linear data very well. 

But if the number of features are greater than number of data samples, it is susceptible to overfitting.

The key components of SVM are:

· Kernels Function: It is a mapping function used for data points to convert it into high dimensionality feature space.

· Hyperplane: It is the decision boundary which is used to differentiate between the classes of data points.

· Margin: It is the distance between Support Vector and Hyperplane

· C: It is a regularization parameter which is used for margin maximization and misclassification minimization.

· 

Q46.  What is CNN (Convolutional Neural Network)?

A Convolutional Neural Network (CNN) is an advanced deep learning architecture designed specifically for analyzing visual data, 

such as images and videos. It is composed of interconnected layers of neurons that utilize convolutional operations to extract meaningful

 features from the input data. CNNs exhibit remarkable effectiveness in tasks like image classification, object detection, and image recognition,

 thanks to their inherent ability to autonomously learn hierarchical representations and capture spatial relationships within the data, eliminating

 the need for explicit feature engineering.

 

Q47. Explain the purpose of data cleaning

Data cleaning’s primary goal is to rectify or eliminate inaccurate, corrupted, improperly formatted, duplicate, or incomplete data from a dataset. 

This often yields better outcomes and a higher return on investment for marketing and communications efforts.

 

Q48. Why is R used in Data Visualization?

R is widely used in Data Visualizations for the following reasons-

· We can create almost any type of graph using R.

· R has multiple libraries like lattice, ggplot2, leaflet, etc., and so many inbuilt functions as well.  

· It is easier to customize graphics in R compared to Python.

· R is used in feature engineering and in exploratory data analysis as well.

 

Q49. What are univariate, bivariate and multivariate analysis?

Three types of analysis are univariate, bivariate and multivariate.

· Univariate analysis includes descriptive statistical analysis techniques which you can differentiate on the

 basis of how many variables are involved. Some pie charts can have a single variable.

· Bivariate analysis explains the difference between two variables at one time. This can be analyzing sale volume and spending volume using a scatterplot.

· Multivariate analysis has more than two variables and explains effects of variables on responses.

 

Q50. State any five Deep Learning Frameworks.

Some of the Deep Learning frameworks are:

· Caffe

· Keras

· TensorFlow

· Pytorch

· Chainer

· Microsoft Cognitive Toolkit

 

 

0 comments