Skip to content

Publicis Sapient Data Science Interview Questions & Answers

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

About Publicis Sapient hiring for Data Science roles

Publicis Sapient is the digital business transformation arm of Publicis Groupe, combining strategy, product, experience design, engineering and data. Its India offices in Gurugram, Noida and Bengaluru deliver engineering and data work for global clients in retail, financial services and energy. It hires for software engineers, quality engineers, data engineers and data scientists.

For Data Science roles, this Publicis Sapient practice set focuses most on Machine Learning (10), MLOps and Model Deployment (6), Deep Learning and NLP (6), Feature Engineering (4). It has 5 easy, 30 medium, 5 hard questions, so you can start easy and work up to the harder ones.

Company type
Consulting
Headquarters
Boston, Massachusetts, USA
Main India offices
Gurugram, Noida, Bengaluru

Publicis Sapient Data Science interview process

  1. Online coding assessment
  2. Technical round 1 (coding + fundamentals)
  3. Technical round 2 (design or domain)
  4. Managerial round
  5. HR round

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

Solved for Publicis SapientStart 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

When would you use MAE, MSE or RMSE for a regression model?

Save to ▾
Show answer
MAE is the average absolute error; it is easy to explain and less sensitive to outliers. MSE squares errors, so large errors are punished heavily, and it is smooth for optimisation. RMSE is the square root of MSE, so it is in the same units as the target while still punishing big misses. Use RMSE when large errors are very costly, like stock-out forecasts, and MAE when outliers should not dominate.
02

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
03

What is DBSCAN and when is it better than K-means?

Save to ▾
Show answer
DBSCAN is a density-based clustering algorithm. It groups points that have at least min_samples neighbours within distance eps, and marks isolated points as noise. Unlike K-means, it does not need the number of clusters, finds clusters of any shape, and handles outliers. It struggles when clusters have very different densities and in high dimensions. It suits location data, like finding delivery hotspots from GPS points.
04

What is the difference between saving a model with pickle, joblib and ONNX?

Save to ▾
Show answer
pickle serialises Python objects; it is simple but tied to Python and library versions, and loading untrusted pickle files is a security risk. joblib is similar but more efficient for objects with large NumPy arrays, like scikit-learn models. ONNX is an open, language-neutral format that runs in optimised runtimes across languages and hardware, useful for fast serving. Always store library versions alongside pickle or joblib files.
05

What is PCA and when do you use it?

Save to ▾
Show answer
It projects data onto orthogonal directions of maximum variance to reduce dimensions, remove correlation and speed up models, at some cost of interpretability.
06

Your deployed model gives different predictions than the same model in your notebook. Why?

Save to ▾
Show answer
Usually preprocessing differs between training and serving. Check that the same pipeline object was saved, not just the estimator, and that category order, missing value handling and scaling match. Compare library versions, feature types like strings versus integers, column order, and time zones in date features. Send the same few rows through both paths and compare features step by step to find the first mismatch.
07

How do you pivot data in Pandas?

Save to ▾
Show answer
pd.pivot_table(df, index='region', columns='month', values='sales', aggfunc='sum') reshapes long data into a summary matrix; melt() does the reverse.
08

What is standard deviation and what does it tell you?

Save to ▾
Show answer
The square root of the variance; it measures how far values typically sit from the mean, in the same units as the data.
09

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.
10
Save to ▾
Show answer
Term Frequency × Inverse Document Frequency: a word scores high if it is frequent in one document but rare across all documents. A classic way to turn text into numeric features.
11

What is hierarchical forecasting and why is reconciliation needed?

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

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

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

How do you turn text columns into features for a tabular model?

Save to ▾
Show answer
Simple options are length, word count and keyword flags. TF-IDF vectors capture important words and work well with linear models. For meaning, use sentence embeddings from a pretrained model and optionally reduce them with PCA. You can also train a separate text classifier and feed its predicted score as one feature. Fit any vocabulary or encoder on training data only to avoid leakage.
15

How does linear regression work and what are its assumptions?

Save to ▾
Show answer
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity.
16

Your sales forecast scores well in k-fold cross-validation but fails in production. What could be wrong with the validation?

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

What are RNNs and why did LSTMs improve them?

Save to ▾
Show answer
RNNs process sequences with a hidden state but struggle with long dependencies. LSTMs add gates that control what to remember or forget, easing the vanishing gradient.
18

What is an isolation forest and how does it detect anomalies?

Save to ▾
Show answer
An isolation forest builds many random trees that split data on random features at random thresholds. Anomalies are rare and different, so they get isolated in very few splits, giving a short average path length. Normal points need many splits. The anomaly score comes from that path length. It is fast, works without labels and scales to large data, but you must choose a contamination rate or score threshold carefully.
19

Train accuracy is 95% but test accuracy is 70%. What do you do?

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

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

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

How do you make a machine learning experiment reproducible?

Save to ▾
Show answer
Version the code with Git, the data with a tool like DVC or dated snapshots, and the environment with pinned requirements or Docker. Set random seeds for every library. Log parameters, metrics and the exact data version for each run with a tracker like MLflow. Keep preprocessing inside a pipeline rather than manual notebook steps. Then anyone should be able to rebuild the same model from a commit and a data version.
23

What does CI/CD mean for machine learning projects?

Save to ▾
Show answer
Continuous integration runs automatic checks on every code change: unit tests for feature code, data validation, linting and a quick training run on sample data. Continuous delivery packages the model and service, for example as a Docker image, and deploys it through staging to production after evaluation gates, such as the new model beating the current one on a holdout set. Some teams add continuous training, which retrains on new data automatically.
24

After one-hot encoding you have 2,000 features and training is slow. What do you do?

Save to ▾
Show answer
Find which columns caused the explosion, usually a few high-cardinality categoricals. Group rare categories into Other, or switch those columns to frequency, target or hashing encoding. Use sparse matrices so zeros take no memory. Tree libraries like LightGBM and CatBoost can handle categoricals natively without one-hot. Then remove near-constant columns and check that validation scores hold up with the smaller feature set.
25

What is the difference between encoder-only, decoder-only and encoder-decoder transformers?

Save to ▾
Show answer
Encoder-only models like BERT see the full input in both directions and are best for understanding tasks such as classification, NER and embeddings. Decoder-only models like GPT predict the next token using only past tokens, so they suit text generation and chat. Encoder-decoder models like T5 encode the input and then generate output, which fits translation and summarisation. Most modern LLMs are decoder-only because they scale well.
26

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

What is subword tokenisation like BPE or WordPiece?

Save to ▾
Show answer
Subword tokenisers split text into frequent pieces between characters and full words. Byte Pair Encoding starts from characters and repeatedly merges the most frequent pairs. WordPiece, used by BERT, is similar but chooses merges by likelihood. Rare words like unhappiness become un, happi, ness, so there are no unknown words and the vocabulary stays around 30,000 to 100,000. Token counts also decide LLM cost and context use.
28

Explain the Law of Large Numbers.

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

What is an autoencoder and what is it used for?

Save to ▾
Show answer
A network that compresses inputs into a small latent code and reconstructs them; used for denoising, dimensionality reduction and anomaly detection.
30

Your classifier scores 98 percent on validation, but Grad-CAM shows it focuses on a watermark rather than the object. What is happening?

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

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

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

Write SQL to find the top 3 products by revenue in each category.

Save to ▾
Show answer
WITH rev AS ( SELECT category, product_id, SUM(price * qty) AS revenue FROM order_items GROUP BY category, product_id ), ranked AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY revenue DESC) AS rn FROM rev ) SELECT category, product_id, revenue FROM ranked WHERE rn <= 3;
34

Write a Python function to compute IoU between two bounding boxes given as (x1, y1, x2, y2).

Save to ▾
Show answer
def iou(a, b): ix1, iy1 = max(a[0], b[0]), max(a[1], b[1]) ix2, iy2 = min(a[2], b[2]), min(a[3], b[3]) inter = max(0, ix2 - ix1) * max(0, iy2 - iy1) area_a = (a[2] - a[0]) * (a[3] - a[1]) area_b = (b[2] - b[0]) * (b[3] - b[1]) union = area_a + area_b - inter return inter / union if union > 0 else 0.0 print(iou((0, 0, 10, 10), (5, 5, 15, 15))) # 0.142...
35

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

Your power analysis says you need 200,000 users per group, but the page gets only 5,000 users a week. What are your options?

Save to ▾
Show answer
Waiting 80 weeks is unrealistic. Options: test a bolder change so the expected effect is larger; use a more sensitive metric closer to the change, like add-to-cart instead of purchase; apply CUPED to reduce variance; or move the test to a higher-traffic page. If none work, accept a larger MDE explicitly, or decide using qualitative research and a staged rollout with monitoring instead of a formal test.
37
Save to ▾
Show answer
MLOps is the set of practices that take machine learning models from experiments to reliable production and keep them working. It covers versioning data and code, tracking experiments, automated training pipelines, testing, deployment, monitoring and retraining. It borrows ideas from DevOps but adds data and model concerns, because a model can fail even when the code has not changed, simply because the data has.
38

A customer asks why their loan application was rejected by your model. How do you respond?

Save to ▾
Show answer
I would give a clear, individual explanation, not a technical dump. Using SHAP or reason codes, I would list the top factors, such as high existing EMI burden or short credit history, and say what could improve the outcome. I would also check that the model does not rely on protected attributes or close proxies. For regulated lending, a human review path and documented reason codes are essential.
39

Halfway through a test you discover a bug that broke the treatment for Android users. What do you do?

Save to ▾
Show answer
Stop or pause the affected part, fix the bug and restart the test with fresh data, since mixing broken and fixed periods biases results. Do not simply drop Android users from analysis afterwards, because that can break randomisation balance if the bug affected behaviour or logging. Document the incident, and add pre-launch checks such as running the variant through QA on every platform and monitoring guardrails in the first hours.
40

Write Python code to find the top 3 most similar documents to a query using cosine similarity on embeddings.

Save to ▾
Show answer
import numpy as np def top_k(query_vec, doc_vecs, k=3): q = query_vec / np.linalg.norm(query_vec) d = doc_vecs / np.linalg.norm(doc_vecs, axis=1, keepdims=True) scores = d @ q idx = np.argsort(-scores)[:k] return list(zip(idx, scores[idx])) # doc_vecs shape: (n_docs, dim), query_vec shape: (dim,)

Tips to crack the Publicis Sapient Data Science interview

  • Revise Java or JavaScript fundamentals, microservices and REST APIs, which are common in Publicis Sapient engineering roles.
  • Prepare to discuss design patterns and clean code, as technical rounds often go beyond simple coding.
  • Read about its SPEED model of strategy, product, experience, engineering and data for culture questions.
  • 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; Publicis Sapient interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the Publicis Sapient Data Science interview?

Candidates usually go through 5 stages: Online coding assessment; Technical round 1 (coding + fundamentals); Technical round 2 (design or domain); Managerial 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 Publicis Sapient Data Science interview?

This practice set leans on Machine Learning (10), MLOps and Model Deployment (6), Deep Learning and NLP (6), Feature Engineering (4). Revise those first, then practise explaining one or two of your own projects end to end, because most Publicis Sapient interviewers ask you to walk through real work.

Are these the exact questions asked at Publicis Sapient?

No. These are curated practice questions that match the skills and difficulty usually tested in consulting interviews like Publicis Sapient's. They are not a leaked or verified list of past questions.

Where does Publicis Sapient hire Data Science professionals in India?

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

Data Science questions for similar companies