Data Science Interview Questions and Answers for Freshers
Data science interview questions with clear answers on statistics, probability, pandas, EDA, ML basics and case studies, plus runnable practice code.
Remember your college practical viva? The examiner already knew the answer to "why did you use a 100-ohm resistor here?" They were checking whether you understood the experiment or had copied the readings from a senior's file.
A data science interview is a bigger viva. The interviewer wants to see that you can explain an idea simply, apply it to a messy example, and notice when it might fail.
What do data science interviews test?
Mapping the viva:
- The examiner's "why" questions are the concept questions on statistics and machine learning.
- Asking you to redo a reading is the coding round in Python, pandas or SQL.
- "What if the resistor were 1,000 ohms?" is the case study, where conditions change and you reason aloud.
- Your lab file is your project, which you must defend line by line.
A data science interview evaluates whether you can turn data into correct, explainable decisions, through questions on statistics, data handling, machine learning, business cases and your own projects.
Rounds vary by company, but most fresher loops include a test, a technical round, a case discussion and a project deep dive.
A good spoken answer has three parts: a one-line definition, a small example, and a limitation.
Statistics, probability and A/B testing questions
What is the difference between mean and median, and when would you use each?
The mean is the arithmetic average; the median is the middle value after sorting. The median is robust to outliers, so use it for skewed data such as house prices or delivery times. Show it with numbers:
import numpy as np
monthly_spend = np.array([1800, 2100, 1950, 2300, 2050, 1900, 2200])
with_outlier = np.append(monthly_spend, 95000) # one customer bought a sofa
for name, x in [("Normal month", monthly_spend), ("With one outlier", with_outlier)]:
print(f"{name:17} mean = {x.mean():8.0f} median = {np.median(x):6.0f}")One extra value moves the mean by thousands of rupees while the median barely changes.
What is a p-value?
A p-value is the probability of seeing a result at least as extreme as yours if the null hypothesis were true.
A small p-value, below a threshold such as 0.05 chosen in advance, suggests the data is hard to explain by chance alone. It is not the probability that the null hypothesis is true. The full method is in hypothesis testing.
What is the central limit theorem and why does it matter?
The central limit theorem says that the mean of a large enough random sample is approximately normally distributed, even when the underlying data is not. It matters because it lets us build confidence intervals and run tests on sample means. You can watch it happen:
import numpy as np
rng = np.random.default_rng(0)
# Heavily skewed data: most orders are small, a few are huge
population = rng.exponential(scale=300, size=100_000)
sample_means = np.array([rng.choice(population, 50).mean() for _ in range(2000)])
skew = lambda x: np.mean(((x - x.mean()) / x.std()) ** 3)
print(f"Population skewness: {skew(population):.2f}")
print(f"Sample-mean skewness: {skew(sample_means):.2f} (close to 0 = symmetric)")
print(f"Mean of sample means: {sample_means.mean():.0f} vs population mean {population.mean():.0f}")The raw data is very skewed, yet the sample means are nearly symmetric. More in central limit theorem.
What are Type I and Type II errors?
A Type I error is a false positive: concluding there is an effect when there is none. A Type II error is a false negative: missing a real effect. In fraud detection, Type I blocks a genuine customer and Type II lets fraud through. Lowering one usually raises the other.
Explain conditional probability with an example.
Conditional probability is the chance of an event given that another has happened, written P(A | B). If 2% of all payments are fraud but 30% of payments from brand-new devices are fraud, then P(fraud | new device) = 0.30. This idea is the core of Bayes' theorem.
How would you test whether a new checkout button increases orders?
Run an A/B test. Randomly split users into control and treatment, fix the metric (orders per visitor) and sample size in advance, run for full weeks, then compare with a significance test. Randomisation makes the groups alike in everything except the button. The steps are in A/B testing.
Quick check
A p-value of 0.03 means...
A p-value is computed assuming the null hypothesis is true; it is not the probability that the null is true.
Data handling, pandas and EDA questions
How do you handle missing values?
First find out why they are missing. If values are missing at random and few, dropping rows may be fine. Otherwise impute with the median or mode, use a group-wise fill, or add a "was missing" flag. Never fill before splitting train and test data, or information leaks. More in handling missing data.
What is the difference between loc and iloc in pandas?
loc selects by labels (row index names and column names); iloc selects by integer position. df.loc[5] is the row whose label is 5, while df.iloc[5] is the sixth row, whatever its label. They differ after filtering or sorting, when labels stop matching positions.
Find the top-selling product in each city.
This is a classic pandas coding question. Group, sort and take the first row per group:
import pandas as pd
sales = pd.DataFrame({
"city": ["Indore", "Indore", "Indore", "Bhopal", "Bhopal", "Ujjain", "Ujjain"],
"product": ["Poha mix", "Namkeen", "Tea", "Tea", "Namkeen", "Poha mix", "Tea"],
"units": [540, 610, 320, 450, 300, 210, 260],
})
top = (sales.sort_values("units", ascending=False)
.groupby("city", as_index=False)
.head(1)
.sort_values("city"))
print(top.to_string(index=False))
# Same answer with idxmax
print(sales.loc[sales.groupby("city")["units"].idxmax()].to_string(index=False))Interviewers also ask for the SQL version, which uses ROW_NUMBER() over a window; see SQL interview questions.
What is the first thing you do with a new dataset?
Check shape, column types, missing values, duplicates and summary statistics, confirm what one row represents, then plot key columns. This is exploratory data analysis.
Quick check
Orders dropped sharply yesterday. What should you check first?
Many sudden drops are data problems, so verify the data before analysing customer behaviour.
Machine learning basics questions
What is overfitting and how do you prevent it?
Overfitting is when a model learns noise in the training data and performs much worse on new data. Prevent it with more data, simpler models, regularisation, cross-validation and early stopping. A large gap between training and test scores is the warning sign.
Why is accuracy misleading on imbalanced data?
If 98% of payments are genuine, a model that always predicts "genuine" scores 98% accuracy while catching zero fraud. Use precision, recall, F1 or PR-AUC instead, and pick the metric that matches the cost of each error type.
What is data leakage?
Leakage is when information that would not be available at prediction time sneaks into training, making the model look better than it is. Examples include scaling on the full dataset before splitting, or using a "refund issued" column to predict fraud. Deeper model questions are covered in machine learning interview questions.
Case study and project questions
Daily orders dropped 20% yesterday. How would you investigate?
First check the data itself: tracking bugs and delayed pipelines are common. Then compare with the same weekday last week and slice by city, platform, app version and traffic source. Check external causes such as a holiday or outage, then state a hypothesis and how to confirm it.
Walk me through your best project.
In two minutes: the question, the data and cleaning, the baseline and approach, the result as one number, and one thing you would change. Expect follow-ups on every choice.
How to prepare for a data science interview
- Revise statistics: distributions, tests and confidence intervals.
- Code daily in pandas and SQL, timed.
- Re-explain two projects aloud.
- Practise three case questions with the check, compare, slice, hypothesise pattern.
- Take mock aptitude and coding tests. You can attempt timed data science and aptitude MCQs on Debugshala Test.
For structured mock interviews and placement support, Debugshala's placement-oriented data science programme runs at Old Palasia and online. The learning order behind these topics is in the data scientist roadmap, and portfolio ideas are in data science projects for beginners.
Common interview mistakes
- Reciting definitions without an example. Always follow a definition with a number or a scenario.
- Jumping to a model in case questions. Check the data and the metric first.
- Saying "I used XGBoost" without a baseline. Interviewers want to know what it beat.
Key takeaways
- Fresher interviews focus on statistics, pandas and SQL, ML basics, cases and projects.
- Answer with a definition, an example and a limitation.
- Know mean vs median, p-values, the central limit theorem, error types and A/B testing well.
- In case questions, verify the data before explaining the drop.
- Defend your projects with a baseline and an honest limitations section.
FAQ
What questions are asked in a data science interview for freshers?
Freshers are usually asked about statistics (mean vs median, p-values, distributions), probability, pandas and SQL coding, basic machine learning (overfitting, metrics, leakage), a simple business case, and a deep dive into one project. Many companies also start with an aptitude and coding test.
How should I prepare for a data science interview in one month?
Spend week one on statistics and probability, week two on pandas and SQL, week three on ML concepts and metrics, and week four on case studies and mock interviews. Re-explain your two best projects aloud throughout and take a timed practice test every few days.
Is SQL asked in data science interviews?
Yes, very often. Expect joins, GROUP BY with HAVING, subqueries and window functions such as ROW_NUMBER and RANK. SQL is frequently tested in the first technical round because data scientists use it daily to pull data before analysing it in Python.
Are data science interviews hard for non-IT graduates?
They are manageable with preparation. Interviewers mainly test reasoning, statistics and clear communication, which non-IT graduates can learn. Strong, original projects and confident explanations often matter more than the degree. Practising coding questions regularly closes the gap on the technical rounds.
Does Debugshala in Indore help with data science interview preparation?
Yes. Debugshala's Data Science & AI course at Old Palasia, Indore, and online offers placement assistance, and the Debugshala Test platform has aptitude, reasoning and coding quizzes for practice. You can attend a free demo class before paying. Call +91-8982385539 or email info@debugshala.com for details.
From the team behind this site
Go further with the Data Science & AI Course at Debugshala
These tutorials are written by Debugshala, a training and placement institute at Old Palasia, Indore. The classroom course adds live mentoring, real projects and interview preparation.
- Offline classes at Old Palasia, Indore
- Free demo class before you pay
- Non-IT, fresher and year-gap friendly
- Placement assistance
700+ students placed · 200+ hiring partners · 4.9★ Google rating