Skip to content

Paytm Data Science Interview Questions & Answers

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

Solved for PaytmStart practicing
3 QUESTIONS FREESign up or log in 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 optimise a slow Pandas pipeline on a 5 GB file?

PaytmHard
Save to ▾
Show answer
Read in chunks or use usecols and dtypes, convert strings to category, avoid apply with row loops in favour of vectorised ops, and consider Polars, Dask or Parquet storage.
02

What is statistical power and how can you increase it?

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

What is TF-IDF?

PaytmMedium
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.
04

What is the difference between Bayesian and frequentist approaches?

PaytmHard
Save to ▾
Show answer
Frequentists treat parameters as fixed and use long-run frequencies; Bayesians treat parameters as distributions updated with data via priors and posteriors, giving direct probability statements.
05

Explain ROC curve and AUC.

PaytmMedium
Save to ▾
Show answer
The ROC curve plots true positive rate against false positive rate across thresholds. AUC is the probability that a random positive is ranked above a random negative; 0.5 is chance.
06

Explain Bayes' theorem with an example.

PaytmMedium
Save to ▾
Show answer
P(A given B) = P(B given A) x P(A) / P(B). In a medical test it converts test accuracy and disease prevalence into the real chance a positive result means disease.
07

L1 vs L2 regularisation?

PaytmMedium
Save to ▾
Show answer
L1 (Lasso) adds absolute weights and can shrink some to zero, giving feature selection. L2 (Ridge) adds squared weights and shrinks them smoothly without removing features.
08

What is the Central Limit Theorem?

PaytmMedium
Save to ▾
Show answer
The distribution of sample means approaches a normal distribution as the sample size grows (roughly 30+), whatever the population's shape. It lets us build confidence intervals and run hypothesis tests on means.
09

What is data leakage?

PaytmEasy
Save to ▾
Show answer
Information from outside the training window, such as future data or test statistics, enters training and inflates performance. Split first, then fit scalers and encoders on training data only.
10

What is the difference between a function and a method?

PaytmEasy
Save to ▾
Show answer
A method is a function that belongs to an object or class and receives the instance (self) as its first argument.
11

What is the difference between == and is?

PaytmEasy
Save to ▾
Show answer
== compares values for equality, while is checks whether two names point to the same object in memory. Use is mainly for None checks.
12

What is overfitting and how do you prevent it?

PaytmEasy
Save to ▾
Show answer
The model memorises noise and fails on new data. Prevent it with more data, simpler models, regularisation, cross-validation, early stopping and dropout.
13

Explain p-value in simple words.

PaytmEasy
Save to ▾
Show answer
The probability of seeing a result at least this extreme if the null hypothesis were true. A small p-value (for example < 0.05) is evidence against the null hypothesis.
14

Which activation functions do you know and when to use them?

PaytmMedium
Save to ▾
Show answer
ReLU for hidden layers, sigmoid for binary outputs, softmax for multi-class outputs and tanh when zero-centred outputs help; Leaky ReLU avoids dead neurons.
15

Write a function to calculate RMSE without any library.

PaytmEasy
Save to ▾
Show answer
def rmse(y, p): return (sum((a - b) ** 2 for a, b in zip(y, p)) / len(y)) ** 0.5
16

Difference between loc and iloc in Pandas?

PaytmEasy
Save to ▾
Show answer
loc selects by label (row and column names, inclusive of the end label); iloc selects by integer position (end-exclusive).
17

What are decorators in Python?

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

What is a RAG system and why use it?

PaytmHard
Save to ▾
Show answer
Retrieval-Augmented Generation fetches relevant documents and gives them to an LLM as context, reducing hallucination and keeping answers grounded in current private data.
19

What is a p-value?

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

What is standard deviation and what does it tell you?

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

What is the bias–variance trade-off?

PaytmMedium
Save to ▾
Show answer
Bias is error from overly simple assumptions (underfitting). Variance is sensitivity to the training data (overfitting). More model complexity lowers bias but raises variance — aim for the lowest total error using cross-validation and regularization.
22

What is gradient descent and what does the learning rate do?

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

What is transfer learning?

PaytmMedium
Save to ▾
Show answer
Reusing a model pretrained on a large dataset and fine-tuning it on a smaller task-specific dataset, saving data, time and compute.
24

How do you deal with high-cardinality categorical features?

PaytmMedium
Save to ▾
Show answer
Use target or frequency encoding with cross-validation, hashing, embeddings or grouping rare categories, instead of huge one-hot matrices.
25

What is a normal distribution?

PaytmEasy
Save to ▾
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations.
26

Explain precision vs recall. When would you prefer recall?

PaytmEasy
Save to ▾
Show answer
Precision = TP / (TP + FP). Recall = TP / (TP + FN). Prefer recall when missing a positive is costly — for example disease screening or fraud detection.
27

Explain logistic regression.

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

How do you deploy and monitor a machine learning model?

PaytmHard
Save to ▾
Show answer
Package the model behind an API with versioning, track latency and errors, monitor input drift and prediction quality, and automate retraining with rollback.
29

What is an autoencoder and what is it used for?

PaytmMedium
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

How does linear regression work and what are its assumptions?

PaytmMedium
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.
31

How do you detect and treat concept drift?

PaytmMedium
Save to ▾
Show answer
Monitor input distributions and live metrics, compare to training baselines, and retrain or recalibrate on fresh data when performance drops.
32

How do you pivot data in Pandas?

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

How do you perform feature selection?

PaytmMedium
Save to ▾
Show answer
Use filter methods (correlation, chi-square), wrapper methods (RFE), embedded methods (Lasso, tree importance) and domain knowledge, validating each choice with cross-validation.
34

Difference between a shallow copy and a deep copy?

PaytmMedium
Save to ▾
Show answer
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak.
35

Design an end-to-end churn prediction system.

PaytmHard
Save to ▾
Show answer
Define churn and the prediction window → build usage and billing features → handle imbalance → train gradient boosting → evaluate with PR-AUC and lift → explain with SHAP → deploy as batch scoring or an API → monitor drift → hand top-risk users to the retention team.
36

What is the difference between apply, map and applymap in Pandas?

PaytmMedium
Save to ▾
Show answer
map works element-wise on a Series, apply works on a Series or along a DataFrame axis, and applymap (now DataFrame.map) applies a function to every cell.
37

Explain the KNN algorithm and its drawbacks.

PaytmMedium
Save to ▾
Show answer
It predicts from the k nearest labelled points. It is simple but slow at prediction time, sensitive to scaling and irrelevant features, and weak in high dimensions.
38

What is the difference between mean, median and mode?

PaytmEasy
Save to ▾
Show answer
Mean is the average, median is the middle value after sorting and mode is the most frequent value. Median is more robust to outliers.
39

What is a neural network?

PaytmEasy
Save to ▾
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation.
40

What are RNNs and why did LSTMs improve them?

PaytmMedium
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.
41

What is the difference between an epoch, a batch and an iteration?

PaytmMedium
Save to ▾
Show answer
An epoch is one pass over the training data; a batch is the subset used for one update; an iteration is one weight update on a batch.
42

How does the Gini impurity differ from entropy?

PaytmMedium
Save to ▾
Show answer
Both measure node impurity; Gini is cheaper to compute and entropy is slightly more sensitive to class balance, with similar trees in practice.
43

What is calibration of a classifier?

PaytmMedium
Save to ▾
Show answer
Calibration checks whether predicted probabilities match real frequencies (e.g. 70% predictions are right about 70% of the time). Fix with Platt scaling or isotonic regression.
44

How do you remove duplicates from a DataFrame?

PaytmEasy
Save to ▾
Show answer
df.drop_duplicates(subset=[...], keep='first') removes repeated rows; use duplicated() first to inspect what will be dropped.
45

Explain the Law of Large Numbers.

PaytmMedium
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.
46

How do you handle imbalanced classes?

PaytmMedium
Save to ▾
Show answer
Use stratified splits, class weights, resampling such as SMOTE, threshold tuning and judge models with precision, recall, F1 or PR-AUC instead of accuracy.
47

What is PCA and when do you use it?

PaytmMedium
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.
48

Pandas: merge vs join vs concat?

PaytmMedium
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.
49

Pearson vs Spearman correlation?

PaytmEasy
Save to ▾
Show answer
Pearson measures linear relationships on continuous data; Spearman uses ranks, so it captures monotonic relationships and is less sensitive to outliers.
50

What are lambda functions and where are they useful?

PaytmMedium
Save to ▾
Show answer
Small anonymous one-line functions, handy as arguments to sort, map, filter or Pandas apply.
51

How do you tune hyperparameters?

PaytmMedium
Save to ▾
Show answer
Use grid search, random search or Bayesian optimisation with cross-validation, starting with a coarse random search and narrowing the promising ranges.
52

Type I vs Type II error?

PaytmEasy
Save to ▾
Show answer
Type I = false positive (rejecting a true null), probability α. Type II = false negative (missing a real effect), probability β. Power = 1 − β.
53

What is stacking in ensemble learning?

PaytmMedium
Save to ▾
Show answer
Training a meta-model on the predictions of several base models, often using cross-validated predictions to avoid leakage.
54

What is the Global Interpreter Lock (GIL)?

PaytmMedium
Save to ▾
Show answer
A mutex in CPython that lets only one thread execute Python bytecode at a time. Use multiprocessing for CPU-bound work and threads or asyncio for I/O-bound work.
55

What is the vanishing gradient problem?

PaytmMedium
Save to ▾
Show answer
Gradients shrink as they pass through many layers (for example with sigmoid), so early layers barely learn. ReLU, residual connections and good initialisation help.
56

What is the difference between regression and classification?

PaytmEasy
Save to ▾
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam.