BrowserStack Data Science Interview Questions & Answers
Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About BrowserStack hiring for Data Science roles
BrowserStack is a cloud-based software testing platform that lets teams test websites and mobile apps on real browsers and devices. Its products include Live, Automate, App Automate, Percy and Test Observability. It hires for software engineers, SDETs, support engineers and data analysts, many working on test infrastructure at scale.
For Data Science roles, this BrowserStack practice set focuses most on Python for Data Science (7), Computer Vision (5), SQL for Data Science (5), Machine Learning (5). It has 1 easy, 29 medium, 10 hard questions, so you can start easy and work up to the harder ones.
Company type
Product
Headquarters
Mumbai, India
Main India offices
Mumbai, Bengaluru
BrowserStack Data Science interview process
Online coding assessment
Technical round 1 (DSA or coding)
Technical round 2 (design or debugging)
Hiring manager round
HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for BrowserStackStart 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
Write a basic PyTorch training loop for one epoch.
model.train()
for X, y in train_loader:
X, y = X.to(device), y.to(device)
optimizer.zero_grad()
logits = model(X)
loss = loss_fn(logits, y)
loss.backward()
optimizer.step()
# evaluation
model.eval()
with torch.no_grad():
val_loss = sum(loss_fn(model(Xv.to(device)), yv.to(device)).item() for Xv, yv in val_loader)
02
Pandas: find the top 3 products by revenue in each region.
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
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance.
05
You are building defect detection for a factory line where only 1 in 1,000 images shows a defect. How do you approach it?
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.
06
Your notebook runs on your laptop but fails on a colleague's machine. How do you make the work reproducible?
First pin the environment: a requirements.txt or conda environment file with exact versions, or a Docker image. Set random seeds for NumPy, scikit-learn and any framework you use. Remove hard-coded local paths and read them from a config file. Make sure data comes from a shared, versioned location. Finally, restart the kernel and run the notebook top to bottom, so hidden cell order bugs are caught before sharing.
07
Write Python code to compute the haversine distance between customer and store locations.
ANOVA, analysis of variance, tests whether three or more group means are equal. It compares variation between groups to variation within groups using an F statistic. For example, comparing average order value across four city tiers. A significant result says at least one mean differs but not which one, so you follow up with post-hoc tests like Tukey's HSD. It assumes independent samples, roughly normal residuals and similar variances.
09
How do you use groupby with multiple aggregations?
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.
11
Tell me about a time you deployed a model under a tight deadline.
Situation: a pricing model had to go live before a sale in ten days. Task: deploy safely in that window. Action: I cut scope to batch scoring instead of real-time, reused our standard Docker and Airflow template, wrote tests for the key features and set up a dashboard for score distribution. Result: it went live two days early and ran without incidents during the sale. Real-time scoring followed a month later.
Recursive feature elimination trains a model, ranks features by importance or coefficient size, removes the weakest ones, and repeats until the desired number remains. RFECV picks the number of features using cross-validation. It considers features together rather than one at a time. The downsides are high compute cost on large data and unstable results when features are correlated, so check stability across folds.
13
What is the difference between probability and likelihood?
Probability fixes the parameters and asks how likely different data are, for example the chance of 7 heads in 10 tosses if the coin is fair. Likelihood fixes the observed data and asks how plausible different parameter values are, for example which coin bias best explains 7 heads. The likelihood function is not a probability distribution over parameters. Maximum likelihood estimation picks the parameter value that maximises it.
14
How would you build a churn prediction model end to end?
Define churn and the prediction window, build behavioural features, split by time, train and compare models, evaluate with recall and lift, explain drivers and monitor drift after deployment.
15
Describe a production incident with a model and how you handled it.
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.
16
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;
17
Write SQL to calculate month-over-month revenue growth.
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;
18
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)
19
What is the difference between generative and discriminative models?
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).
20
Write Pandas code to compute each customer's average order value excluding the current order.
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
21
Write SQL to find the median order value per city.
SELECT city,
PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY amount) AS median_amount
FROM orders
GROUP BY city;
-- PERCENTILE_CONT interpolates; PERCENTILE_DISC returns an actual value
22
How would you structure a data science codebase so notebooks do not become unmaintainable?
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.
23
What is the difference between hard voting and soft voting in ensembles?
In hard voting each model predicts a class and the majority wins. In soft voting each model gives class probabilities, they are averaged, and the class with the highest average wins. Soft voting usually works better because it uses each model's confidence, but it needs calibrated probabilities from all models. Hard voting is simpler and works even with models that only output labels.
24
Tell me about a time you had to learn a new deep learning framework or tool quickly.
Situation: my internship project used PyTorch, but I had only used Keras. Task: build a text classifier within two weeks. Action: I followed the official tutorials for two days, rebuilt a small Keras model in PyTorch to compare, and asked a senior to review my training loop. Result: I delivered the model on time with 88 percent F1. I learned that rebuilding something familiar is the fastest way into a new tool.
25
You assign values to a filtered DataFrame and Pandas shows a SettingWithCopyWarning. What is going on and how do you fix it?
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.
26
Write NumPy code for non-maximum suppression on a set of boxes and scores.
The model has learned a shortcut: the watermark correlates with the label in your dataset, perhaps because images of one class came from a single source. It will fail when that correlation breaks. Remove or crop the watermarks, rebalance sources across classes, and create a validation set from different sources. Keep using saliency maps and slice-based evaluation to catch other spurious cues such as backgrounds or text.
28
Your manager asks whether collecting more training data will improve the model. How do you answer using a learning curve?
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.
29
Write a Python function to compute MASE for a seasonal forecast.
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;
31
Write NumPy code to compute the Dice coefficient between a predicted and a true binary mask.
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.
33
Your sales forecast scores well in k-fold cross-validation but fails in production. What could be wrong with the validation?
Random k-fold mixes future and past rows, so the model trains on data from after the period it predicts. That leaks information and inflates scores. Use time-based splits instead: train on an expanding or rolling window and validate on the next period, like TimeSeriesSplit in scikit-learn. Leave a gap between train and validation when features use lagged values, so the test reflects real forecasting conditions.
34
Write scikit-learn code to get precision, recall and a confusion matrix at a custom threshold of 0.3.
The join key is probably not unique on the right side, so each left row matches several right rows and the result multiplies. Check with right['key'].duplicated().sum(). Other causes are null or blank keys matching each other after cleaning, or joining on the wrong column. Fix it by deduplicating or aggregating the right table first, and use merge(..., validate='many_to_one') so Pandas raises an error when the assumption breaks.
36
What is SARIMA and how does it extend a plain ARIMA model?
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.
37
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.
38
Write SQL to compute users, conversions and conversion rate for each experiment variant.
SELECT
a.variant,
COUNT(DISTINCT a.user_id) AS users,
COUNT(DISTINCT o.user_id) AS converters,
ROUND(COUNT(DISTINCT o.user_id) * 1.0
/ COUNT(DISTINCT a.user_id), 4) AS conv_rate
FROM assignments a
LEFT JOIN orders o
ON o.user_id = a.user_id
AND o.created_at >= a.assigned_at
WHERE a.experiment_id = 'checkout_v2'
GROUP BY a.variant;
39
Write pytest unit tests for a feature function that computes days since last purchase.
Tips to crack the BrowserStack Data Science interview
Learn Selenium, Appium and Playwright basics, since BrowserStack products are built around these testing frameworks.
Try a BrowserStack free trial and run an automated test to understand the user experience.
Practise debugging and system design questions related to running many parallel tests on real devices.
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; BrowserStack interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the BrowserStack Data Science interview?
Candidates usually go through 5 stages: Online coding assessment; Technical round 1 (DSA or coding); Technical round 2 (design or debugging); Hiring manager round; HR 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 BrowserStack Data Science interview?
This practice set leans on Python for Data Science (7), Computer Vision (5), SQL for Data Science (5), Machine Learning (5). Revise those first, then practise explaining one or two of your own projects end to end, because most BrowserStack interviewers ask you to walk through real work.
Are these the exact questions asked at BrowserStack?
No. These are curated practice questions that match the skills and difficulty usually tested in product interviews like BrowserStack's. They are not a leaked or verified list of past questions.
Where does BrowserStack hire Data Science professionals in India?
BrowserStack has large teams in Mumbai, Bengaluru. Openings and locations change often, so check the BrowserStack careers page and filter by city and experience.