Data Science Interview Questions for 3 Years Experience
40 questions with answers for candidates with 3 years of experience — 4 easy, 36 medium.
What interviewers expect: 3 years experience
With three years, interviewers expect independent delivery of production models with measurable impact. They test depth in ML and statistics, experiment pitfalls, monitoring, retraining and MLOps tools, plus GenAI knowledge for many roles. You should explain why you chose methods, what failed and how you handled stakeholders and ambiguous requirements.
This set is weighted towards Machine Learning (7), Deep Learning and NLP (6), Statistics and Probability (6), Computer Vision (5).
Production ML and monitoring Experiment pitfalls GenAI and RAG basics Stakeholder management
Solved at this levelStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks.
During training it randomly switches off a fraction of neurons so the network cannot depend on any single unit, acting as a regulariser against overfitting.
03
Write a Python function to split a long text into overlapping chunks by word count for a RAG index.
Subword tokenisers split text into frequent pieces between characters and full words. Byte Pair Encoding starts from characters and repeatedly merges the most frequent pairs. WordPiece, used by BERT, is similar but chooses merges by likelihood. Rare words like unhappiness become un, happi, ness, so there are no unknown words and the vocabulary stays around 30,000 to 100,000. Token counts also decide LLM cost and context use.
Use the provider's structured output or JSON schema mode when available, which constrains the output to your schema. Otherwise, describe the exact schema in the prompt with an example, and use low temperature. Always parse and validate the response in code, for example with Pydantic, and on failure retry with the error message included. Keep schemas small and flat, and use enums for fields with fixed values.
06
What is the difference between layer normalisation and batch normalisation?
Batch normalisation normalises each feature using the mean and variance across the batch, so it depends on batch size and behaves differently in training and inference. Layer normalisation normalises across the features of each single example, so it works with any batch size and with variable-length sequences. That is why transformers use layer norm, often in the pre-norm position, while CNNs traditionally use batch norm.
Bootstrapping estimates the uncertainty of a statistic by resampling your data with replacement many times, computing the statistic on each resample, and looking at the spread of results. It gives confidence intervals for things with no simple formula, like the median, a ratio or a model metric such as AUC. It needs no normality assumption, but it relies on the sample being representative and can be slow on very large data.
It lets a model weigh which input positions matter most for each output, computing weighted combinations of values from query-key similarity. It is the core of transformers.
Regularization adds a penalty on weights to reduce overfitting. L1 (Lasso) adds |w| and can push features to exactly zero. L2 (Ridge) adds w² and shrinks weights smoothly.
10
Tell me about a computer vision project where data quality was the biggest challenge.
Situation: a shelf-detection model plateaued at low accuracy. Task: find out why and fix it. Action: I reviewed 500 errors and found that a third were labelling mistakes, with inconsistent boxes for partly hidden products. I rewrote the guidelines with visual examples, had a second annotator review hard images and relabelled the worst batch. Result: mAP rose by 9 points without changing the model, and labelling rework dropped sharply.
11
What is normalisation, and why are analytics tables often denormalised?
Normalisation splits data into related tables to remove redundancy, so each fact is stored once, which suits transactional systems with many updates. Analytics workloads mostly read large volumes, and joins across many tables are slow and error-prone. So warehouses often use denormalised, wide tables or star schemas that repeat some attributes. The trade-off is more storage and the need to keep copies consistent through pipelines.
12
Tell me about a time you had to build a model when the requirements were unclear.
Situation: a sales head asked for a model to find good leads but could not define good. Task: turn this into a clear target. Action: I met the team, looked at past deals, and proposed converted within 60 days as the label, with expected revenue as a secondary view. I shared a quick baseline in a week to get feedback. Result: the definition was agreed, and the final model raised conversion in the top decile.
P(A given B) = P(B given A) x P(A) / P(B). In a medical test it converts test accuracy and disease prevalence into the real chance a positive result means disease.
14
What do kernel size, stride and padding mean in a convolution layer?
The kernel is a small learnable filter, such as 3x3, that slides over the image and computes a weighted sum at each position. Stride is how many pixels it moves each step; stride 2 halves the output size. Padding adds border pixels so the output can keep the same size and edge pixels get processed. Output size equals (input minus kernel plus 2 times padding) divided by stride, plus one.
15
The business asks you to pick a decision threshold for a churn model. How do you choose it?
The default 0.5 is rarely right. I would get the cost of each outcome: the value of saving a churner, the cost of a retention offer, and the team's capacity to contact customers. Then I compute expected profit or precision and recall at many thresholds on validation data and pick the one that maximises value within capacity. I would also check that the chosen threshold stays stable over recent months.
16
Write a FastAPI endpoint that serves predictions from a saved scikit-learn model.
The model memorises noise and fails on new data. Prevent it with more data, simpler models, regularisation, cross-validation, early stopping and dropout.
18
Your classifier scores 98 percent on validation, but Grad-CAM shows it focuses on a watermark rather than the object. What is happening?
The model has learned a shortcut: the watermark correlates with the label in your dataset, perhaps because images of one class came from a single source. It will fail when that correlation breaks. Remove or crop the watermarks, rebalance sources across classes, and create a validation set from different sources. Keep using saliency maps and slice-based evaluation to catch other spurious cues such as backgrounds or text.
19
Write Pandas code to create useful features from a datetime column.
An index is a separate sorted structure, usually a B-tree, that lets the database find rows without scanning the whole table, like a book index. It speeds up filters, joins and sorting on the indexed columns. Indexes cost storage and slow down inserts, updates and deletes because each index must be updated. They may be ignored for low-selectivity columns or when a function is applied to the column in WHERE.
22
How does linear regression work and what are its assumptions?
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity.
23
What are interaction features and when do they help?
Interaction features combine two or more variables, such as price times quantity, or income divided by number of dependents. They help linear models capture effects where one variable changes the impact of another. Tree models can learn some interactions themselves, but explicit ratios often still help. Too many automatic interactions explode the feature count and overfit, so build them from domain logic and validate each one.
RNNs process sequences with a hidden state but struggle with long dependencies. LSTMs add gates that control what to remember or forget, easing the vanishing gradient.
25
What are polynomial features and what is the risk of using them?
Polynomial features add powers and products of existing features, like x squared and x times y, so a linear model can fit curves and interactions. The risk is that the number of features grows very fast with degree and input count, causing overfitting, slow training and multicollinearity. Use a low degree, scale features first, and add regularisation such as Ridge or Lasso to keep coefficients under control.
26
What is a t-test and when do you use a paired t-test?
A t-test compares means when the population variance is unknown. A two-sample t-test compares two independent groups, such as users in control and treatment. A paired t-test is used when the same units are measured twice, such as the same students before and after training. Pairing removes variation between individuals, so it is more powerful. Welch's t-test is preferred when the two groups have unequal variances.
27
What is Bayesian A/B testing and how are its results reported?
Bayesian A/B testing starts with a prior on each variant's metric, updates it with observed data and produces a posterior distribution. Instead of a p-value, you report things like the probability that treatment beats control, say 94 percent, and the expected loss if you choose the wrong variant. Business teams find this easier to interpret. Priors must be chosen sensibly, and continuous monitoring still needs discipline about decision rules.
28
Write NumPy code to compute the Dice coefficient between a predicted and a true binary mask.
The warning appears when you assign values to something that may be a copy of a slice instead of the original DataFrame, for example df[df.age > 30]['flag'] = 1. The original may not change. Fix it by using a single .loc call, like df.loc[df.age > 30, 'flag'] = 1, or by taking an explicit .copy() when you really want a separate DataFrame. Copy-on-write in newer Pandas versions makes this behaviour more predictable.
30
Tell me about a time you automated a manual step in a machine learning workflow.
Situation: each monthly retrain needed a day of manual data pulls, notebook runs and copying files to servers. Task: make it reliable and hands-off. Action: I wrapped the steps into a scheduled pipeline with data validation checks, logged runs in MLflow and added an approval step before promotion. Result: retraining time dropped from a day to under an hour of review, and there were no more failed deployments from missed steps.
It applies Bayes' theorem assuming features are independent given the class. The assumption is rarely true but the model is fast and works well for text.
32
What are lambda functions and where are they useful?
Situation: leadership believed a discount campaign drove a sales spike. Task: I was asked to measure its impact. Action: I compared similar regions with and without the campaign and found the spike matched a festival week in both. I shared the method, the charts and the limits openly. Result: they cut the next discount budget by half and moved it to retention. I learned to present surprising results with clear evidence and calm framing.
Recursive feature elimination trains a model, ranks features by importance or coefficient size, removes the weakest ones, and repeats until the desired number remains. RFECV picks the number of features using cross-validation. It considers features together rather than one at a time. The downsides are high compute cost on large data and unstable results when features are correlated, so check stability across folds.
35
Why do residual connections make very deep networks easier to train?
A residual block adds its input to its output, so the layers learn a residual F(x) and the block outputs F(x) plus x. If extra layers are not useful, they can learn to output near zero and the block behaves like identity. The skip path also lets gradients flow directly to early layers, reducing vanishing gradients. This is why ResNets with 50 or 100-plus layers train well where plain deep networks degrade.
36
Training a transformer on a GPU fails with an out-of-memory error. What can you do?
Reduce the batch size and use gradient accumulation to keep the same effective batch. Shorten the maximum sequence length. Turn on mixed precision training with float16 or bfloat16. Use gradient checkpointing, which saves memory by recomputing activations. Freeze some layers or switch to a smaller model, or use parameter-efficient fine-tuning like LoRA. Also make sure no old tensors stay on the GPU between runs.
37
A key metric dropped 8 percent week over week. How do you check whether it is real?
First rule out data issues: tracking changes, pipeline delays, missing partitions or a changed metric definition. Then compare with the same week last year and look for holidays or seasonality. Check normal weekly variation to see if 8 percent is unusual. Break the drop down by platform, region, app version and user type to find where it is concentrated. Finally, check releases, campaigns or outages that happened that week.
I would ask them to wait for the planned duration. Checking early and stopping on the first significant result, called peeking, inflates false positives. Two days also misses weekly patterns and novelty effects, where users click a new feature just because it is new. If speed matters, we can use a sequential testing method designed for early stopping. Otherwise we run the full sample size calculated before launch.
Frequently asked questions
What is asked in Data Science interviews for 3 years of experience?
With three years, interviewers expect independent delivery of production models with measurable impact. They test depth in ML and statistics, experiment pitfalls, monitoring, retraining and MLOps tools, plus GenAI knowledge for many roles. You should explain why you chose methods, what failed and how you handled stakeholders and ambiguous requirements.
How many questions should I practise before a Data Science interview?
Work through all 40 questions here, then the company-wise sets for the employers you are targeting. Quality matters more than count: be able to explain why each answer is right.
Which topics matter most for 3 years of experience?
Focus first on Production ML and monitoring, Experiment pitfalls, GenAI and RAG basics, Stakeholder management.