Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About Meta hiring for Data Science roles
Meta Platforms owns Facebook, Instagram, WhatsApp, Messenger and Reality Labs. Its India presence includes business, partnerships and engineering teams, with WhatsApp and payments work closely tied to the Indian market. Technical hiring in India covers software engineering, data science, data engineering and analytics roles focused on product growth and measurement.
For Data Science roles, this Meta practice set focuses most on Python for Data Science (8), SQL for Data Science (6), Machine Learning (6), MLOps and Model Deployment (4). It has 2 easy, 28 medium, 10 hard questions, so you can start easy and work up to the harder ones.
Company type
Product
Headquarters
Menlo Park, California, USA
Main India offices
Gurugram, Bengaluru, Hyderabad, Mumbai
Meta Data Science interview process
Recruiter screening
Technical phone screen (coding or SQL)
Onsite coding rounds
Product sense or system design round
Behavioural round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for MetaStart 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 PyTorch code to fine-tune a pretrained ResNet-18 for a 5-class problem by replacing its final layer.
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
02
What is normalisation, and why are analytics tables often denormalised?
Normalisation splits data into related tables to remove redundancy, so each fact is stored once, which suits transactional systems with many updates. Analytics workloads mostly read large volumes, and joins across many tables are slow and error-prone. So warehouses often use denormalised, wide tables or star schemas that repeat some attributes. The trade-off is more storage and the need to keep copies consistent through pipelines.
03
Write Python code to calculate the sample size per group needed to detect a lift from 5 percent to 5.5 percent conversion.
One classical model per SKU is simple and interpretable but expensive to maintain, and it fails for short or sparse series. A global model, such as LightGBM trained on all SKUs with lags, calendar and product features, learns shared patterns and handles new items better. In practice I would use a global model as the main engine, keep statistical models for a few high-value series, and compare both in a rolling backtest.
05
Write pytest unit tests for a feature function that computes days since last purchase.
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.
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.
Regularization adds a penalty on weights to reduce overfitting. L1 (Lasso) adds |w| and can push features to exactly zero. L2 (Ridge) adds w² and shrinks weights smoothly.
10
Write SQL to compute week-1 retention by signup week.
WITH signups AS (
SELECT user_id, DATE_TRUNC('week', signup_date) AS cohort, signup_date
FROM users
), active AS (
SELECT DISTINCT s.user_id, s.cohort
FROM signups s
JOIN events e ON e.user_id = s.user_id
AND e.event_date >= s.signup_date + INTERVAL '7 day'
AND e.event_date < s.signup_date + INTERVAL '14 day'
)
SELECT s.cohort, COUNT(*) AS users,
ROUND(100.0 * COUNT(a.user_id) / COUNT(*), 1) AS week1_retention_pct
FROM signups s
LEFT JOIN active a ON a.user_id = s.user_id
GROUP BY s.cohort
ORDER BY s.cohort;
11
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.
12
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.
13
Your detector finds large objects well but misses small objects like distant people. How do you improve it?
Small objects lose detail after downsampling. Train and infer at higher input resolution, or tile large images into overlapping crops. Use a backbone with a feature pyramid so detection happens on high-resolution maps. Tune anchors or assignment settings for small sizes, and oversample images with small objects. Check labelling quality for tiny boxes too. Measure mAP on small objects separately to confirm improvement.
Guardrails are checks around the model that keep inputs and outputs safe and on-topic. Input guardrails detect prompt injection, abuse or off-topic requests. Output guardrails check for personal data, toxic content, policy violations or invalid formats before the answer reaches the user. They can be rules, classifiers or a second LLM call. Good guardrails also define fallback responses and log blocked cases for review.
A decorator wraps a function to add behaviour such as logging, timing or caching without changing its code. It is applied with the @name syntax above the function.
As the number of independent trials grows, the sample average converges to the true expected value, which is why larger samples give more stable estimates.
It models the log-odds of a binary outcome as a linear function and passes it through a sigmoid to give probabilities, trained by maximising likelihood.
18
Pandas: compute a 7-day rolling average of daily sales for each store.
Plan a geo experiment: select comparable cities or regions, randomly assign some to run the campaign and keep others as control, matching them on past sales trends. Measure the difference in sales during and after the campaign, using methods like difference-in-differences or synthetic control to build a counterfactual. Run a pre-period check that test and control regions track each other, and include enough regions for reasonable power.
20
Write SQL to find duplicate emails in a users table.
The join created duplicate order rows, because some orders match more than one promotion row, so each amount is counted several times. Check by comparing COUNT(*) with COUNT(DISTINCT order_id) after the join. Fix it by aggregating the promotions table to one row per order first, picking one promotion with ROW_NUMBER, or summing revenue before the join. Always check row counts after every join.
22
A deep network you built from scratch does not learn at all; the loss stays flat from the first epoch. Could weight initialisation be the reason?
If weights start too large, activations and gradients explode; if too small, they vanish, and training stalls. If all weights are equal, every neuron learns the same thing. Good schemes keep the variance of activations stable across layers: Xavier or Glorot initialisation for tanh and sigmoid, and He initialisation for ReLU. Frameworks use sensible defaults, but it matters when building custom layers or very deep networks.
23
Write Python code to compute the Population Stability Index for a feature to detect drift.
Hierarchical forecasting produces forecasts at several levels, such as SKU, store, city and national totals. If you forecast each level independently, the store forecasts will not add up to the city forecast. Reconciliation adjusts them to be consistent. Bottom-up sums the lowest level, top-down splits the total by proportions, and methods like MinT combine all levels optimally. Consistent numbers matter because finance, supply chain and stores plan from different levels.
25
Your model's most important feature is customer_id. What is wrong?
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.
26
Write Python code to group a list of order dictionaries by city and sum the amounts without Pandas.
It projects data onto orthogonal directions of maximum variance to reduce dimensions, remove correlation and speed up models, at some cost of interpretability.
28
Write a FastAPI endpoint that serves predictions from a saved scikit-learn model.
This is overfitting. Check for data leakage, simplify the model, add regularization, get more data or augment it, use cross-validation, early stopping and feature selection.
30
What is statistical power and how can you increase it?
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level.
31
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.
33
Pandas: find the top 3 products by revenue in each region.
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.
All three are gradient boosting libraries. XGBoost grows trees level by level with strong regularisation and is very mature. LightGBM uses histogram binning and leaf-wise growth, so it is usually fastest on large data but can overfit small data without limits on leaves. CatBoost handles categorical features natively with ordered target statistics and uses symmetric trees, so it gives good results with little tuning. Choice depends on data size, categoricals and latency needs.
36
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)
37
You must forecast demand for a new product that has only three weeks of history. What do you do?
Three weeks is too little to learn seasonality, so borrow information. Find similar past launches by category, price band and channel, and use their early sales curves as analogues. A global model trained across many products, with product attributes as features, can also forecast a cold-start item. Combine this with planned marketing spend and business judgement, show a wide interval, and update the forecast weekly as real data arrives.
38
What is the difference between layer normalisation and batch normalisation?
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.
39
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)
40
You need to extract fields from scanned invoices that come in hundreds of different layouts. How would you design it?
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.
Tips to crack the Meta Data Science interview
For data science roles, practise product sense questions such as defining success metrics for Instagram Reels or WhatsApp Status.
Solve two medium coding problems within about 40 minutes, as Meta coding rounds are known for being fast-paced.
Read Meta's company values like Move Fast and Focus on Long-Term Impact and link your behavioural answers to them.
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; Meta interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the Meta Data Science interview?
Candidates usually go through 5 stages: Recruiter screening; Technical phone screen (coding or SQL); Onsite coding rounds; Product sense or system design round; Behavioural 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 Meta Data Science interview?
This practice set leans on Python for Data Science (8), SQL for Data Science (6), Machine Learning (6), MLOps and Model Deployment (4). Revise those first, then practise explaining one or two of your own projects end to end, because most Meta interviewers ask you to walk through real work.
Are these the exact questions asked at Meta?
No. These are curated practice questions that match the skills and difficulty usually tested in product interviews like Meta's. They are not a leaked or verified list of past questions.
Where does Meta hire Data Science professionals in India?
Meta has large teams in Gurugram, Bengaluru, Hyderabad, Mumbai. Openings and locations change often, so check the Meta careers page and filter by city and experience.