Data science interviews for freshers usually test Python, SQL, statistics, machine learning basics, project experience and communication.
Below are 21 of the most commonly asked data science interview questions and answers, grouped by topic so you can revise quickly and explain concepts in simple words.
Cracking your first data science interview takes more than memorizing definitions. Recruiters want to see that you understand concepts, can apply them to messy data and can explain your thinking clearly.
Whether you are a graduate, a career switcher or a student of a data science course in Delhi, this guide gives you short, interview-ready answers.
How Do Data Science Interviews Work for Freshers?
Most hiring processes have three to four rounds: an online assessment (Python, SQL, aptitude), a technical interview on statistics and machine learning, a project discussion, and an HR round. Strong fundamentals and a clear portfolio matter more than knowing every algorithm.
Python and SQL Interview Questions
Q 1. What is the difference between a list and a tuple in Python?
Lists are mutable, so you can add, remove or replace elements after creation. Tuples are immutable: their element references cannot be changed after creation. Lists use square brackets, such as [10, 20], while tuples commonly use parentheses, such as (10, 20).
Use a list for changing collections and a tuple for a fixed record, such as coordinates. A tuple can be a dictionary key if all its elements are hashable. A tuple containing a list still allows that inner list to change.
Q 2. How do you handle missing values in Pandas?
First inspect missing values with df.isna().sum() and consider why they are missing. Drop rows when the loss is small and unlikely to bias the analysis. Otherwise, use a suitable imputation method: median for skewed numeric data, mean for roughly symmetric numeric data, or mode for categorical data.
For ordered time-series data, df.ffill() may be appropriate, but it must not cross unrelated groups. Learn imputation values from the training set only, then apply them to validation and test data to prevent data leakage.
Q 3. What is the difference between a NumPy array and a Pandas DataFrame?
A NumPy array is an n-dimensional structure whose elements share one dtype. It supports efficient vectorized operations, especially for numerical calculations; it can also store nonnumeric data.
A Pandas DataFrame is a two-dimensional table with labelled rows and columns, and different columns can have different data types. NumPy is useful for matrix operations, while Pandas is useful for cleaning, joining and summarizing datasets. For example, use a DataFrame for customer names, ages and purchases, and arrays for numerical model inputs.
Q 4. What is the difference between INNER JOIN and LEFT JOIN?
INNER JOIN returns only rows whose join keys match in both tables. LEFT JOIN returns every row from the left table and matching rows from the right; unmatched right-side columns contain NULL. For example, joining customers to orders with INNER JOIN shows customers who have orders, while LEFT JOIN also includes customers without orders.
If one customer has several orders, that customer appears several times. Use INNER JOIN when matches are required and LEFT JOIN when you need to retain the full left-side population.
Q 5. What is the difference between WHERE and HAVING?
WHERE filters individual rows before grouping and aggregation. HAVING filters the groups produced by GROUP BY, often using aggregate conditions. For example, WHERE amount > 100 keeps qualifying transactions, while HAVING SUM(amount) > 1000 keeps customers whose qualifying transactions total more than 1000.
A query can use both clauses: first remove unwanted records with WHERE, then filter the resulting groups with HAVING. Aggregate conditions such as COUNT(*) > 5 generally belong in HAVING rather than WHERE.
Q 6. What are window functions in SQL?
Window functions calculate values across related rows while keeping each original row in the output. OVER defines the window; PARTITION BY separates groups, and ORDER BY sets the order within them.
ROW_NUMBER assigns a unique sequence, RANK gives equal values the same rank with gaps, and LAG retrieves a previous row value. For example, SUM(sales) OVER (PARTITION BY employee_id) adds each employee’s total beside every sales record. Running totals also require ordering and an appropriate window frame.
Statistics Interview Questions
Q 7. When should you use the median instead of the mean?
Use the median when numerical data is skewed or contains extreme values, such as salaries or house prices. The median is the middle value after sorting, so unusually large or small values have less influence on it than on the mean.
For example, for 20, 25, 30, 35 and 200, the median is 30 but the mean is 62. The median better describes a typical value here. For roughly symmetric data without major outliers, the mean is often useful because it incorporates every observation.
Q 8. What is a p-value?
A p-value is the probability, assuming the null hypothesis and the test assumptions are true, of obtaining a test statistic at least as extreme as the observed one. Compare it with a significance level chosen before examining the results, often 0.05. A smaller p-value provides stronger evidence against the null hypothesis.
For example, p = 0.03 is below 0.05, so reject the null at that level. It is not the probability that the null hypothesis is true, and it does not measure effect size or practical importance.
Q 9. What are Type I and Type II errors?
A Type I error is a false positive: rejecting a null hypothesis that is actually true. A Type II error is a false negative: failing to reject a null hypothesis that is false. Suppose the null states that a new teaching method has no effect.
A Type I error claims an effect when none exists; a Type II error misses a real effect. The significance level alpha controls the Type I error rate for a valid test. Statistical power is one minus the Type II error probability and generally improves with larger samples.
Q 10. What is the Central Limit Theorem?
The Central Limit Theorem states that, for independent observations from the same distribution with finite variance, the standardized sample mean approaches a normal distribution as the sample size increases.
It concerns the distribution of means across repeated samples, not the shape of the original observations. For example, individual spending values may be skewed, while averages from sufficiently large samples are approximately normal.
The required sample size depends on skewness and tails; 30 is not a universal guarantee. The theorem helps justify approximate confidence intervals and tests for means.
Q 11. What is the difference between correlation and causation?
Correlation describes an association between variables; causation means that changing one variable produces a change in another. For example, ice-cream sales and drowning incidents may rise together because hot weather increases both.
The association does not show that ice cream causes drowning. Pearson correlation measures linear association, so a value near zero does not rule out a nonlinear relationship. Establishing causation usually requires a well-designed experiment or a careful causal study that addresses confounding, timing and alternative explanations.
Machine Learning Interview Questions
Q 12. What is the difference between supervised and unsupervised learning?
Supervised learning uses labelled examples to learn a mapping from inputs to known targets. Regression predicts a numerical value, such as house price, while classification predicts a category, such as spam or not spam. Unsupervised learning uses data without target labels to discover structure, such as customer clusters or lower-dimensional representations.
For example, predicting whether a customer will leave is supervised learning; grouping customers by purchasing patterns is unsupervised learning. The choice depends on the goal and whether reliable labels are available.
Q 13. What is overfitting and how do you prevent it?
Overfitting occurs when a model learns training-specific patterns or noise and performs poorly on unseen data. A typical sign is very good training performance but noticeably weaker validation performance. Reduce it with regularization, simpler models, more representative training data, tree pruning or early stopping where appropriate.
Cross-validation helps detect overfitting and compare model choices; it does not prevent it by itself. Fit preprocessing only on training data, and keep a separate test set for final evaluation rather than repeatedly tuning against it.
Q 14. What is the bias-variance tradeoff?
Bias is systematic error caused by restrictive assumptions; a high-bias model may miss important patterns and underfit. Variance describes how much the fitted model changes across different training samples; a high-variance model may fit noise and overfit.
For example, a straight line may be too simple for a curved relationship, while a very flexible model may follow random fluctuations. Model complexity and regularization influence this balance. Select them using validation performance, aiming for low error on unseen data; some prediction error remains due to noise.
Q 15. What are precision, recall and F1 score?
Precision is the proportion of predicted positives that are correct: TP / (TP + FP). Recall is the proportion of actual positives detected: TP / (TP + FN). F1 is their harmonic mean: 2 × precision × recall / (precision + recall).
For example, if 10 transactions are flagged, 8 are fraudulent and there are 20 actual frauds, precision is 80% and recall is 40%. Favor recall when missed cases are costly, and precision when false alarms are costly. Choose the decision threshold and metric according to the application.
Q 16. Why is accuracy a poor metric for imbalanced data?
Accuracy can hide poor minority-class performance. If 95% of transactions are genuine, a model that always predicts “genuine” achieves 95% accuracy but detects no fraud. Review the confusion matrix, precision and recall for the positive class, and F1 when both matter.
Precision-recall AUC is particularly useful when positive cases are rare; ROC-AUC also describes ranking performance but may look strong despite many false positives at a chosen threshold. Select metrics and thresholds based on the cost of missed cases and false alarms.
Q 17. How does a Random Forest work?
A Random Forest combines many decision trees. Each tree typically trains on a bootstrap sample of the training rows, and each split considers a random subset of features. For classification, trees vote or their predicted probabilities are averaged; for regression, predictions are averaged.
Combining diverse trees generally reduces variance compared with a single deep tree. Important settings include the number of trees, maximum depth and minimum leaf size. Random Forests capture nonlinear relationships, but they can still overfit and should be evaluated on unseen data.
Q 18. What is cross-validation?
Cross-validation evaluates a model across several train-validation splits. In k-fold cross-validation, divide the data into k folds, train on k minus one folds and validate on the remaining fold, repeating until each fold has been used for validation.
Summarize the scores to assess performance and its variation. Use stratified folds for classification when appropriate, group-aware splits for related records, and time-ordered splits for forecasting. Fit preprocessing inside each training fold to avoid leakage, and retain an untouched test set for final evaluation.
Generative AI and Modern Skills Questions
Q 19. What is a Large Language Model (LLM)?
A Large Language Model is a large neural network trained on extensive text and sometimes other data to model language patterns. Most current LLMs use transformer architectures; many generate text by predicting successive tokens, which can be words or word fragments.
They support tasks such as answering questions, summarizing documents and generating code. The prompt and supplied conversation context guide each response. An LLM can produce convincing but incorrect information, and it does not automatically know private documents or live events without access to suitable retrieval or tools.
Q 20. What is RAG and why is it used?
Retrieval-Augmented Generation combines information retrieval with an LLM. A typical workflow splits documents into chunks, indexes them, retrieves chunks relevant to a question and adds those chunks to the model’s prompt.
The model then answers using that context, often with source references. RAG is useful for organization-specific documents or information updated after model training. It does not retrain the model for each query. It can reduce unsupported answers, but retrieval quality, document freshness and whether the model follows the evidence still determine answer quality.
Project and Portfolio Question
Q 21. Walk me through a data science project you built.
Explain the project in order: the business problem, data source, cleaning, feature preparation, model, evaluation, results and improvements. Describe your own contribution and why you chose the approach.
For example, for a customer-churn project, explain how churn was defined, how you avoided data leakage, why you used a particular train-test split and how the model compared with a simple baseline. Report actual metrics and their limitations; do not invent results. Finish with what you learned and how you would improve or deploy the solution.
How to Prepare in 2 Weeks
● Days 1–4: Revise Python, Pandas and SQL by solving practice problems daily. ● Days 5–8: Review statistics and core machine learning algorithms. ● Days 9–11: Polish 2–3 projects and upload them to GitHub. ● Days 12–14: Take mock interviews and practise explaining concepts aloud in plain language.
Build Interview-Ready Skills with Madrid Software
Practicing questions helps, but hands-on projects and mentor feedback make the real difference. Madrid Software data science course in Delhi covers Python, SQL, machine learning and generative AI with project work and interview preparation. To learn more about available courses, course details, and placement support, contact Madrid Software team.
Frequently Asked Questions
Q. How many data science interview questions should a fresher prepare?
Ans - Preparing around 40–50 core questions can be a useful starting target, but there is no fixed number that guarantees readiness. Cover Python, SQL, statistics, machine learning, data cleaning and your projects.
For each topic, practice explaining the concept, giving an example and answering one follow-up question. Include coding and SQL exercises rather than relying only on memorized definitions. Adjust your preparation to the job description and focus on gaps revealed by mock interviews.
Q. Do freshers need to know deep learning for interviews?
Ans - Many entry-level data science interviews emphasize Python, SQL, statistics and basic machine learning. Deep learning becomes more important for roles involving computer vision, natural language processing or generative AI.
For those roles, learn the basics of neural networks, training and validation, overfitting and common architectures, and be ready to explain a relevant project. Use the job description to decide how deeply to prepare. Strong fundamentals and the ability to explain your work remain valuable across roles.
Q. What is the best way to answer project questions?
Ans - Begin with the problem and why it mattered, then explain the data, your approach, the evaluation metric and the result. Clarify what you personally implemented and explain the reasons behind your choices.
Mention a practical challenge, such as missing values, class imbalance or leakage, and how you handled it. Compare the model with a baseline and state genuine limitations. Prepare both a short overview and a longer version for follow-up questions; clear reasoning matters more than using a complicated algorithm.