Nagarro Data Science Interview Questions & Answers
Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About Nagarro hiring for Data Science roles
Nagarro is a digital engineering and technology consulting company with a large workforce in India. It works on custom software, digital product engineering, testing, cloud and data projects for clients in Europe, North America and other regions. In India it hires for software engineers, test engineers and data professionals.
For Data Science roles, this Nagarro practice set focuses most on Machine Learning (7), Python for Data Science (6), Statistics and Probability (6), Deep Learning and NLP (5). It has 18 easy, 21 medium, 1 hard questions, so you can start easy and work up to the harder ones.
Company type
IT services
Headquarters
Munich, Germany
Main India offices
Gurugram, Jaipur
Nagarro Data Science interview process
Online assessment (aptitude + reasoning)
Coding test
Technical interview
Managerial or HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for NagarroStart 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
Your LLM gives different summaries for the same document on different runs, but auditors need consistent output. What do you do?
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.
02
What is a model registry and why do teams use one?
A model registry is a central store for trained model versions along with their metadata: training data version, code commit, parameters, metrics and owner. Models move through stages such as staging, production and archived, with approvals. It gives one source of truth for which model is live, makes rollback to a previous version easy and supports audits. Tools like MLflow Model Registry are commonly used.
03
Write Keras code for a small binary classifier on tabular data.
In zero-shot prompting you give only instructions, like classify this review as positive or negative. In few-shot prompting you also include a few worked examples of input and correct output, which shows the model the format and decision boundary. Few-shot usually improves consistency on custom labels, at the cost of more tokens. Pick examples that cover tricky cases and keep their format identical to what you want back.
During training it randomly switches off a fraction of neurons so the network cannot depend on any single unit, acting as a regulariser against overfitting.
06
Write SQL to find customers who ordered in January 2026 but not in February 2026.
SELECT DISTINCT o.customer_id
FROM orders o
WHERE o.order_date >= '2026-01-01' AND o.order_date < '2026-02-01'
AND NOT EXISTS (
SELECT 1 FROM orders f
WHERE f.customer_id = o.customer_id
AND f.order_date >= '2026-02-01' AND f.order_date < '2026-03-01'
);
07
Your dataset is highly imbalanced (2% positives). How do you handle it?
Use stratified splits, class weights, resampling (SMOTE or undersampling) and threshold tuning, and judge the model with PR-AUC or F1 instead of accuracy.
08
A product manager wants to test five different button designs at the same time. How do you set it up?
Run an A/B/n test with control plus five variants and equal random allocation. Calculate sample size for the smallest effect worth detecting, remembering that each variant gets only a sixth of traffic, so the test takes longer. Plan the analysis upfront: compare each variant to control and adjust for multiple comparisons. If the team has strong priors, test fewer designs first to save time.
09
What is the difference between regression and classification?
A dataclass, created with the @dataclass decorator, automatically generates __init__, __repr__ and __eq__ from annotated fields. It is a clean way to hold structured records such as a training config with learning rate, batch size and paths. Options like frozen=True make instances immutable, and default values reduce boilerplate. Compared with plain dictionaries, dataclasses give attribute access, type hints and clearer errors when a field is misspelled.
11
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
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.
The ADF test checks whether a series has a unit root, which means it is non-stationary. The null hypothesis is that a unit root exists. A small p-value, say below 0.05, lets you reject the null and treat the series as stationary. It is often paired with the KPSS test, whose null is the opposite, stationarity. Using both gives a more reliable conclusion before choosing how much to difference.
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data.
15
What is the difference between an epoch, a batch and an iteration?
Both control randomness when the model picks the next token. Temperature scales the probabilities: low values like 0 to 0.3 make output focused and repeatable, high values make it more varied and creative. Top-p, nucleus sampling, keeps only the smallest set of tokens whose probabilities add up to p, such as 0.9, and samples from them. For extraction and classification use low temperature; for brainstorming use higher values.
17
What is gradient descent and what does the learning rate do?
An optimisation method that updates weights in the opposite direction of the loss gradient. The learning rate sets the step size: too high and it diverges, too low and it is slow. Variants include SGD, mini-batch and Adam.
18
Train accuracy is 95% but test accuracy is 70%. What do you do?
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.
19
What is standard deviation and what does it tell you?
It checks whether observed category counts differ from expected counts, used for independence between two categorical variables and for goodness of fit.
21
Write SQL to find the second highest salary in an employees table.
SELECT MAX(salary) AS second_highest
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
-- alternative with window function
SELECT DISTINCT salary
FROM (SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk
FROM employees) t
WHERE rnk = 2;
22
What is the difference between saving a model with pickle, joblib and ONNX?
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.
23
What is correlation and why does it not imply causation?
Correlation measures linear association between variables (-1 to 1). A third factor, reverse causality or chance can create it, so causation needs controlled experiments.
24
Write Python code to count word frequencies in a text and print the top 5 words.
from collections import Counter
import re
def top_words(text, n=5):
words = re.findall(r'[a-z]+', text.lower())
return Counter(words).most_common(n)
print(top_words('Data science is fun and data is everywhere'))
25
Write a Python function to flatten a nested list of any depth.
def flatten(items):
out = []
for x in items:
if isinstance(x, list):
out.extend(flatten(x))
else:
out.append(x)
return out
print(flatten([1, [2, [3, 4]], 5])) # [1, 2, 3, 4, 5]
26
Pandas: convert wide monthly columns into a long format table.
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.
Gradients shrink as they pass through many layers (for example with sigmoid), so early layers barely learn. ReLU, residual connections and good initialisation help.
29
Write Python code to compare revenue per user between two groups using Welch's t-test.
Situation: after presenting a retention report, I noticed I had counted test accounts as users. Task: correct it before decisions were made. Action: I reran the numbers that evening, informed my manager and the audience with a short note showing old and new figures and what changed, and added a filter and a check to the shared query. Result: the conclusion held with smaller numbers, and the team valued the transparency.
31
What is the difference between supervised and unsupervised learning?
Supervised learning trains on labelled data to predict a target; unsupervised learning finds structure such as clusters or components in unlabelled data.
32
What are quantile and power transforms such as Box-Cox and Yeo-Johnson, and when do you use them?
Power transforms reshape a skewed feature to look more normal. Box-Cox needs strictly positive values, while Yeo-Johnson also handles zero and negative values; both learn a lambda parameter from training data. A quantile transform maps values to a uniform or normal distribution by rank, which is robust to outliers. They help linear models, distance-based methods and neural networks, but tree models rarely need them.
33
Write torchvision transforms for training and validation of an image classifier using ImageNet normalisation.
A two-tailed test checks for a difference in either direction, for example whether a new page changes conversion up or down. A one-tailed test checks only one direction, such as whether it increases conversion. One-tailed tests have more power for that direction but ignore harm in the other direction. In most product experiments a two-tailed test is the safer default unless the direction was fixed before seeing data.
One-hot encoding creates a binary column per category and suits nominal data like city for linear models. Label encoding maps categories to integers arbitrarily; it is fine for tree models but implies a false order for linear models. Ordinal encoding also uses integers but in a meaningful order, like low, medium, high mapped to 0, 1, 2. Choose based on whether categories have a natural order and which model you use.
37
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.
It tries candidate splits and picks the one that most reduces impurity — Gini or entropy (information gain) for classification, variance / MSE for regression.
39
What are type hints in Python and why do data teams use them?
Type hints annotate expected types, for example def clean(df: pd.DataFrame, cols: list[str]) -> pd.DataFrame. Python does not enforce them at runtime, but tools like mypy and IDEs use them to catch mistakes early and give better autocomplete. In data teams they make shared pipeline code easier to read and review. They matter most in production code and libraries, less in quick exploratory notebooks.
40
Write Python code using Hugging Face transformers to run sentiment analysis on a list of reviews.
from transformers import pipeline
clf = pipeline(
'sentiment-analysis',
model='distilbert-base-uncased-finetuned-sst-2-english'
)
reviews = ['Delivery was fast and the product is great',
'Packaging was damaged and support did not reply']
for text, out in zip(reviews, clf(reviews, batch_size=16)):
print(out['label'], round(out['score'], 3), '-', text)
Tips to crack the Nagarro Data Science interview
Practise coding questions along with logical reasoning, as Nagarro assessments usually combine both.
Learn about Nagarro's flat, entrepreneurial culture and its CARING values for behavioural answers.
Be ready to explain testing approaches and agile practices, since many projects follow agile delivery with distributed teams.
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; Nagarro interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the Nagarro Data Science interview?
Candidates usually go through 4 stages: Online assessment (aptitude + reasoning); Coding test; Technical interview; Managerial or 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 Nagarro Data Science interview?
This practice set leans on Machine Learning (7), Python for Data Science (6), Statistics and Probability (6), Deep Learning and NLP (5). Revise those first, then practise explaining one or two of your own projects end to end, because most Nagarro interviewers ask you to walk through real work.
Are these the exact questions asked at Nagarro?
No. These are curated practice questions that match the skills and difficulty usually tested in it services interviews like Nagarro's. They are not a leaked or verified list of past questions.
Where does Nagarro hire Data Science professionals in India?
Nagarro has large teams in Gurugram, Jaipur. Openings and locations change often, so check the Nagarro careers page and filter by city and experience.