Skip to content

Data Science Interview Questions for Consulting Companies

40 questions weighted to the interview style of consulting companies — 7 easy, 31 medium, 2 hard.

How consulting companies interview for Data Science

Consulting firms look for people who can structure messy business problems and explain them simply to clients. Expect case and guesstimate questions, data interpretation, and questions on how you handled stakeholders, along with the technical skills for the role.

This set focuses on Machine Learning (10), Deep Learning and NLP (7), Statistics and Probability (5), Python for Data Science (4).

Technical interview Partner or HR round Managerial round Online assessment (aptitude + technical) HR round
Solved — consulting companiesStart 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

You must classify support messages into 40 categories, but some categories have only 20 examples. What do you do?

Save to ▾
Show answer
Start with a pretrained sentence embedding model plus a simple classifier, or fine-tune a small transformer with class weights. For the rare categories, try few-shot approaches such as SetFit or an LLM with examples in the prompt, and generate or collect more examples. Merge categories that are rarely distinguishable. Report per-class F1 rather than overall accuracy, and route low-confidence predictions to a human queue.
02

Your dataset is highly imbalanced (2% positives). How do you handle it?

Save to ▾
Show answer
Use stratified splits, class weights, resampling (SMOTE or undersampling) and threshold tuning, and judge the model with PR-AUC or F1 instead of accuracy.
03

Why do we use activation functions? Why is ReLU popular?

Save to ▾
Show answer
Activations add non-linearity so networks can learn complex patterns. ReLU (max(0, x)) is cheap and reduces vanishing gradients compared with sigmoid/tanh; Leaky ReLU avoids 'dead' neurons.
04

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))
05

Why are NumPy arrays faster than Python lists?

Save to ▾
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks.
06

Write Python code to run an ADF stationarity test and difference the series if needed.

Save to ▾
Show answer
from statsmodels.tsa.stattools import adfuller def is_stationary(s, alpha=0.05): p_value = adfuller(s.dropna())[1] return p_value < alpha series = s.copy() d = 0 while not is_stationary(series) and d < 2: series = series.diff() d += 1 print('differencing order d =', d)
07

A 10 million row DataFrame with a city column is using too much memory. How can the category dtype help?

Save to ▾
Show answer
The category dtype stores each unique value once and keeps small integer codes for every row. For a column like city with 50 unique values in 10 million rows, this can cut memory by more than 90 percent and speed up groupby and sorting. It helps when a column has low cardinality. It does not help for unique IDs or free text, and adding new categories later needs extra handling.
08

What is the difference between a base model and an instruction-tuned model?

Save to ▾
Show answer
A base model is trained only to predict the next token on large text, so it continues text rather than following requests. An instruction-tuned model is further trained on instruction and answer pairs, and often preference data, so it follows prompts, answers questions and behaves like an assistant. For apps you usually use instruction-tuned or chat models. Base models are mainly starting points for custom fine-tuning.
09

Tell me about a time you chose a simpler model over a more complex one.

Save to ▾
Show answer
Situation: for a credit risk use case, my deep learning model beat logistic regression by only 0.5 AUC points. Task: recommend one for production. Action: I compared explainability, latency, monitoring effort and regulatory needs, and showed the small gain was within noise across folds. Result: we shipped a scorecard-style logistic regression that the risk team could audit. It launched three weeks earlier and was easy to maintain.
10

How would you explain a statistical concept to a non-technical manager?

Save to ▾
Show answer
I start with the decision they care about, not the formula. Once a sales manager asked why a 3 percent lift was not significant. I explained that with only 200 customers, the result could easily happen by chance, like getting 6 heads in 10 coin tosses. I showed a simple range chart of the confidence interval and suggested running the test longer. He agreed, and the extended test gave a clear answer.
11

Write Pandas code to create useful features from a datetime column.

Save to ▾
Show answer
df['ts'] = pd.to_datetime(df['ts']) df['hour'] = df['ts'].dt.hour df['dayofweek'] = df['ts'].dt.dayofweek df['is_weekend'] = df['dayofweek'].isin([5, 6]).astype(int) df['month'] = df['ts'].dt.month df['days_since_signup'] = (df['ts'] - df['signup_date']).dt.days
12

What is the difference between == and is?

Save to ▾
Show answer
== compares values for equality, while is checks whether two names point to the same object in memory. Use is mainly for None checks.
13

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.
14

You are building defect detection for a factory line where only 1 in 1,000 images shows a defect. How do you approach it?

Save to ▾
Show answer
With so few defects, a plain classifier will learn to say no defect. Collect every defect image possible and oversample them or use class-weighted or focal loss. Consider anomaly detection trained only on good parts, which flags anything unusual. Use augmentation that mimics real variation in lighting and position. Evaluate with recall at a fixed false alarm rate, since missing a defect usually costs far more than a manual recheck.
15

What is the Global Interpreter Lock (GIL)?

Save to ▾
Show answer
A mutex in CPython that lets only one thread execute Python bytecode at a time. Use multiprocessing for CPU-bound work and threads or asyncio for I/O-bound work.
16

You added an index but the query is still slow. How do indexes work, and when do they fail to help or even hurt?

Save to ▾
Show answer
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.
17

What is the difference between a star schema and a snowflake schema?

Save to ▾
Show answer
A star schema has a central fact table, like sales with amounts and foreign keys, surrounded by denormalised dimension tables such as product, customer and date. A snowflake schema normalises dimensions further, for example product links to a separate category table. Star schemas need fewer joins and are faster and simpler for analysts. Snowflake schemas save storage and reduce duplication but make queries more complex.
18

Your A/B test shows a significant lift after 2 days. The product team wants to ship now. What do you say?

Save to ▾
Show answer
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.
19

Your training history includes a lockdown period when demand collapsed and then rebounded. How do you treat it?

Save to ▾
Show answer
That period is a structural break, not normal behaviour, and letting a model learn from it raw will distort trend and seasonality. Options are to add an indicator feature so the model attributes the drop to the event, to replace the period with values from a counterfactual estimate, or to train only on data after the recovery if enough history exists. Compare options with backtests on recent normal periods and document the choice.
20

Why is cross-entropy preferred over MSE for classification in neural networks?

Save to ▾
Show answer
Cross-entropy measures how far predicted probabilities are from the true class and strongly penalises confident wrong predictions. With a softmax or sigmoid output, it gives large, useful gradients when the model is wrong. MSE with sigmoid outputs gives very small gradients when predictions saturate, so learning slows down. Use binary cross-entropy for two classes, categorical cross-entropy for many classes, and MSE for regression targets.
21

Random forest vs a single decision tree?

Save to ▾
Show answer
A forest averages many trees trained on bootstrapped rows and random feature subsets, which cuts variance and overfitting at the cost of interpretability.
22

The average delivery time is 30 minutes, yet many customers complain about late orders. How do you investigate?

Save to ▾
Show answer
An average hides the shape of the distribution. Delivery times are usually right-skewed, so a 30-minute mean can include many orders taking 60 minutes or more. Look at the median, the 90th and 95th percentiles and a histogram, then break them down by city, time of day and restaurant. Report the share of orders beyond the promised time, because that is what customers actually experience.
23

How do you evaluate clustering when you have no labels?

Save to ▾
Show answer
Use internal metrics: the silhouette score compares how close a point is to its own cluster versus the nearest other cluster, and the Davies-Bouldin index measures cluster overlap. The elbow method looks at within-cluster variance. But the real test is usefulness: are clusters stable across random seeds and samples, can the business describe them, and do they behave differently on outcomes like spend or churn?
24

What is a baseline model and why should you build one first?

Save to ▾
Show answer
A baseline is the simplest reasonable prediction, such as predicting the most common class, last week's value or a basic logistic regression. It sets the minimum score any real model must beat. Without it, a 75 percent accuracy can look good when predicting the majority class already gives 80 percent. Baselines also catch pipeline bugs early and show whether extra complexity is worth it.
25

Design an end-to-end churn prediction system.

Save to ▾
Show answer
Define churn and the prediction window → build usage and billing features → handle imbalance → train gradient boosting → evaluate with PR-AUC and lift → explain with SHAP → deploy as batch scoring or an API → monitor drift → hand top-risk users to the retention team.
26

Tell me about a time your analysis contradicted what leadership expected.

Save to ▾
Show answer
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.
27

How does a CNN work?

Save to ▾
Show answer
Convolution filters slide over the input to detect local patterns, pooling reduces size, and deeper layers combine edges into shapes and objects. Used mainly for images.
28

You need to extract fields from scanned invoices that come in hundreds of different layouts. How would you design it?

Save to ▾
Show answer
Fixed templates will not scale to hundreds of layouts. Start with preprocessing: deskew, denoise and detect text regions. Run OCR to get words with their positions. Then use a layout-aware document model, or a vision-language model, to map words to fields like invoice number, GSTIN and total. Add validation rules, such as GSTIN format and line items summing to the total, and send low-confidence documents to human review.
29

What are common ways to evaluate NLP models?

Save to ▾
Show answer
Accuracy, F1 and confusion matrices for classification, BLEU or ROUGE for generation and summarisation, perplexity for language models, plus human review.
30

What is Naive Bayes and why is it called naive?

Save to ▾
Show answer
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.
31

Tell me about a time you found a mistake in your own analysis after sharing it.

Save to ▾
Show answer
Situation: after presenting a retention report, I noticed I had counted test accounts as users. Task: correct it before decisions were made. Action: I reran the numbers that evening, informed my manager and the audience with a short note showing old and new figures and what changed, and added a filter and a check to the shared query. Result: the conclusion held with smaller numbers, and the team valued the transparency.
32

Training a transformer on a GPU fails with an out-of-memory error. What can you do?

Save to ▾
Show answer
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.
33

The business asks you to pick a decision threshold for a churn model. How do you choose it?

Save to ▾
Show answer
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.
34

Your LLM app takes 8 seconds to respond and users complain. What do you do?

Save to ▾
Show answer
Break down where the time goes: retrieval, model time to first token and generation length. Stream tokens so users see output immediately. Cut prompt and output length, run retrieval and other calls in parallel, and cache frequent answers. Use a smaller or faster model for simple requests, and avoid chains of several LLM calls where one would do. Set a latency budget per step and monitor p95, not just averages.
35

Write PyTorch code to fine-tune a pretrained ResNet-18 for a 5-class problem by replacing its final layer.

Save to ▾
Show answer
import torch, torch.nn as nn from torchvision import models model = models.resnet18(weights=models.ResNet18_Weights.DEFAULT) for p in model.parameters(): p.requires_grad = False # freeze backbone model.fc = nn.Linear(model.fc.in_features, 5) opt = torch.optim.AdamW(model.fc.parameters(), lr=1e-3) loss_fn = nn.CrossEntropyLoss() # train head first, then unfreeze later layers with a lower lr
36

Your random forest is accurate but too slow at prediction time for a real-time API. What do you do?

Save to ▾
Show answer
First measure where the time goes. Then reduce trees and maximum depth and check the accuracy loss. Switch to a gradient boosting model, which often needs fewer, smaller trees. Compile the model with tools like ONNX Runtime or Treelite. Cache features or precompute scores for known users. If accuracy allows, a simpler logistic regression may meet the latency budget easily. Always compare options on the same validation set.
37

Your LLM gives different summaries for the same document on different runs, but auditors need consistent output. What do you do?

Save to ▾
Show answer
Set temperature to zero or near zero and fix other sampling settings, and use a seed where the API supports it, though outputs may still vary slightly. Pin the exact model version. Use a structured output format with fixed fields, and reduce ambiguity in the prompt. Cache and store each generated output with its inputs and version, so the stored result, not a regeneration, is what auditors see.
38

Write Python code for a two-proportion z-test comparing conversion between control and treatment.

Save to ▾
Show answer
from statsmodels.stats.proportion import proportions_ztest, proportion_confint conversions = [480, 540] # control, treatment visitors = [10000, 10000] z, p = proportions_ztest(conversions, visitors) lift = conversions[1] / visitors[1] - conversions[0] / visitors[0] ci_t = proportion_confint(conversions[1], visitors[1], method='wilson') print(f'z={z:.2f} p={p:.4f} abs lift={lift:.4f} treatment CI={ci_t}')
39

What is mean Average Precision (mAP) in object detection?

Save to ▾
Show answer
For each class, detections are ranked by confidence and a precision-recall curve is computed, where a detection is a true positive if its IoU with an unmatched ground truth box passes a threshold. Average Precision is the area under that curve. mAP is the mean across classes. mAP@0.5 uses IoU 0.5, while mAP@0.5:0.95 averages over thresholds from 0.5 to 0.95 and rewards tighter boxes.
40

Your credit model has good overall AUC but performs much worse for applicants from one region. What do you do?

Save to ▾
Show answer
First confirm with per-segment metrics and enough samples, since small groups are noisy. Then check why: fewer training examples from that region, different feature distributions, missing data or labels that reflect past biased decisions. Fixes include collecting more data, reweighting, segment-aware features or a separate calibration. Also review fairness and regulatory requirements, and agree with risk and compliance teams on acceptable performance gaps before launch.

Consulting companies (13)

Consulting

Accenture

Data Science interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad, Pune +2

View questions
Consulting

Deloitte

Data Science interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Bengaluru, Mumbai +2

View questions
Consulting

EY

Data Science interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Kolkata, Gurugram +2

View questions
Consulting

KPMG

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram, Bengaluru, Mumbai +2

View questions
Consulting

PwC

Data Science interview questions

  • 40 questions
  • 4 rounds

Kolkata, Bengaluru, Mumbai +2

View questions
Consulting

Publicis Sapient

Data Science interview questions

  • 40 questions
  • 5 rounds

Gurugram, Noida, Bengaluru

View questions
Consulting

Thoughtworks

Data Science interview questions

  • 40 questions
  • 5 rounds

Pune, Bengaluru, Chennai +2

View questions
Consulting

ZS Associates

Data Science interview questions

  • 40 questions
  • 5 rounds

Pune, Gurugram, Bengaluru

View questions
Consulting

McKinsey & Company

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru +1

View questions
Consulting

Boston Consulting Group

Data Science interview questions

  • 40 questions
  • 4 rounds

Mumbai, New Delhi, Bengaluru +1

View questions
Consulting

Bain & Company

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru

View questions
Consulting

Grant Thornton Bharat

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru +3

View questions
Consulting

Protiviti

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru +1

View questions

Frequently asked questions

How are Data Science interviews at consulting companies different?

Consulting firms look for people who can structure messy business problems and explain them simply to clients. Expect case and guesstimate questions, data interpretation, and questions on how you handled stakeholders, along with the technical skills for the role.

Which consulting companies are covered?

This page links to 13 consulting companies, including Accenture, Deloitte, EY, KPMG, PwC, Publicis Sapient, Thoughtworks, ZS Associates. Each has its own page with rounds and a separate practice set.

What rounds should I expect?

Common rounds at these companies include: Technical interview; Partner or HR round; Managerial round; Online assessment (aptitude + technical); HR round. The exact process varies by company and role.