Skip to content

Data Science Interview Questions for E-commerce & consumer tech Companies

40 questions weighted to the interview style of e-commerce & consumer tech companies — 7 easy, 29 medium, 4 hard.

How e-commerce & consumer tech companies interview for Data Science

E-commerce and consumer-internet companies work at large scale with fast release cycles. Interviews focus on practical skill, metrics such as conversion and retention, scenario questions from real product problems, and how you work under tight timelines.

This set focuses on Machine Learning (7), A/B Testing & Experimentation (7), MLOps and Model Deployment (4), Time Series & Forecasting (4).

Hiring manager round HR round Technical or case round Technical round 1 Online assessment (coding or SQL)
Solved — e-commerce & consumer tech 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

How does K-means clustering work and how do you choose k?

Save to ▾
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context.
02

Your experiment ended with no statistically significant difference. What do you tell the team?

Save to ▾
Show answer
Not significant does not mean no effect. Report the observed effect with its confidence interval, for example minus 0.3 to plus 1.2 percent, and compare it with the MDE the test was powered for. If the interval rules out effects that matter, conclude the change has little impact and decide based on cost or design preference. If the interval is wide, the test was underpowered, and a longer test or variance reduction may help.
03

Write a Dockerfile for a Python model API.

Save to ▾
Show answer
FROM python:3.11-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app/ ./app COPY model.joblib . EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
04

Write Python code to fit a Holt-Winters model and forecast the next 12 months.

Save to ▾
Show answer
from statsmodels.tsa.holtwinters import ExponentialSmoothing s = df.set_index('month')['sales'].asfreq('MS') train, test = s[:-12], s[-12:] model = ExponentialSmoothing( train, trend='add', seasonal='mul', seasonal_periods=12 ).fit() forecast = model.forecast(12) mae = (forecast - test).abs().mean() print(forecast.round(1), 'MAE:', round(mae, 1))
05

A new checkout converts better on both mobile and desktop, but worse overall. How is that possible?

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

What is the minimum detectable effect (MDE) in experiment design?

Save to ▾
Show answer
The MDE is the smallest true effect your test can reliably detect given the sample size, baseline rate, significance level and power. If baseline conversion is 5 percent and your MDE is 10 percent relative, you can detect a move to 5.5 percent but will likely miss smaller lifts. Choose the MDE from business value: the smallest change worth shipping. A smaller MDE needs a much larger sample, roughly growing with one over MDE squared.
07

What is backpropagation?

Save to ▾
Show answer
It computes the gradient of the loss with respect to every weight by applying the chain rule backwards through the network, so gradient descent can update them.
08

What is the difference between layer normalisation and batch normalisation?

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

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

What is SARIMA and how does it extend a plain ARIMA model?

Save to ▾
Show answer
SARIMA adds seasonal terms to ARIMA. It is written ARIMA(p,d,q)(P,D,Q)m, where the second set are seasonal AR, differencing and MA orders, and m is the season length, such as 7 for daily data with a weekly cycle or 12 for monthly data. SARIMAX further allows external regressors like price or holidays. It handles one seasonal period well but struggles with multiple seasonalities, such as daily plus yearly.
11

Write Python code to calculate the sample size per group needed to detect a lift from 5 percent to 5.5 percent conversion.

Save to ▾
Show answer
from statsmodels.stats.power import NormalIndPower from statsmodels.stats.proportion import proportion_effectsize baseline, target = 0.05, 0.055 effect = proportion_effectsize(target, baseline) # Cohen's h n = NormalIndPower().solve_power( effect_size=effect, alpha=0.05, power=0.8, ratio=1.0, alternative='two-sided' ) print(round(n)) # about 31,000 users per group
12

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

What are primary metrics and guardrail metrics in an experiment?

Save to ▾
Show answer
The primary metric is the one the change is meant to improve and that decides success, such as checkout conversion. Guardrail metrics are ones that must not get worse, such as page load time, refund rate, unsubscribes or revenue per user. Defining both before the test prevents cherry-picking afterwards. A change that lifts the primary metric but breaks a guardrail is usually not shipped without further discussion.
14

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

You keep adding features and R-squared keeps rising. Is the model really getting better?

Save to ▾
Show answer
R-squared shows the share of variance in the target explained by the model. It never decreases when you add a feature, even a useless one. Adjusted R-squared penalises extra features based on the number of predictors and sample size, so it rises only if a new feature improves the model more than chance would. Use adjusted R-squared to compare linear models with different numbers of features.
16

Write Python code to compute a 95% bootstrap confidence interval for the mean.

Save to ▾
Show answer
import numpy as np def bootstrap_ci(x, n_boot=10000, seed=42): rng = np.random.default_rng(seed) x = np.asarray(x) means = [rng.choice(x, size=len(x), replace=True).mean() for _ in range(n_boot)] return np.percentile(means, [2.5, 97.5]) print(bootstrap_ci([12, 15, 9, 20, 14, 11, 18]))
17

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

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

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

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?
21

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
22

Difference between a shallow copy and a deep copy?

Save to ▾
Show answer
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak.
23

What is a long-term holdout group and when is it useful?

Save to ▾
Show answer
A holdout is a small share of users, say 2 to 5 percent, kept away from a set of launched features for months. Comparing them with everyone else measures the cumulative, long-term impact of many shipped changes, which individual short tests can overstate because of novelty effects or winner's curse. It is useful for recommendation systems, notifications and marketing, but it costs some value from users who miss improvements.
24

Write Pandas code to create lag and rolling features for each customer.

Save to ▾
Show answer
df = df.sort_values(['customer_id', 'month']) g = df.groupby('customer_id')['spend'] df['spend_lag1'] = g.shift(1) df['spend_lag3'] = g.shift(3) # shift first so the current month is not included df['spend_roll3_mean'] = g.transform(lambda s: s.shift(1).rolling(3).mean())
25

How do you detect outliers?

Save to ▾
Show answer
Use the IQR rule (below Q1-1.5 IQR or above Q3+1.5 IQR), z-scores beyond 3, box plots or model-based methods such as Isolation Forest, then decide whether to cap, remove or keep them.
26

Describe a time you had to push back on or prioritise many ad-hoc data requests.

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

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

How do you detect and treat concept drift?

Save to ▾
Show answer
Monitor input distributions and live metrics, compare to training baselines, and retrain or recalibrate on fresh data when performance drops.
29

What is quantisation of LLMs?

Save to ▾
Show answer
Quantisation stores model weights in lower precision, such as 8-bit or 4-bit integers instead of 16-bit floats. A 7-billion parameter model drops from about 14 GB to around 4 GB at 4-bit, so it fits on smaller GPUs or even laptops and runs faster. The cost is some loss in quality, usually small at 8-bit and noticeable on hard tasks at very low bits. Common formats include GPTQ, AWQ and GGUF.
30

Tell me about a time your model did not perform as expected after deployment.

Save to ▾
Show answer
Situation: my demand forecasting model had 8 percent error offline, but 20 percent in the first month live. Task: find out why quickly. Action: I compared live inputs with training data and found a promotions feature arrived a day late in production, so the model saw zeros. I added a data freshness check and a fallback. Result: error returned to 9 percent. Since then I always test with production-like pipelines before launch.
31

Write Pandas code to compute each customer's average order value excluding the current order.

Save to ▾
Show answer
g = df.groupby('customer_id')['amount'] total = g.transform('sum') count = g.transform('count') # Leave-one-out mean; NaN when it is the customer's only order df['avg_other_orders'] = (total - df['amount']) / (count - 1) df.loc[count == 1, 'avg_other_orders'] = float('nan') # For time-aware features, use only earlier orders instead
32

Your fraud model has 99 percent accuracy, but the business says it catches almost no fraud. Why?

Save to ▾
Show answer
If only 1 percent of transactions are fraud, a model that predicts not fraud for everything is 99 percent accurate and useless. Accuracy hides the minority class. I would check the confusion matrix, recall on fraud cases and precision-recall AUC. Then fix it with class weights, resampling or a lower decision threshold, and choose the threshold based on the cost of missed fraud versus false alerts.
33

What is a p-value?

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

What is the vanishing gradient problem?

Save to ▾
Show answer
Gradients shrink as they pass through many layers (for example with sigmoid), so early layers barely learn. ReLU, residual connections and good initialisation help.
35

What is the difference between batch and real-time inference?

Save to ▾
Show answer
Batch inference scores many records on a schedule, for example nightly churn scores for all customers written to a table. It is cheap and simple. Real-time inference serves predictions on request through an API within milliseconds, for example fraud checks during payment. It needs low-latency feature access, scaling and high availability. Choose real-time only when the decision truly must use fresh data at the moment of the request.
36

Your model's most important feature is customer_id. What is wrong?

Save to ▾
Show answer
An ID has no real meaning, so high importance means the model is memorising individual customers. It often happens when the same customers appear in both train and test, or when IDs were assigned in time order and act as a proxy for date or signup cohort. I would drop the ID, use a group-based split by customer, and if timing matters, add an explicit feature like account age instead.
37

Your logging system was down for four days, leaving gaps in a daily series. How do you handle them before modelling?

Save to ▾
Show answer
First make the gaps explicit by reindexing to a full daily calendar so missing days appear as NaN instead of silently disappearing. For short gaps, linear or time-based interpolation is usually fine. If there is strong weekly seasonality, fill using the same weekday from neighbouring weeks or a seasonal decomposition. Add a flag column marking imputed days, and never treat missing as zero unless zero really happened.
38

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

What is an Overall Evaluation Criterion (OEC) in experimentation?

Save to ▾
Show answer
An OEC is a single agreed metric, or a weighted combination of metrics, that represents long-term business value and is used to judge experiments. Good OECs are sensitive enough to move within a test's duration yet aligned with long-term goals; for example, sessions per user with penalties for churn rather than raw clicks. Having an OEC prevents teams from each optimising their own metric and makes ship decisions consistent across the organisation.
40

Write SQL to calculate month-over-month revenue growth.

Save to ▾
Show answer
WITH monthly AS ( SELECT DATE_TRUNC('month', order_date) AS month, SUM(amount) AS revenue FROM orders GROUP BY 1 ) SELECT month, revenue, LAG(revenue) OVER (ORDER BY month) AS prev_revenue, ROUND(100.0 * (revenue - LAG(revenue) OVER (ORDER BY month)) / NULLIF(LAG(revenue) OVER (ORDER BY month), 0), 2) AS mom_pct FROM monthly;

E-commerce & consumer tech companies (14)

E-commerce & consumer tech

Walmart

Data Science interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Chennai, Gurugram

View questions
E-commerce & consumer tech

Flipkart

Data Science interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad

View questions
E-commerce & consumer tech

Swiggy

Data Science interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad

View questions
E-commerce & consumer tech

Zomato

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram

View questions
E-commerce & consumer tech

Zepto

Data Science interview questions

  • 40 questions
  • 4 rounds

Mumbai, Bengaluru

View questions
E-commerce & consumer tech

Meesho

Data Science interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions
E-commerce & consumer tech

Myntra

Data Science interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions
E-commerce & consumer tech

MakeMyTrip

Data Science interview questions

  • 40 questions
  • 5 rounds

Gurugram, Bengaluru

View questions
E-commerce & consumer tech

Nykaa

Data Science interview questions

  • 40 questions
  • 4 rounds

Mumbai, Gurugram, Bengaluru

View questions
E-commerce & consumer tech

Target

Data Science interview questions

  • 40 questions
  • 5 rounds

Bengaluru

View questions
E-commerce & consumer tech

BigBasket

Data Science interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions
E-commerce & consumer tech

Lenskart

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram, Bengaluru

View questions
E-commerce & consumer tech

Blinkit

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram

View questions
E-commerce & consumer tech

Delhivery

Data Science interview questions

  • 40 questions
  • 4 rounds

Gurugram, Bengaluru

View questions

Frequently asked questions

How are Data Science interviews at e-commerce & consumer tech companies different?

E-commerce and consumer-internet companies work at large scale with fast release cycles. Interviews focus on practical skill, metrics such as conversion and retention, scenario questions from real product problems, and how you work under tight timelines.

Which e-commerce & consumer tech companies are covered?

This page links to 14 e-commerce & consumer tech companies, including Walmart, Flipkart, Swiggy, Zomato, Zepto, Meesho, Myntra, MakeMyTrip. Each has its own page with rounds and a separate practice set.

What rounds should I expect?

Common rounds at these companies include: Hiring manager round; HR round; Technical or case round; Technical round 1; Online assessment (coding or SQL). The exact process varies by company and role.