Skip to content

BigBasket Data Science Interview Questions & Answers

Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.

About BigBasket hiring for Data Science roles

BigBasket is an Indian online grocery company, majority owned by the Tata Group, that delivers fruits, vegetables, staples and household products. It runs scheduled delivery and quick commerce services such as BB Now across many cities. Its Bengaluru technology and business teams hire software engineers, data analysts, data scientists, supply chain analysts and product managers.

For Data Science roles, this BigBasket practice set focuses most on Feature Engineering (7), A/B Testing & Experimentation (5), Computer Vision (4), Machine Learning (4). It has 1 easy, 28 medium, 11 hard questions, so you can start easy and work up to the harder ones.

Company type
E-commerce & consumer tech
Headquarters
Bengaluru, India
Main India offices
Bengaluru

BigBasket Data Science interview process

  1. Online coding or analytics assessment
  2. Technical round 1
  3. Technical round 2 (design or case)
  4. Hiring manager round

Typical pattern based on public candidate experiences. Rounds vary by role, team and year.

Solved for BigBasketStart 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 would you build RFM features for a customer churn model?

Save to ▾
Show answer
RFM stands for recency, frequency and monetary value. From the transactions table, for each customer as of a cut-off date: recency is days since the last purchase, frequency is the number of orders in the last 90 days, and monetary is total or average spend in that window. Compute them using only data before the cut-off, add trends like spend this month versus last, and the label from the period after.
02

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())
03

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
04

CNN vs RNN vs Transformer — what is the difference?

Save to ▾
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs.
05

You assign values to a filtered DataFrame and Pandas shows a SettingWithCopyWarning. What is going on and how do you fix it?

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

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

A feature works well offline but is not available at prediction time in production. How do you handle this?

Save to ▾
Show answer
This is training-serving skew. The feature might be computed from data that arrives later, like final order status. First confirm exactly when each feature is available in production. Rebuild the training set using point-in-time values, as they were at prediction time, or drop the feature. A feature store with point-in-time joins and the same feature code for training and serving prevents this. Expect offline scores to drop, but they become honest.
08

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

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

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

Write a Python function to compute MASE for a seasonal forecast.

Save to ▾
Show answer
import numpy as np def mase(y_train, y_true, y_pred, m=7): # Scale: in-sample error of seasonal naive y_train = np.asarray(y_train) scale = np.mean(np.abs(y_train[m:] - y_train[:-m])) err = np.mean(np.abs(np.asarray(y_true) - np.asarray(y_pred))) return err / scale # MASE below 1 beats seasonal naive
12

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
13

How would you design an ML platform for a team of 20 data scientists?

Save to ▾
Show answer
I would start from the team's pain points, then provide shared building blocks: a standard project template, managed notebooks with access to the warehouse, experiment tracking and a model registry, an orchestrator like Airflow for pipelines, a feature store if real-time use cases exist, a standard serving path using containers, and default monitoring. Prefer managed services over custom builds, and add self-serve documentation so teams do not depend on one platform engineer.
14

Write SQL to compute funnel conversion from visit to cart to purchase.

Save to ▾
Show answer
WITH steps AS ( SELECT user_id, MAX(CASE WHEN event = 'visit' THEN 1 ELSE 0 END) AS visited, MAX(CASE WHEN event = 'add_to_cart' THEN 1 ELSE 0 END) AS carted, MAX(CASE WHEN event = 'purchase' THEN 1 ELSE 0 END) AS purchased FROM events WHERE event_date >= '2026-10-01' GROUP BY user_id ) SELECT SUM(visited) AS visits, SUM(carted) AS carts, SUM(purchased) AS buyers, ROUND(100.0 * SUM(carted) / NULLIF(SUM(visited), 0), 1) AS visit_to_cart_pct, ROUND(100.0 * SUM(purchased) / NULLIF(SUM(carted), 0), 1) AS cart_to_buy_pct FROM steps;
15

What is correlation and why does it not imply causation?

Save to ▾
Show answer
Correlation measures linear association between variables (-1 to 1). A third factor, reverse causality or chance can create it, so causation needs controlled experiments.
16

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

Write a scikit-learn ColumnTransformer that preprocesses numeric and categorical columns.

Save to ▾
Show answer
from sklearn.compose import ColumnTransformer from sklearn.pipeline import make_pipeline from sklearn.impute import SimpleImputer from sklearn.preprocessing import StandardScaler, OneHotEncoder pre = ColumnTransformer([ ('num', make_pipeline(SimpleImputer(strategy='median'), StandardScaler()), num_cols), ('cat', make_pipeline(SimpleImputer(strategy='most_frequent'), OneHotEncoder(handle_unknown='ignore')), cat_cols) ]) model = make_pipeline(pre, LogisticRegression(max_iter=1000))
18

Write a FastAPI endpoint that serves predictions from a saved scikit-learn model.

Save to ▾
Show answer
from fastapi import FastAPI from pydantic import BaseModel import joblib import pandas as pd app = FastAPI() model = joblib.load('model.joblib') class Customer(BaseModel): tenure: int monthly_spend: float plan: str @app.post('/predict') def predict(c: Customer): X = pd.DataFrame([c.model_dump()]) return {'churn_probability': float(model.predict_proba(X)[0, 1])}
19

Pandas: merge vs join vs concat?

Save to ▾
Show answer
merge joins on columns, SQL-style (how='inner', 'left', ...). join joins on the index. concat stacks DataFrames along rows or columns.
20

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
21

Write Pandas code to encode hour of day as a cyclical feature.

Save to ▾
Show answer
import numpy as np # hour 23 and hour 0 should be close, so use sin and cos df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24) df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
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

What is Bayesian A/B testing and how are its results reported?

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

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

Write Pandas code to read a large CSV in chunks and compute total sales per city.

Save to ▾
Show answer
# 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)
26

Your manager asks whether collecting more training data will improve the model. How do you answer using a learning curve?

Save to ▾
Show answer
A learning curve plots training and validation scores against the size of the training set. If both scores are low and close, the model has high bias and needs more features or a more flexible model. If training is high but validation is much lower and the gap narrows as data grows, the model has high variance and more data will help. It tells you whether collecting more data is worth the cost.
27

Your product image classifier works on studio catalogue photos but fails on photos users take with their phones. Why, and what do you do?

Save to ▾
Show answer
This is domain shift: user photos have clutter, blur, poor lighting and odd angles that the model never saw. Collect and label a sample of real user photos and evaluate on them separately. Add augmentation for blur, noise, colour jitter, rotation and random crops, and fine-tune on a mix of studio and real images. Monitor accuracy on user photos in production, since that is the distribution that matters.
28

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
29

What is a confidence interval?

Save to ▾
Show answer
A range built from sample data that would contain the true parameter in a stated percentage (for example 95%) of repeated samples. It is not the probability that the parameter lies inside this one interval.
30

What is the receptive field of a neuron in a CNN?

Save to ▾
Show answer
The receptive field is the region of the input image that can influence one activation. Early layers see small patches like edges, and deeper layers see larger regions, enabling recognition of whole objects. It grows with kernel size, depth, stride and pooling, and dilated convolutions increase it without extra parameters. If the receptive field is smaller than the objects you care about, the network cannot capture their full context.
31

Tell me about a time you had to deliver data under an urgent deadline.

Save to ▾
Show answer
Situation: the leadership team needed festive-sale numbers by city for a 9 am review, and the dashboard pipeline had failed overnight. Task: deliver accurate numbers in three hours. Action: I queried the raw orders tables directly, reused validated logic from the dashboard SQL, cross-checked totals with finance's daily figure and flagged two cities with partial data. Result: the review went ahead on time, and I later added pipeline failure alerts.
32

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

Your image classifier trained on 2,000 images memorises the training set within 5 epochs. What do you try?

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

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

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

Write a prompt template for classifying customer support tickets.

Save to ▾
Show answer
System: You classify support tickets for an e-commerce company. Categories: payment, delivery, refund, account, other. Rules: choose exactly one category; if unsure, choose other; do not invent details. Return JSON with fields category and reason, reason under 20 words. Then two short examples showing a ticket and the expected JSON. User: Ticket: {ticket_text}. Keep the template fixed and test it on 100 labelled tickets before rollout.
37

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

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

Write SQL to show each customer's first order date, last order date and the gap between them in days.

Save to ▾
Show answer
SELECT customer_id, MIN(order_date) AS first_order, MAX(order_date) AS last_order, MAX(order_date) - MIN(order_date) AS days_between, COUNT(*) AS orders FROM orders GROUP BY customer_id ORDER BY days_between DESC; -- PostgreSQL: DATE minus DATE gives days; use DATEDIFF in other engines
40

How do you get reliable JSON output from an LLM?

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

Tips to crack the BigBasket Data Science interview

  • Practise DSA for engineering roles, and SQL plus Excel for analyst roles, as these are commonly tested in screening.
  • Think through grocery supply chain problems like demand forecasting, inventory freshness and delivery slot planning before case rounds.
  • Use the BigBasket app and note improvement ideas, which helps in product sense and why-BigBasket discussions.
  • 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; BigBasket interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the BigBasket Data Science interview?

Candidates usually go through 4 stages: Online coding or analytics assessment; Technical round 1; Technical round 2 (design or case); Hiring manager 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 BigBasket Data Science interview?

This practice set leans on Feature Engineering (7), A/B Testing & Experimentation (5), Computer Vision (4), Machine Learning (4). Revise those first, then practise explaining one or two of your own projects end to end, because most BigBasket interviewers ask you to walk through real work.

Are these the exact questions asked at BigBasket?

No. These are curated practice questions that match the skills and difficulty usually tested in e-commerce & consumer tech interviews like BigBasket's. They are not a leaked or verified list of past questions.

Where does BigBasket hire Data Science professionals in India?

BigBasket has large teams in Bengaluru. Openings and locations change often, so check the BigBasket careers page and filter by city and experience.

Data Science questions for similar companies