McKinsey & Company Data Science Interview Questions & Answers
Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About McKinsey & Company hiring for Data Science roles
McKinsey & Company is a global management consulting firm that advises companies, governments and institutions on strategy, operations, technology and organisation. In India it has client service offices as well as large knowledge and capability centres that support consultants worldwide with research, analytics and digital work. It hires business analysts, research analysts, data scientists and software engineers in India.
For Data Science roles, this McKinsey & Company practice set focuses most on Feature Engineering (7), Machine Learning (6), Time Series & Forecasting (6), SQL for Data Science (5). It has 3 easy, 31 medium, 6 hard questions, so you can start easy and work up to the harder ones.
Company type
Consulting
Headquarters
New York, USA
Main India offices
Gurugram, Mumbai, Bengaluru, Chennai
McKinsey & Company Data Science interview process
Online problem-solving assessment or game-based test
Case interview round 1
Case interview round 2 with personal experience questions
Final partner round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for McKinsey & CompanyStart 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
How do you turn text columns into features for a tabular model?
Simple options are length, word count and keyword flags. TF-IDF vectors capture important words and work well with linear models. For meaning, use sentence embeddings from a pretrained model and optionally reduce them with PCA. You can also train a separate text classifier and feed its predicted score as one feature. Fit any vocabulary or encoder on training data only to avoid leakage.
Roll back immediately to the previous registry version through the deployment pipeline, rather than editing servers by hand, and confirm metrics recover. Then investigate offline: compare predictions of both versions on the same traffic, check feature pipelines and data changes, and review what the offline evaluation missed. Add the failing cases to the test set, and use canary or shadow rollout with alert thresholds for future releases.
04
What is MAPE and when is it a poor metric for forecast accuracy?
MAPE is the mean of absolute errors divided by actual values, expressed as a percentage. It is easy to explain to business teams, but it breaks when actuals are zero or near zero, because the percentage explodes. It also penalises over-forecasts more than under-forecasts and weights small items heavily. For intermittent or low-volume series prefer MAE, weighted MAPE or MASE, which compares error to a naive baseline.
05
What are heterogeneous treatment effects, and what are the risks of slicing results by segment?
Heterogeneous treatment effects mean the change helps some segments more than others, for example new users but not repeat users. Finding them can guide targeting. The risk is that slicing by many segments creates false discoveries, and each segment has less power, so differences may be noise. Pre-register key segments, correct for multiple comparisons, and validate any surprising segment effect in a follow-up test before acting on it.
06
Tree feature importance ranks an ID-like numeric column near the top. Why, and which importance method would you trust instead?
Impurity-based importance, the default in tree models, sums how much each feature reduces impurity across splits. It is fast but biased toward high-cardinality and continuous features, and it is computed on training data. Permutation importance shuffles one feature at a time on validation data and measures the drop in score, so it reflects real predictive value. Both can understate correlated features, because the model can lean on the copy.
07
How do you make a machine learning experiment reproducible?
Version the code with Git, the data with a tool like DVC or dated snapshots, and the environment with pinned requirements or Docker. Set random seeds for every library. Log parameters, metrics and the exact data version for each run with a tracker like MLflow. Keep preprocessing inside a pipeline rather than manual notebook steps. Then anyone should be able to rebuild the same model from a commit and a data version.
Differencing replaces each value with the change from the previous value: y_t minus y_(t-1). It removes a linear trend and often makes a series stationary. Seasonal differencing subtracts the value one season back, such as y_t minus y_(t-7) for daily data with a weekly cycle. Avoid over-differencing, because it adds noise and negative autocorrelation. In ARIMA, the d parameter is the number of times you difference.
09
What is a prediction interval and why should a forecast include one?
A prediction interval gives a range in which a future value is expected to fall with a stated probability, such as 80 or 95 percent. A point forecast of 1,000 units means little without knowing whether the realistic range is 950 to 1,050 or 400 to 1,600. Planners use the interval to set safety stock and staffing. Intervals widen with the horizon because uncertainty accumulates over time.
10
Your SQL result does not match the number on the official dashboard. How do you resolve it?
I would first align definitions: date range, time zone, filters like test users or cancelled orders, and whether the metric counts users or events. Then compare at a smaller grain, by day or by city, to find where the gap starts. I would read the dashboard's underlying query and check data refresh times. Once found, I would document the agreed definition so the same mismatch does not repeat.
11
What is DBSCAN and when is it better than K-means?
DBSCAN is a density-based clustering algorithm. It groups points that have at least min_samples neighbours within distance eps, and marks isolated points as noise. Unlike K-means, it does not need the number of clusters, finds clusters of any shape, and handles outliers. It struggles when clusters have very different densities and in high dimensions. It suits location data, like finding delivery hotspots from GPS points.
12
You target-encoded a city column and validation AUC jumped from 0.72 to 0.95. What do you suspect?
Target encoding replaces each category with the average target value for that category, for example the churn rate per city. It handles high-cardinality columns compactly. The main risk is leakage: if a row's own target is included in its encoding, the model sees the answer and overfits. Prevent it with out-of-fold encoding, smoothing toward the global mean for rare categories, and fitting only on training data.
13
Halfway through a test you discover a bug that broke the treatment for Android users. What do you do?
Stop or pause the affected part, fix the bug and restart the test with fresh data, since mixing broken and fixed periods biases results. Do not simply drop Android users from analysis afterwards, because that can break randomisation balance if the bug affected behaviour or logging. Document the incident, and add pre-launch checks such as running the variant through QA on every platform and monitoring guardrails in the first hours.
14
Write Python code to compute the haversine distance between customer and store locations.
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data.
The probability of seeing a result at least as extreme as the observed one if the null hypothesis were true. A small p-value is evidence against the null, not proof that the alternative is true.
17
A query on a 200 million row table takes 20 minutes. How do you speed it up?
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
Tell me about a time your analysis contradicted what leadership expected.
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.
19
Write SQL to compute a 7-day rolling average of daily active users.
WITH daily AS (
SELECT activity_date, COUNT(DISTINCT user_id) AS dau
FROM events
GROUP BY activity_date
)
SELECT activity_date, dau,
AVG(dau) OVER (ORDER BY activity_date
ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS dau_7d_avg
FROM daily
ORDER BY activity_date;
20
Tell me about a GenAI project you built and what you learned from it.
Situation: our HR team answered the same leave and policy questions daily. Task: build an internal assistant in six weeks. Action: I built a RAG pipeline over policy PDFs, added citations, created a 150-question evaluation set with HR, and iterated on chunking and reranking. Result: answer accuracy reached 91 percent and HR queries dropped by 40 percent. I learned that the evaluation set mattered more than the choice of model.
21
After one-hot encoding you have 2,000 features and training is slow. What do you do?
Find which columns caused the explosion, usually a few high-cardinality categoricals. Group rare categories into Other, or switch those columns to frequency, target or hashing encoding. Use sparse matrices so zeros take no memory. Tree libraries like LightGBM and CatBoost can handle categoricals natively without one-hot. Then remove near-constant columns and check that validation scores hold up with the smaller feature set.
22
Tell me about a time your forecast was badly wrong. How did you handle it?
Situation: my weekly demand forecast under-predicted a category by 30 percent for a month. Task: explain the miss and stop it recurring. Action: I compared forecast and actuals by region and found a new distribution channel had launched that the model knew nothing about. I told the planning team quickly, added channel as a feature and set up a weekly error review. Result: error returned to normal and planners trusted the alerts.
23
Write SQL to compute a running total of spend for each user.
SELECT user_id, order_date, amount,
SUM(amount) OVER (
PARTITION BY user_id
ORDER BY order_date
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_spend
FROM orders
ORDER BY user_id, order_date;
24
What is the difference between bagging and boosting?
Bagging trains models in parallel on bootstrap samples and averages them (reduces variance, e.g. Random Forest). Boosting trains models one after another, each fixing the previous errors (reduces bias, e.g. XGBoost).
25
Your image classifier trained on 2,000 images memorises the training set within 5 epochs. What do you try?
With so little data, I would use transfer learning from a pretrained model like ResNet or EfficientNet and fine-tune only the top layers first. I would add data augmentation such as flips, crops and colour changes, use dropout and weight decay, and apply early stopping on validation loss. Collecting more labelled images or using a smaller model also helps. I would check for duplicate images across train and validation sets too.
26
Write Python code to evaluate a forecasting model with expanding-window time series cross-validation.
import numpy as np
from sklearn.model_selection import TimeSeriesSplit
from sklearn.metrics import mean_absolute_error
tscv = TimeSeriesSplit(n_splits=5, test_size=28)
scores = []
for tr, te in tscv.split(X):
model.fit(X.iloc[tr], y.iloc[tr])
pred = model.predict(X.iloc[te])
scores.append(mean_absolute_error(y.iloc[te], pred))
print(np.mean(scores), scores)
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.
It predicts from the k nearest labelled points. It is simple but slow at prediction time, sensitive to scaling and irrelevant features, and weak in high dimensions.
It checks whether observed category counts differ from expected counts, used for independence between two categorical variables and for goodness of fit.
30
Write Pandas code to read a large CSV in chunks and compute total sales per city.
# process 1 million rows at a time
import pandas as pd
totals = {}
for chunk in pd.read_csv('sales.csv', usecols=['city', 'amount'], chunksize=1_000_000):
part = chunk.groupby('city')['amount'].sum()
for city, amt in part.items():
totals[city] = totals.get(city, 0) + amt
result = pd.Series(totals).sort_values(ascending=False)
31
Write a scikit-learn ColumnTransformer that preprocesses numeric and categorical columns.
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.
33
A new checkout converts better on both mobile and desktop, but worse overall. How is that possible?
Simpson's paradox happens when a trend in several groups reverses when the groups are combined. Example: a new checkout converts better on both mobile and desktop, but worse overall, because most of its traffic came from mobile, which has lower conversion anyway. The mix of groups, not the treatment, drives the total. The lesson is to check segment-level results and confounding variables before drawing conclusions from aggregated numbers.
34
For a warehouse, a stockout costs five times more than holding extra stock. How should the forecast change?
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.
35
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.
36
What is gradient descent and what does the learning rate do?
An optimisation method that updates weights in the opposite direction of the loss gradient. The learning rate sets the step size: too high and it diverges, too low and it is slow. Variants include SGD, mini-batch and Adam.
Gradients shrink as they pass through many layers (for example with sigmoid), so early layers barely learn. ReLU, residual connections and good initialisation help.
38
Describe a time you had to push back on or prioritise many ad-hoc data requests.
Situation: as the only analyst for three teams, I received 15 ad-hoc SQL requests a week and my model work stalled. Task: protect focus without upsetting stakeholders. Action: I grouped requests, built a self-serve dashboard covering the 5 most common questions, and set up a simple weekly priority review with the managers. Result: ad-hoc requests dropped by 60 percent and the model shipped a month later as planned.
39
Write a Python function to compute IoU between two bounding boxes given as (x1, y1, x2, y2).
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.
Tips to crack the McKinsey & Company Data Science interview
Practise structured case interviews out loud, focusing on breaking problems into clear parts and doing quick mental arithmetic accurately.
Prepare detailed personal stories on leadership, impact and handling conflict, since McKinsey asks probing follow-up questions on each story.
For analytics roles, revise SQL, Python and statistics along with case skills, because both are often tested together.
Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
Practise the hard questions on this page aloud; McKinsey & Company interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the McKinsey & Company Data Science interview?
Candidates usually go through 4 stages: Online problem-solving assessment or game-based test; Case interview round 1; Case interview round 2 with personal experience questions; Final partner round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.
Which topics should I prepare for the McKinsey & Company Data Science interview?
This practice set leans on Feature Engineering (7), Machine Learning (6), Time Series & Forecasting (6), SQL for Data Science (5). Revise those first, then practise explaining one or two of your own projects end to end, because most McKinsey & Company interviewers ask you to walk through real work.
Are these the exact questions asked at McKinsey & Company?
No. These are curated practice questions that match the skills and difficulty usually tested in consulting interviews like McKinsey & Company's. They are not a leaked or verified list of past questions.
Where does McKinsey & Company hire Data Science professionals in India?
McKinsey & Company has large teams in Gurugram, Mumbai, Bengaluru, Chennai. Openings and locations change often, so check the McKinsey & Company careers page and filter by city and experience.