Quick answer: These 49 Data Science interview questions and answers cover what is asked most in data scientist, data analyst and business analyst interviews: data science basics, statistics and probability, data cleaning and EDA, Python with pandas and NumPy, machine learning, SQL and big data, and communication and case questions. Key answers include short code examples.
Read each answer, then close the page and explain it aloud in two or three sentences. That is exactly what interviewers check.
Contents
- Data Science Basics
- Statistics and Probability
- Data Cleaning and EDA
- Python, pandas and NumPy
- Machine Learning for Data Science
- SQL and Big Data for Data Science
- Communication and Case Questions
- How to prepare
- FAQs
1. Data Science Basics Interview Questions
Q1. What is data science?
Data science uses statistics, programming and domain knowledge to collect, clean, analyse and model data in order to answer questions and support decisions. It combines data analysis, machine learning and communication of results.
Q2. What is the difference between data science, data analytics and machine learning?
Data analytics mainly describes what happened using reports and dashboards. Data science covers the full process, including predictive modelling and experiments. Machine learning is one toolset inside data science for building predictive models.
Q3. What is the data science life cycle?
Understand the business problem, collect data, clean and prepare it, explore it (EDA), engineer features, build and evaluate models, communicate insights, deploy the solution and monitor it.
Q4. What is the difference between structured and unstructured data?
Structured data fits into rows and columns, such as sales tables. Unstructured data has no fixed format, such as text, images, audio and video. Semi-structured data, such as JSON and XML, has some organisation through tags or keys.
Q5. What does a data scientist do day to day?
Most time goes into understanding the problem, writing SQL and Python to get and clean data, exploring it, building and validating models, and explaining results to stakeholders through charts and short reports.
2. Statistics and Probability Interview Questions
Q6. What is the difference between mean, median and mode?
The mean is the average, the median is the middle value when data is sorted, and the mode is the most frequent value. The median is better than the mean for skewed data such as salaries, because extreme values do not pull it.
Q7. What are variance and standard deviation?
Variance is the average squared distance of values from the mean. Standard deviation is its square root and is in the same unit as the data, so it is easier to interpret as typical spread.
Q8. What is a normal distribution?
A normal distribution is a symmetric bell-shaped curve where mean, median and mode are equal. About 68% of values lie within one standard deviation of the mean, 95% within two and 99.7% within three.
Q9. What is the Central Limit Theorem?
The Central Limit Theorem says that the distribution of sample means approaches a normal distribution as the sample size grows, whatever the shape of the original data. This is why we can use normal-based confidence intervals and tests for averages.
Q10. What are skewness and kurtosis?
Skewness measures asymmetry: right (positive) skew has a long tail to the right, as in income data. Kurtosis measures how heavy the tails are compared with a normal distribution.
Q11. What is the difference between correlation and causation?
Correlation means two variables move together. Causation means one actually causes the other. Ice-cream sales and drowning cases are correlated because both rise in summer, but one does not cause the other. Only controlled experiments can establish causation reliably.
Q12. What is the difference between covariance and correlation?
Covariance shows the direction of the relationship but depends on the units. Correlation is covariance scaled to between −1 and 1, so it also shows strength and can be compared across variables.
Q13. What is a p-value?
The p-value is the probability of seeing results at least as extreme as the observed ones if the null hypothesis were true. A small p-value, commonly below 0.05, suggests the data is unlikely under the null hypothesis, so we reject it.
Q14. What are Type I and Type II errors?
A Type I error (false positive) rejects a true null hypothesis. A Type II error (false negative) fails to reject a false null hypothesis. Lowering one usually raises the other unless the sample size increases.
Q15. What is a confidence interval?
A 95% confidence interval is a range built so that, if we repeated the sampling many times, 95% of such intervals would contain the true value. A narrower interval means a more precise estimate.
Q16. What is A/B testing?
A/B testing randomly splits users into two groups, shows each a different version (for example two website designs), and uses a statistical test to check whether the difference in a metric such as conversion rate is significant and not due to chance.
Q17. What is Bayes' theorem?
Bayes' theorem updates the probability of an event using new evidence: P(A|B) = P(B|A) × P(A) / P(B). It is used in spam filters, medical test interpretation and Naive Bayes classifiers.
Q18. What are the common sampling methods?
Simple random sampling, stratified sampling (sampling from each subgroup in proportion), cluster sampling (sampling whole groups) and systematic sampling (every k-th item). Stratified sampling is useful when classes are imbalanced.
3. Data Cleaning and EDA Interview Questions
Q19. What is exploratory data analysis (EDA)?
EDA is the first look at the data to understand its structure, spot errors, missing values and outliers, and find patterns, using summary statistics and charts such as histograms, box plots and scatter plots.
Q20. How do you detect and treat outliers?
Detect them with box plots, the IQR rule (below Q1 − 1.5×IQR or above Q3 + 1.5×IQR) or z-scores above 3. Then check whether they are errors (fix or remove) or genuine extreme values (keep, cap, or transform with a log).
Q1, Q3 = df['salary'].quantile([0.25, 0.75])
IQR = Q3 - Q1
outliers = df[(df['salary'] < Q1 - 1.5*IQR) | (df['salary'] > Q3 + 1.5*IQR)]Q21. How do you handle missing data?
First find why it is missing. Then drop rows or columns if very little is lost, fill with the mean, median or mode, forward-fill for time series, or use model-based imputation. Always fit the imputation on training data only.
Q22. How do you handle duplicate records in pandas?
Find them with duplicated() and remove them with drop_duplicates(), choosing which columns define a duplicate.
print(df.duplicated(subset=['email']).sum())
df = df.drop_duplicates(subset=['email'], keep='first')Q23. Which charts would you use for different data?
Histogram or box plot for the distribution of one number, bar chart for categories, line chart for trends over time, scatter plot for the relationship between two numbers, and a heatmap for a correlation matrix.
Q24. What is the difference between normalisation and standardisation?
Normalisation (min-max) rescales values to a fixed range, usually 0 to 1. Standardisation (z-score) rescales to mean 0 and standard deviation 1 and is less affected by outliers.
4. Python, pandas and NumPy Interview Questions
Q25. Why is Python popular for data science?
Python is easy to read and has a rich ecosystem: pandas for tables, NumPy for numbers, Matplotlib and Seaborn for charts, scikit-learn for machine learning, and TensorFlow or PyTorch for deep learning.
Q26. What is the difference between a pandas Series and a DataFrame?
A Series is a single labelled column of data. A DataFrame is a two-dimensional table made of several Series that share an index.
Q27. What is the difference between loc and iloc?
loc selects by labels (row index labels and column names). iloc selects by integer positions.
df.loc[df['city'] == 'Hyderabad', ['name', 'salary']]
df.iloc[0:5, 0:3]Q28. How do you group and aggregate data in pandas?
Use groupby with agg to calculate statistics per group, similar to SQL GROUP BY.
summary = df.groupby('dept').agg(
staff=('emp_id', 'count'),
avg_salary=('salary', 'mean'))Q29. What is the difference between merge, join and concat in pandas?
merge combines DataFrames on common columns like an SQL join. join combines on the index. concat stacks DataFrames vertically or horizontally without matching keys.
Q30. Why is NumPy faster than Python lists?
NumPy stores data in fixed-type contiguous memory and performs vectorised operations in optimised C code, so it avoids slow Python loops and uses less memory.
Q31. What is vectorisation?
Vectorisation means applying an operation to a whole array at once instead of looping over elements, for example df['total'] = df['price'] * df['qty']. It is much faster and cleaner than a for loop.
Q32. How do you handle dates in pandas?
Convert text to datetime with pd.to_datetime, then use the .dt accessor to extract year, month or weekday, and group by period for monthly totals.
df['date'] = pd.to_datetime(df['date'])
df['month'] = df['date'].dt.month
monthly = df.groupby(df['date'].dt.to_period('M'))['sales'].sum()5. Machine Learning for Data Science Interview Questions
Q33. How do you choose a model for a data science problem?
Identify whether it is regression, classification, clustering or forecasting. Start with a simple baseline such as linear or logistic regression, then try tree-based models such as random forest or gradient boosting for tabular data, and compare them with cross-validation.
Q34. What is overfitting and how do you prevent it?
Overfitting means a model memorises the training data and performs poorly on new data. Prevent it with more data, simpler models, regularisation, cross-validation, early stopping and feature selection.
Q35. What metrics do you use for classification and regression?
Classification: accuracy, precision, recall, F1-score, ROC-AUC and the confusion matrix. Regression: MAE, RMSE and R-squared. Choose the metric that matches the business cost of errors.
Q36. What is feature selection and why is it useful?
Feature selection keeps only useful features, using correlation, statistical tests, model feature importance or methods such as Lasso and recursive feature elimination. It reduces overfitting, speeds up training and makes models easier to explain.
Q37. What is time series forecasting?
Time series forecasting predicts future values from past values ordered in time, such as monthly sales. Important ideas are trend, seasonality and stationarity. Common methods are moving averages, ARIMA, exponential smoothing, Prophet and gradient boosting with lag features.
Q38. What is the difference between a training error and a test error?
Training error is measured on data the model learnt from; test error on unseen data. A large gap with low training error means overfitting; both being high means underfitting.
6. SQL and Big Data for Data Science Interview Questions
Q39. Why is SQL important for a data scientist?
Most company data lives in relational databases, so data scientists use SQL every day to filter, join and aggregate data before analysis. Joins, GROUP BY, subqueries and window functions are the most used features.
Q40. Write a query to find the top 5 customers by total purchase.
Group orders by customer, sum the amount, sort and limit.
SELECT customer_id, SUM(amount) AS total
FROM orders
GROUP BY customer_id
ORDER BY total DESC
LIMIT 5;Q41. What is big data and what are its 3 Vs?
Big data is data too large or fast for traditional tools. Its three Vs are volume (size), velocity (speed of arrival) and variety (different formats). Veracity and value are often added.
Q42. What are Hadoop and Spark?
Hadoop stores and processes huge datasets across many machines using HDFS and MapReduce. Apache Spark processes data in memory, so it is much faster, and it supports SQL, streaming and machine learning through PySpark.
Q43. What is a data warehouse and what is a data lake?
A data warehouse stores cleaned, structured data organised for reporting and analytics. A data lake stores raw data of any type in its original form, to be processed later as needed.
Q44. What is ETL?
ETL stands for Extract, Transform, Load: data is pulled from sources, cleaned and reshaped, and loaded into a warehouse. In ELT, raw data is loaded first and transformed inside the warehouse.
7. Communication and Case Questions Interview Questions
Q45. How do you explain a technical result to a non-technical manager?
Start with the business answer, use one clear chart, avoid jargon, quantify the impact in money or time, state the main limitation, and end with a recommended action.
Q46. How would you measure the success of a new app feature?
Define a primary metric linked to the goal, such as daily active users or conversion, plus guardrail metrics such as crash rate. Run an A/B test, check statistical significance and look at results for different user segments.
Q47. Sales dropped 20% last month. How would you investigate?
Confirm the data is correct, then break the drop down by region, product, channel and customer type, compare with the same month last year for seasonality, and check events such as price changes, stock issues, competitor offers or website problems.
Q48. What is a KPI?
A Key Performance Indicator is a measurable value that shows progress towards a business goal, such as monthly revenue, churn rate or average delivery time.
Q49. Tell me about a data science project you have done.
Explain the business problem, the data and its size, cleaning and EDA findings, the features and models you tried, the metric and final result, and the impact or next steps. Mention one challenge and how you solved it.
How to Prepare for a Data Science Interview
- Master statistics: distributions, hypothesis testing, p-values and A/B tests are asked everywhere.
- Practise SQL and pandas daily: joins, group by and window functions on real datasets.
- Tell stories with data: every analysis should end with a clear business recommendation.
- Prepare case questions: practise breaking down problems such as a sudden drop in sales.
- Show a portfolio: two or three end-to-end projects on GitHub with clear write-ups.
Next steps: revise SQL interview questions and Python interview questions, and build portfolio work from our data science projects.
More interview preparation: see all interview questions, including Python, SQL, SQL query, Java, JavaScript, React, C++, .NET, Spring Boot, Node.js, DSA, OOPs, DBMS, operating system, networking, machine learning, data science, AI, Excel, Power BI, DevOps, manual testing, Selenium, cyber security and HR.
Frequently Asked Questions
Which topics should freshers focus on for data science interviews?
Statistics (distributions, hypothesis testing, p-values), SQL, pandas, EDA, the main ML algorithms and evaluation metrics, plus one or two projects you can explain clearly.
Is coding tested in data science interviews?
Yes. Expect SQL queries and Python or pandas tasks such as cleaning data, grouping and merging. Some companies also ask simple algorithm questions.
What is the difference between a data analyst and a data scientist interview?
Data analyst interviews focus on SQL, Excel, dashboards and business questions. Data scientist interviews add statistics, machine learning and experiment design.
How can I build a data science portfolio?
Pick two or three real datasets, complete end-to-end projects with EDA, modelling and clear conclusions, and publish them on GitHub with a short write-up of what you found.