Skip to content

Data Science Interview Questions for 10 Years Experience

40 questions with answers for candidates with 10+ years of experience — 10 medium, 30 hard.

What interviewers expect: 10 years experience

With ten or more years, interviews are for principal, head or director roles. Focus moves to strategy, organisation design, hiring, budgets and executive communication, with enough technical depth to challenge designs and spot risks. Expect discussions on AI strategy, build versus buy decisions, measuring return on investment and leading change across business units.

This set is weighted towards Machine Learning (6), MLOps and Model Deployment (6), A/B Testing & Experimentation (5), Generative AI and LLMs (4).

AI strategy and ROI Organisation design Executive communication Build versus buy decisions
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.
3 questions free Unlock the rest in seconds
01

Which activation functions do you know and when to use them?

Save to ▾
Show answer
ReLU for hidden layers, sigmoid for binary outputs, softmax for multi-class outputs and tanh when zero-centred outputs help; Leaky ReLU avoids dead neurons.
02

Why is XGBoost so popular?

Save to ▾
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data.
03

Most of your products sell zero units on most days, with occasional sales. Which forecasting approach suits this?

Save to ▾
Show answer
This is intermittent demand, and standard models like ARIMA forecast a small constant that is useless for stocking. Croston's method and its SBA variant forecast the size of non-zero demand and the interval between sales separately. Alternatives are aggregating to weekly level, or using a global gradient boosting model with Tweedie or Poisson loss. Evaluate with MAE or MASE, not MAPE, because zero actuals break percentage errors.
04

What is LoRA and parameter-efficient fine-tuning?

Save to ▾
Show answer
Parameter-efficient fine-tuning updates only a small number of parameters instead of the whole model. LoRA freezes the original weights and adds small low-rank matrices to selected layers, often attention projections, training under 1 percent of parameters. This cuts GPU memory and storage, and many task adapters can share one base model. QLoRA goes further by loading the base model in 4-bit precision. Quality is usually close to full fine-tuning.
05

What are anchor boxes, and why have anchor-free detectors become popular?

Save to ▾
Show answer
Anchor boxes are predefined boxes of several sizes and aspect ratios placed at each grid location; the detector predicts offsets from them and a class score. They need careful tuning to match object shapes in your data and create many redundant predictions. Anchor-free detectors, such as FCOS-style or centre-point methods, predict object centres and box sizes directly. They have fewer hyperparameters, generalise better to unusual shapes and simplify the pipeline.
06

How do transformers differ from RNNs?

Save to ▾
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs.
07

For a warehouse, a stockout costs five times more than holding extra stock. How should the forecast change?

Save to ▾
Show answer
A forecast of the mean is the wrong target when costs are asymmetric. Forecast a quantile instead. The optimal quantile here is about 5 divided by 5 plus 1, roughly the 83rd percentile, which is the newsvendor critical ratio. Train with quantile or pinball loss, or use prediction intervals from a probabilistic model. Evaluate with pinball loss and the actual stockout and holding cost, not just MAE.
08

Tell me about a time you disagreed with a stakeholder about which metric to optimise.

Save to ▾
Show answer
Situation: marketing wanted the lead model judged on overall accuracy. Task: agree on a metric that matched the goal. Action: I showed that accuracy rewarded predicting no conversion for everyone, then proposed precision in the top 1,000 leads per week, which matched the sales team's call capacity, with a simple chart. Result: they agreed, and the model with the better top-1,000 precision added 18 percent more conversions.
09

How does a multi-armed bandit differ from a classic A/B test?

Save to ▾
Show answer
A classic A/B test splits traffic in fixed proportions until the end, then decides, which is best for learning and clean inference. A multi-armed bandit, such as Thompson sampling, shifts traffic towards better-performing variants as data arrives, reducing the cost of showing a weak variant. Bandits suit short-lived decisions like headlines or promotions. They make unbiased effect estimates and guardrail analysis harder, so they are poor for major product decisions.
10

Your RAG chatbot often answers using the wrong documents. How do you fix it?

Save to ▾
Show answer
First check retrieval on its own with a labelled set of questions, since generation cannot fix bad context. Then improve chunking so passages are self-contained, add metadata filters such as product or date, try a better embedding model, and add hybrid search with keywords. A reranker on the top 20 results often helps most. Also rewrite vague user questions into clearer search queries before retrieval.
11

Every time you rerun yesterday's report, the count of new users changes. What is going on and how do you fix it?

Save to ▾
Show answer
Likely causes are late-arriving events, deduplication running after your query, time zone boundaries or records being updated. First compare runs to see which rows change. Then define the metric on a stable basis: use event time with a fixed cut-off, wait for a data freshness window before publishing, and snapshot the result. Document whether numbers are provisional, and make pipelines idempotent so reruns give the same answer.
12

Pandas: find the top 3 products by revenue in each region.

Save to ▾
Show answer
(df.assign(rev=df.price * df.qty) .groupby(['region', 'product'])['rev'].sum() .reset_index() .sort_values('rev', ascending=False) .groupby('region').head(3))
13

How would you structure a data science codebase so notebooks do not become unmaintainable?

Save to ▾
Show answer
Keep notebooks for exploration and reporting only. Move reusable logic into a Python package with modules for data loading, features, training and evaluation, and import it into notebooks. Keep settings in config files, write unit tests for feature functions, and use pre-commit with a formatter and linter. Track experiments in a tool like MLflow. A clear folder template and code reviews keep the team consistent as the project grows.
14

A feature was launched to all users with no control group. How would you estimate its causal impact?

Save to ▾
Show answer
Without randomisation I would use quasi-experimental methods. Difference-in-differences compares the change in a group that got the feature early with one that did not, if rollout was staggered. Interrupted time series or synthetic control builds a counterfactual from pre-launch trends or similar markets. Regression discontinuity works if eligibility had a cut-off. I would state the assumptions clearly and check them with placebo tests.
15

What is the difference between generative and discriminative models?

Save to ▾
Show answer
Discriminative models learn P(y given x) directly (logistic regression, SVM). Generative models learn the joint P(x, y) and can generate data (Naive Bayes, GANs).
16

After joining orders with a promotions table, total revenue doubled. What went wrong?

Save to ▾
Show answer
The join created duplicate order rows, because some orders match more than one promotion row, so each amount is counted several times. Check by comparing COUNT(*) with COUNT(DISTINCT order_id) after the join. Fix it by aggregating the promotions table to one row per order first, picking one promotion with ROW_NUMBER, or summing revenue before the join. Always check row counts after every join.
17

A query on a 200 million row table takes 20 minutes. How do you speed it up?

Save to ▾
Show answer
Start with EXPLAIN to see the plan and find full scans, bad joins or spills. Filter as early as possible and select only needed columns. Make sure the table is partitioned or clustered on the date column and that the query filters on it. Check join keys for type mismatches and duplicates that explode rows. Pre-aggregate into a summary table if the query runs daily, and replace correlated subqueries with joins or window functions.
18

How do you handle personal data when sending customer text to an external LLM API?

Save to ▾
Show answer
First check the data processing agreement, data residency and retention terms, and India's DPDP Act requirements with legal. Minimise what is sent: mask or tokenise names, phone numbers, Aadhaar and card numbers before the call, and restore them afterwards if needed. Use enterprise endpoints with no training on your data, log access, and consider a self-hosted open model for highly sensitive workloads.
19

You need to use a device_id column with millions of unique values in a streaming model. How would feature hashing help?

Save to ▾
Show answer
Feature hashing, the hashing trick, maps categories or tokens into a fixed number of columns using a hash function, without storing a vocabulary. It handles very high-cardinality or ever-changing values, like URLs or device IDs, with constant memory and works well in streaming systems. The trade-off is collisions, where different values share a column, and the features cannot be reversed for explanation. Choose a large enough number of buckets.
20

How do XGBoost, LightGBM and CatBoost differ?

Save to ▾
Show answer
All three are gradient boosting libraries. XGBoost grows trees level by level with strong regularisation and is very mature. LightGBM uses histogram binning and leaf-wise growth, so it is usually fastest on large data but can overfit small data without limits on leaves. CatBoost handles categorical features natively with ordered target statistics and uses symmetric trees, so it gives good results with little tuning. Choice depends on data size, categoricals and latency needs.
21

What is the difference between saving a model with pickle, joblib and ONNX?

Save to ▾
Show answer
pickle serialises Python objects; it is simple but tied to Python and library versions, and loading untrusted pickle files is a security risk. joblib is similar but more efficient for objects with large NumPy arrays, like scikit-learn models. ONNX is an open, language-neutral format that runs in optimised runtimes across languages and hardware, useful for fast serving. Always store library versions alongside pickle or joblib files.
22

What is multicollinearity and how do you handle it?

Save to ▾
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation.
23

You want to test a new pricing algorithm in a two-sided marketplace where buyers and sellers interact. Why is user-level randomisation a problem and what would you do?

Save to ▾
Show answer
Treated and control buyers compete for the same sellers' supply, so a treatment that makes treated buyers buy more takes inventory from control buyers, exaggerating the measured lift. Use designs that limit interference: switchback tests that alternate the whole market between variants over time slots, or randomise by city or region. Analyse at the switch or cluster level with appropriate variance, and accept that these tests need longer to reach power.
24

How do you evaluate a RAG system?

Save to ▾
Show answer
Evaluate retrieval and generation separately. For retrieval, build a set of real questions with known relevant documents and measure recall at k and mean reciprocal rank. For generation, measure faithfulness to retrieved context, answer correctness and relevance, using human review on a sample and an LLM-as-judge with a clear rubric at scale. Track latency and cost too. Rerun the same evaluation set after every change to prompts, chunking or models.
25

What is a sample ratio mismatch in an experiment and what do you do about it?

Save to ▾
Show answer
A sample ratio mismatch means the observed split between groups differs from the planned split, for example 52 to 48 instead of 50 to 50 with a large sample. A chi-square test on the counts confirms it. It usually signals a bug in assignment, redirects, bot filtering or logging, so the results cannot be trusted. Do not analyse the metric; find and fix the root cause and rerun the test.
26

Write Python code to apply a CUPED adjustment using each user's pre-experiment metric.

Save to ▾
Show answer
import numpy as np # df has: variant, y (metric during test), x (same metric pre-test) x, y = df['x'].to_numpy(), df['y'].to_numpy() theta = np.cov(x, y, ddof=1)[0, 1] / np.var(x, ddof=1) df['y_cuped'] = y - theta * (x - x.mean()) print(df.groupby('variant')[['y', 'y_cuped']].agg(['mean', 'var'])) # Means stay comparable; variance of y_cuped is lower
27

Describe a production incident with a model and how you handled it.

Save to ▾
Show answer
Situation: one morning our recommendation model started showing the same five products to all users. Task: restore service and find the cause. Action: I rolled back to the previous model version within 20 minutes, then traced the issue to an upstream table that had arrived empty, so all user features were defaults. Result: we added data volume checks before scoring and a blameless postmortem. Rollback readiness saved us that day.
28

Your GPU model-serving bill has doubled while traffic grew only 20 percent. How do you bring cost down?

Save to ▾
Show answer
Profile utilisation first; idle or under-filled GPUs are common. Enable dynamic batching so each GPU call handles several requests, right-size instance types and autoscale on queue depth rather than CPU. Reduce model cost with quantisation, distillation or a smaller model for easy requests. Cache repeated predictions, move non-urgent work to batch jobs on cheaper hardware, and track cost per thousand predictions as a standing metric.
29

How do you evaluate and explain a model to business stakeholders?

Save to ▾
Show answer
Tie metrics to business outcomes such as cost saved, show feature importance or SHAP values, give example predictions and be transparent about limitations.
30

What is a feature store and what problems does it solve?

Save to ▾
Show answer
A feature store is a central system to define, compute, store and serve features for models. It keeps an offline store for training with point-in-time correct history and an online store for low-latency serving, both fed by the same feature definitions. This prevents training-serving skew, avoids teams rebuilding the same features, and adds documentation and monitoring. It is worth it when many models share features or need real-time serving.
31

How would you convince a planning team that uses spreadsheet moving averages to adopt a new forecasting model?

Save to ▾
Show answer
Situation: planners relied on a 4-week moving average and distrusted models. Task: move them to a better forecast without forcing it. Action: I ran both methods side by side for eight weeks, showed error and stockout cost in rupees, kept their override option and explained forecasts with simple drivers like holidays and price. Result: the model cut error by about 20 percent, planners adopted it category by category, and overrides fell steadily.
32

Write NumPy code for non-maximum suppression on a set of boxes and scores.

Save to ▾
Show answer
import numpy as np def nms(boxes, scores, thr=0.5): x1, y1, x2, y2 = boxes.T areas = (x2 - x1) * (y2 - y1) order = scores.argsort()[::-1] keep = [] while order.size: i = order[0] keep.append(i) w = np.maximum(0, np.minimum(x2[i], x2[order[1:]]) - np.maximum(x1[i], x1[order[1:]])) h = np.maximum(0, np.minimum(y2[i], y2[order[1:]]) - np.maximum(y1[i], y1[order[1:]])) inter = w * h iou = inter / (areas[i] + areas[order[1:]] - inter) order = order[1:][iou < thr] return keep
33

What is SHAP and how does it explain model predictions?

Save to ▾
Show answer
SHAP assigns each feature a contribution to a single prediction based on Shapley values from game theory. The contributions add up to the difference between the prediction and the average prediction. It gives local explanations, like why one loan was rejected, and global views by aggregating values across rows. TreeSHAP is fast for tree models. Limits include slow computation for other models and misleading results when features are strongly correlated.
34

What is PCA and when do you use it?

Save to ▾
Show answer
It projects data onto orthogonal directions of maximum variance to reduce dimensions, remove correlation and speed up models, at some cost of interpretability.
35

Write SQL to compute week-1 retention by signup week.

Save to ▾
Show answer
WITH signups AS ( SELECT user_id, DATE_TRUNC('week', signup_date) AS cohort, signup_date FROM users ), active AS ( SELECT DISTINCT s.user_id, s.cohort FROM signups s JOIN events e ON e.user_id = s.user_id AND e.event_date >= s.signup_date + INTERVAL '7 day' AND e.event_date < s.signup_date + INTERVAL '14 day' ) SELECT s.cohort, COUNT(*) AS users, ROUND(100.0 * COUNT(a.user_id) / COUNT(*), 1) AS week1_retention_pct FROM signups s LEFT JOIN active a ON a.user_id = s.user_id GROUP BY s.cohort ORDER BY s.cohort;
36

Write scikit-learn code to get precision, recall and a confusion matrix at a custom threshold of 0.3.

Save to ▾
Show answer
from sklearn.metrics import confusion_matrix, precision_score, recall_score proba = model.predict_proba(X_test)[:, 1] pred = (proba >= 0.3).astype(int) print(confusion_matrix(y_test, pred)) print('precision', precision_score(y_test, pred)) print('recall', recall_score(y_test, pred))
37

A feature won its A/B test with a 4 percent lift, but after full launch the metric barely moved. Why might that happen?

Save to ▾
Show answer
Several reasons are common. Winner's curse: significant results from underpowered tests tend to overestimate the true effect. Novelty effect faded after launch. Seasonality or other launches changed the baseline, so a before-after comparison is misleading. The test population may differ from all users, for example only one platform. Use a holdout after launch to measure real impact, and run tests with adequate power and duration.
38

What is a contrastive image-text model like CLIP, and how does it enable zero-shot classification?

Save to ▾
Show answer
CLIP trains an image encoder and a text encoder together on hundreds of millions of image-caption pairs, pulling matching pairs close in a shared embedding space and pushing mismatches apart. For zero-shot classification you embed prompts like 'a photo of a damaged parcel' for each class and pick the class whose text embedding is most similar to the image embedding. It works without task-specific training but may need fine-tuning for niche domains.
39

What is the difference between Bayesian and frequentist approaches?

Save to ▾
Show answer
Frequentists treat parameters as fixed and use long-run frequencies; Bayesians treat parameters as distributions updated with data via priors and posteriors, giving direct probability statements.
40

Tell me about a time you stopped a team from shipping a change based on a flawed experiment.

Save to ▾
Show answer
Situation: a team wanted to launch a feature after a test showed a 6 percent lift. Task: as the reviewing data scientist, validate it. Action: I found that assignment was triggered after users clicked into the feature, so treatment had only engaged users. I explained the selection bias simply, proposed assigning at app open, and helped rerun it. Result: the true lift was under 1 percent, and we added assignment checks to the review template.

Frequently asked questions

What is asked in Data Science interviews for 10+ years of experience?

With ten or more years, interviews are for principal, head or director roles. Focus moves to strategy, organisation design, hiring, budgets and executive communication, with enough technical depth to challenge designs and spot risks. Expect discussions on AI strategy, build versus buy decisions, measuring return on investment and leading change across business units.

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 10+ years of experience?

Focus first on AI strategy and ROI, Organisation design, Executive communication, Build versus buy decisions.