Skip to content

Machine Learning Interview Questions in Kolkata

36 practice questions with answers for Machine Learning interviews in Kolkata.

Machine Learning jobs in Kolkata

Kolkata has a steady IT-services and BFSI technology job market around Salt Lake Sector V and New Town. Many openings are with service companies and their delivery centres, with a focus on strong fundamentals.

Below are 36 questions that match the mix of service, product and domain employers hiring machine learning engineers in Kolkata.

Solved for KolkataStart 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

What is polynomial regression and what risk does it carry?

Save to ▾
Show answer
Polynomial regression adds powers and interaction terms of features, such as x squared and x1 times x2, so a linear model can fit curves. It is still linear in its coefficients. The main risk is overfitting at high degrees, plus wild behaviour outside the training range. Use cross-validation to choose the degree, scale features, and combine it with Ridge regularisation.
02

How do you choose a classification threshold that maximises F1?

Save to ▾
Show answer
from sklearn.metrics import precision_recall_curve import numpy as np proba = clf.predict_proba(X_val)[:, 1] p, r, t = precision_recall_curve(y_val, proba) f1 = 2 * p * r / (p + r + 1e-9) best = t[np.argmax(f1[:-1])] print(best) Choose it on validation data, not the test set. scikit-learn 1.5+ also offers TunedThresholdClassifierCV.
03

What is the bias-variance trade-off?

Save to ▾
Show answer
Bias is error from overly simple assumptions, which causes underfitting. Variance is error from sensitivity to the particular training sample, which causes overfitting. Increasing model complexity usually lowers bias but raises variance. The goal is the complexity that minimises total test error. For example, a linear model on curved data has high bias, while a very deep unpruned tree has high variance.
04

Lasso dropped a feature the business considers very important. How do you handle it?

Save to ▾
Show answer
Lasso often keeps only one of a group of correlated features, so the dropped feature may be redundant rather than useless. I would check correlations, try Elastic Net which keeps correlated groups, and compare cross-validated performance with the feature forced in. I would explain the trade-off clearly; if the accuracy difference is small, keeping the feature for trust and interpretability is reasonable.
05

When should you use TimeSeriesSplit or GroupKFold instead of normal k-fold?

Save to ▾
Show answer
Use TimeSeriesSplit when data is ordered in time, so each validation fold comes after its training data and no future information leaks back. Use GroupKFold when multiple rows belong to the same entity, such as several visits per patient, so the same entity never appears in both train and validation. Normal k-fold in these cases gives over-optimistic scores.
06

Tell me about a time a production model failed and how you communicated it.

Save to ▾
Show answer
Situation: our daily scoring job silently produced all-zero scores for two days after an upstream column was renamed. Task: fix it and inform affected teams. Action: I rolled back to cached scores, patched the feature mapping, and sent a short note explaining impact, cause and fix. I then added schema validation and a check on score distribution. Result: the issue never repeated, and teams trusted our alerts more.
07

What is one-hot encoding and when can it cause problems?

Save to ▾
Show answer
One-hot encoding turns a categorical column into binary columns, one per category, so models do not assume order. It causes problems with high-cardinality features like city or product ID, creating thousands of sparse columns and higher memory and overfitting risk. Alternatives are target encoding, frequency encoding, hashing, or grouping rare categories into 'Other'. Use handle_unknown='ignore' for unseen categories.
08

A model's accuracy dropped 10 percent over three months in production. How do you investigate?

Save to ▾
Show answer
I would first check data pipelines for broken features, nulls or schema changes, then compare current feature distributions with training data using PSI to find drift. I would check whether the label definition or business process changed, and analyse errors by segment. If drift is real, retrain on recent data, possibly with time-weighted samples, and set up automatic drift alerts and scheduled retraining.
09

How do you implement simple gradient descent for linear regression in NumPy?

Save to ▾
Show answer
Compute predictions, the gradient of MSE, and update weights in a loop. import numpy as np w = np.zeros(X.shape[1]); b = 0.0; lr = 0.01 for _ in range(1000): err = X @ w + b - y w -= lr * (2 / len(y)) * (X.T @ err) b -= lr * (2 / len(y)) * err.sum() Scale features first or the loop converges slowly.
10

Random forest and LightGBM give the same AUC. Which would you deploy?

Save to ▾
Show answer
I would compare beyond AUC: model size, inference latency, training time, calibration and stability across time periods. LightGBM is usually smaller and faster to score, while random forest needs less tuning and is less prone to overfitting. If both are equal, I would choose the one that is cheaper to run and easier for the team to maintain and retrain.
11

Check calibration with a reliability curve and Brier score.

Save to ▾
Show answer
from sklearn.calibration import CalibrationDisplay from sklearn.metrics import brier_score_loss proba = clf.predict_proba(X_test)[:, 1] print('Brier', brier_score_loss(y_test, proba)) CalibrationDisplay.from_predictions(y_test, proba, n_bins=10) plt.show() Points on the diagonal mean predicted probabilities match observed frequencies.
12

An A/B test of a new recommendation model shows no significant uplift despite better offline metrics. What next?

Save to ▾
Show answer
I would check the test first: enough sample size and duration, correct randomisation, and no bugs in serving such as stale features. Then investigate whether offline metrics really reflect user value, for example optimising clicks rather than purchases, or popularity bias. Segment-level analysis may show gains in some groups. I would revise the offline metric to better match the online goal.
13

Your cross-validation score is 0.85 but the test score is 0.70. What could explain it?

Save to ▾
Show answer
Possible causes: leakage inside CV, such as preprocessing or feature selection fit outside folds; repeated tuning that overfit the CV folds; a test set from a different time period or population; or duplicate entities across folds but not test. I would check pipeline structure, switch to time-based or group splits that match how test data differs, and compare feature distributions between the two sets.
14

How do you keep learning new ML techniques while working full time?

Save to ▾
Show answer
I set a small weekly routine: one paper summary or library release note, and one hands-on experiment on a public dataset. I follow scikit-learn and LightGBM release notes, and I rebuild ideas on a small problem before suggesting them at work. Recently I tried TunedThresholdClassifierCV and later used it to replace a manual threshold script in our project.
15

Tell me about a time your model did not work as expected. What did you do?

Save to ▾
Show answer
Situation: my first churn model scored 0.95 AUC in validation but failed in a pilot. Task: find out why. Action: I traced features and found one field updated after customers left, which leaked the label. I removed it, rebuilt features with a strict cut-off date and moved to a time-based split. Result: AUC dropped to 0.78 but held steady in production, and I added a leakage checklist to my workflow.
16

Your team retrains models manually in notebooks every month. How would you improve it?

Save to ▾
Show answer
I would convert the notebook into a versioned training pipeline with separate steps for data extraction, validation, feature building, training and evaluation, scheduled with Airflow or a cloud pipeline. Each run would log to MLflow, compare against the production model on a fixed holdout, and register the new model only if it passes thresholds. Promotion would stay a reviewed step, at least initially.
17

How do you set up a basic train-test split with scikit-learn?

Save to ▾
Show answer
Use train_test_split with a fixed random_state for reproducibility and stratify for classification so class ratios match. from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=42, stratify=y ) For time series, avoid random splits and use the most recent period as the test set.
18

Build RFM features for customer segmentation in pandas.

Save to ▾
Show answer
snap = df['order_date'].max() + pd.Timedelta(days=1) rfm = df.groupby('customer_id').agg( recency=('order_date', lambda d: (snap - d.max()).days), frequency=('order_id', 'nunique'), monetary=('amount', 'sum')) rfm[['frequency', 'monetary']] = np.log1p(rfm[['frequency', 'monetary']]) Scale these columns before clustering.
19

What is multicollinearity and how do you detect it?

Save to ▾
Show answer
Multicollinearity is high correlation between input features, which makes linear model coefficients unstable and hard to interpret, though predictions may remain fine. Detect it with a correlation matrix or the Variance Inflation Factor, where VIF above 5 to 10 signals a problem. Fix it by dropping one of the correlated features, combining them, using PCA, or applying Ridge regularisation.
20

A business stakeholder asks you to use deep learning for a 5,000-row tabular dataset. How do you respond?

Save to ▾
Show answer
I would explain that for small tabular data, gradient-boosted trees or regularised linear models usually match or beat neural networks, train faster and are easier to explain. I would propose building a simple baseline, then a boosting model, and only test a neural network if there is a clear reason. I would show the comparison on cross-validated metrics so the decision is data-driven.
21

What is the difference between Ridge, Lasso and Elastic Net regression?

Save to ▾
Show answer
All add a penalty on coefficient size to reduce overfitting. Ridge uses an L2 penalty (sum of squares), shrinking coefficients toward zero but rarely to zero, and handles multicollinearity well. Lasso uses L1 (sum of absolute values) and can set coefficients exactly to zero, performing feature selection. Elastic Net mixes both, which is useful when there are groups of correlated features.
22

Your classifier works well overall but poorly for one customer segment. What do you do?

Save to ▾
Show answer
I would measure metrics per segment to confirm, then check if that segment is under-represented or has different feature distributions. Fixes include collecting more data, sample weighting, segment-specific features, or a separate model if the behaviour is truly different. If the segment relates to a protected attribute, I would also review fairness metrics and involve the compliance team.
23

Which hyperparameters matter most when tuning a gradient boosting model?

Save to ▾
Show answer
The key ones are learning_rate and number of trees, tuned together with early stopping; tree complexity through max_depth or num_leaves and min_child_samples; and randomness through subsample and colsample_bytree. Regularisation terms like lambda and alpha help on noisy data. A common approach is to fix a small learning rate such as 0.05, use early stopping for trees, then tune complexity.
24

How does a decision tree decide where to split?

Save to ▾
Show answer
At each node the tree tries candidate features and thresholds and picks the split that most reduces impurity in the child nodes. For classification, impurity is measured by Gini or entropy; for regression, by variance or MSE. The process repeats recursively until a stopping rule such as max_depth, min_samples_leaf or pure leaves is reached. This greedy approach is fast but not globally optimal.
25

What is heteroscedasticity and why does it matter?

Save to ▾
Show answer
Heteroscedasticity means the variance of residuals changes with the level of the prediction, such as errors growing for expensive houses. Predictions remain unbiased, but standard errors and p-values become unreliable. Detect it with a residuals versus fitted plot or the Breusch-Pagan test. Fixes include log-transforming the target, weighted least squares, or robust standard errors.
26

Log a training run to MLflow.

Save to ▾
Show answer
import mlflow, mlflow.sklearn mlflow.set_experiment('churn') with mlflow.start_run(): pipe.fit(X_train, y_train) auc = roc_auc_score(y_val, pipe.predict_proba(X_val)[:, 1]) mlflow.log_params({'C': 1.0, 'model': 'logreg'}) mlflow.log_metric('val_auc', auc) mlflow.sklearn.log_model(pipe, 'model', registered_model_name='churn-model')
27

Explain precision, recall and F1 score.

Save to ▾
Show answer
Precision is TP / (TP + FP): of the cases flagged positive, how many were right. Recall is TP / (TP + FN): of the actual positives, how many were found. F1 is the harmonic mean of the two and is low if either is low. Use precision when false alarms are costly, such as spam filters; use recall when misses are costly, such as cancer screening or fraud.
28

Why is feature scaling needed and which algorithms need it?

Save to ▾
Show answer
Scaling puts features on comparable ranges so that one large-valued feature does not dominate distances or gradients. Distance and gradient based models need it: k-NN, k-means, SVM, PCA, linear and logistic regression with regularisation, and neural networks. Tree-based models like random forest and XGBoost split on thresholds, so they are largely unaffected by scaling.
29

How do you build a scikit-learn pipeline for mixed numeric and categorical data?

Save to ▾
Show answer
Use ColumnTransformer inside a Pipeline so preprocessing is fit only on training folds. from sklearn.compose import ColumnTransformer from sklearn.pipeline import Pipeline from sklearn.impute import SimpleImputer from sklearn.preprocessing import StandardScaler, OneHotEncoder num = Pipeline([('imp', SimpleImputer(strategy='median')), ('sc', StandardScaler())]) pre = ColumnTransformer([ ('num', num, num_cols), ('cat', OneHotEncoder(handle_unknown='ignore'), cat_cols) ]) model = Pipeline([('pre', pre), ('clf', LogisticRegression(max_iter=1000))])
30

A product team wants 'similar products' recommendations with no purchase labels. How would you start?

Save to ▾
Show answer
I would build product embeddings from content: TF-IDF or sentence embeddings of titles and descriptions, plus category and price features. Then use cosine similarity with nearest-neighbour search, such as scikit-learn NearestNeighbors or an approximate index like FAISS for large catalogues. I would review samples with the product team and later add co-view or co-purchase signals once collected.
31

What is data drift and concept drift?

Save to ▾
Show answer
Data drift, or covariate shift, means the distribution of input features changes, such as average order value rising after a pricing change. Concept drift means the relationship between features and target changes, such as fraud patterns evolving. Data drift can be detected without labels using PSI or KS tests; concept drift usually needs labels and shows up as falling performance. Both trigger investigation and retraining.
32

A new model version performs badly right after release. How do you handle it?

Save to ▾
Show answer
Roll back immediately to the previous version from the model registry, which should be a one-step action. Then investigate: compare the input features served with those used in validation, check for training-serving skew, version mismatches or a wrong artifact. Add the failure case to automated pre-release checks, and use canary or shadow releases next time so issues affect only a small share of traffic.
33

Find the most similar items using cosine similarity.

Save to ▾
Show answer
from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.neighbors import NearestNeighbors X = TfidfVectorizer(min_df=2).fit_transform(df['title']) nn = NearestNeighbors(n_neighbors=6, metric='cosine').fit(X) dist, idx = nn.kneighbors(X[0]) print(df['title'].iloc[idx[0][1:]].tolist()) The first neighbour is the item itself, so skip it.
34

What is the softmax function?

Save to ▾
Show answer
Softmax turns a vector of raw scores into probabilities that sum to one: p_i = exp(z_i) / sum of exp(z_j). It is used in multinomial logistic regression and the output layer of neural networks for multiclass problems. Larger scores get exponentially larger shares. In practice the maximum score is subtracted before exponentiation to avoid numerical overflow.
35

Run DBSCAN and count clusters and noise points.

Save to ▾
Show answer
from sklearn.cluster import DBSCAN import numpy as np db = DBSCAN(eps=0.5, min_samples=10).fit(Xs) labels = db.labels_ n_clusters = len(set(labels)) - (1 if -1 in labels else 0) print(n_clusters, 'clusters,', np.sum(labels == -1), 'noise') Pick eps from the knee of a sorted k-nearest-neighbour distance plot.
36

Compare batch scoring and real-time inference.

Save to ▾
Show answer
Batch scoring runs on a schedule, for example nightly churn scores for all customers written to a table; it is simple, cheap and tolerant of slow models. Real-time inference returns predictions on request, such as fraud checks during payment, and needs low latency, high availability, scaling and fresh features. Choose real-time only when the decision must happen at the moment of the event.

Frequently asked questions

Which companies hire Machine Learning professionals in Kolkata?

Companies with large offices in Kolkata include many IT services and product firms. Use their company pages below to practise employer-specific sets.

Are Machine Learning interviews in Kolkata different from other cities?

The questions depend more on the company than the city. Kolkata's mix of employers decides the style: Many openings are with service companies and their delivery centres, with a focus on strong fundamentals

How do I find Machine Learning jobs in Kolkata?

Shortlist companies with Kolkata offices, keep your CV focused on Machine Learning projects, apply on company career pages and job portals with the Kolkata filter, and practise the questions on this page before each interview.