Skip to content

Machine Learning Interview Questions in Lucknow

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

Machine Learning jobs in Lucknow

Lucknow's tech job market is smaller but growing, led by IT-services delivery centres, government-tech projects and start-ups. Many Lucknow candidates target Noida and Gurgaon roles or remote jobs, so interviews follow the NCR pattern.

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

Solved for LucknowStart 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 the difference between a regression and a classification problem?

Save to ▾
Show answer
Regression predicts a continuous number, such as sales next month or delivery time in minutes. Classification predicts a discrete category, such as fraud or not fraud, or one of five product types. The choice decides the loss function and metrics: regression uses MSE, MAE or R-squared, while classification uses log loss, accuracy, precision, recall or AUC.
02

How do one-vs-rest and multinomial approaches differ for multiclass classification?

Save to ▾
Show answer
One-vs-rest trains one binary classifier per class against all others and picks the highest score; it is simple but probabilities may not sum to one. Multinomial (softmax) logistic regression models all classes jointly with a single loss, giving consistent probabilities. For metrics, use macro averaging to treat classes equally or weighted averaging to account for class frequency.
03

What is boosting and how is it different from bagging?

Save to ▾
Show answer
Boosting trains models sequentially, each one focusing on the errors of the combined previous models, which mainly reduces bias. Bagging trains models independently in parallel and averages them, which mainly reduces variance. Boosting uses shallow trees and a learning rate, and can overfit if run too long, so early stopping is important. Examples are AdaBoost, Gradient Boosting, XGBoost, LightGBM and CatBoost.
04

Your manager asks for a single number showing the model's business value. What do you give?

Save to ▾
Show answer
I would convert model outcomes into money or time using a cost matrix agreed with the business, for example savings from caught fraud minus the cost of reviewing false alerts. I would compare this against the current process or a rule-based baseline on holdout data and show a range rather than one point. A short note on assumptions keeps the number honest.
05

How do you interpret a coefficient in a multiple linear regression?

Save to ▾
Show answer
A coefficient is the expected change in the target for a one-unit increase in that feature, holding other features constant. For example, a coefficient of 2,500 on 'area in square metres' means each extra square metre adds about 2,500 to price. Interpretation breaks down with multicollinearity or when features are scaled, so report units clearly and check stability.
06

How do you build a text classifier with TF-IDF and logistic regression?

Save to ▾
Show answer
from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import LogisticRegression from sklearn.pipeline import make_pipeline clf = make_pipeline( TfidfVectorizer(ngram_range=(1, 2), min_df=2, sublinear_tf=True), LogisticRegression(max_iter=1000, class_weight='balanced') ) clf.fit(train_texts, train_labels) print(clf.score(test_texts, test_labels))
07

How do you approach a time series forecasting problem differently from normal regression?

Save to ▾
Show answer
Time series data is ordered and autocorrelated, so random splits leak future information. I use time-based splits or TimeSeriesSplit, create lag and rolling-window features from past values only, and handle trend and seasonality. Baselines like last value or seasonal naive come first. Models range from ARIMA and Prophet to gradient boosting on lag features.
08

What is the kernel trick?

Save to ▾
Show answer
The kernel trick computes dot products of data in a high-dimensional feature space without explicitly transforming the data, using a kernel function such as RBF, exp(-gamma times squared distance). This lets linear algorithms like SVM learn non-linear boundaries efficiently. In RBF SVMs, larger gamma makes each point's influence more local, which can lead to overfitting.
09

Tell me about a time you had to explain a model's error to a business team.

Save to ▾
Show answer
Situation: a sales forecast missed by 18 percent in one month. Task: explain why to the category team. Action: I broke the error down by region and found most came from a sudden promotion not in our data. I showed a simple chart and proposed adding a promotion calendar feed. Result: the team shared promotion plans in advance, and the next quarter's error fell below 8 percent.
10

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

Your house price model's residuals grow larger for expensive houses. What do you do?

Save to ▾
Show answer
That is heteroscedasticity, typical for price data that is right-skewed. I would model log(price) instead of price, which turns absolute errors into roughly percentage errors and stabilises variance. Then I would convert predictions back with exp and check residual plots again. Evaluating with RMSLE or MAPE also fits better when relative error matters more than absolute error.
12

Tell me about a time you took a model from notebook to production.

Save to ▾
Show answer
Situation: our demand model ran only in a notebook on my laptop. Task: make it run daily for 300 stores. Action: I refactored it into modules with a scikit-learn pipeline, added tests and input checks, containerised it with Docker and scheduled it with Airflow writing forecasts to the warehouse. Result: forecasts became available by 6 a.m. daily without manual work, and failures triggered alerts instead of silent gaps.
13

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

How do you choose the number of clusters k?

Save to ▾
Show answer
Common methods are the elbow method, plotting inertia against k and looking for the bend; the silhouette score, which measures how close points are to their own cluster versus the next one; and the gap statistic. Business usability matters too: four clear segments a marketing team can act on are better than nine statistically optimal but confusing ones.
15

How do you tune the alpha of Ridge regression using cross-validation?

Save to ▾
Show answer
RidgeCV tests many alphas efficiently; scale features first. from sklearn.linear_model import RidgeCV from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler import numpy as np m = make_pipeline(StandardScaler(), RidgeCV(alphas=np.logspace(-3, 3, 30))) m.fit(X_train, y_train) print(m[-1].alpha_) LassoCV and ElasticNetCV work the same way.
16

Use statsmodels to get p-values for regression coefficients.

Save to ▾
Show answer
import statsmodels.api as sm Xc = sm.add_constant(X_train) ols = sm.OLS(y_train, Xc).fit() print(ols.summary()) The summary shows coefficients, standard errors, p-values, confidence intervals, R-squared and diagnostics. scikit-learn focuses on prediction and does not report p-values, so statsmodels is preferred for inference.
17

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

Visualise a small decision tree and its rules.

Save to ▾
Show answer
from sklearn.tree import DecisionTreeClassifier, export_text, plot_tree import matplotlib.pyplot as plt dt = DecisionTreeClassifier(max_depth=3, random_state=0).fit(X_train, y_train) print(export_text(dt, feature_names=list(X_train.columns))) plot_tree(dt, feature_names=X_train.columns, filled=True) plt.show() Shallow trees are a good way to explain rules to business teams.
19

A demand forecast is consistently under-predicting during festivals. How would you fix it?

Save to ▾
Show answer
The model lacks festival information. I would add features for festival dates such as Diwali or regional holidays, days-to-festival, and past festival uplift for the same item. If the business cost of stock-outs is higher than over-stock, I would use a quantile loss for a higher percentile. Then validate specifically on past festival periods, not just the average error.
20

You must build a spam classifier quickly with limited compute. What do you choose?

Save to ▾
Show answer
I would use TF-IDF features with a Multinomial Naive Bayes or linear model like logistic regression or LinearSVC. They train in seconds, handle high-dimensional sparse text well and give strong baselines. I would evaluate precision carefully because blocking genuine mail is costly. Only if this is not good enough would I try fine-tuning a small transformer model.
21

What is the difference between label encoding and ordinal encoding?

Save to ▾
Show answer
Both map categories to integers. In scikit-learn, LabelEncoder is meant for the target variable, while OrdinalEncoder is for input features. Integer encoding implies an order, so it is fine for truly ordered values like low, medium, high, or for tree models, but it can mislead linear models on nominal data like colours. For nominal features with linear models, prefer one-hot encoding.
22

Use HistGradientBoosting with native categorical support in scikit-learn.

Save to ▾
Show answer
from sklearn.ensemble import HistGradientBoostingClassifier clf = HistGradientBoostingClassifier( categorical_features='from_dtype', max_iter=500, learning_rate=0.05, early_stopping=True, random_state=42) X_train[cat_cols] = X_train[cat_cols].astype('category') clf.fit(X_train, y_train) It handles missing values natively and is much faster than GradientBoostingClassifier on large data.
23

Why does L1 regularisation produce sparse models while L2 does not?

Save to ▾
Show answer
The L1 constraint region is a diamond with corners on the axes, so the optimal point often lands on a corner where some coefficients are exactly zero. The L2 region is a circle with no corners, so coefficients shrink smoothly but stay non-zero. In gradient terms, L1 applies a constant push toward zero regardless of size, while L2's push becomes tiny as weights get small.
24

Describe a project where you improved a model's performance significantly.

Save to ▾
Show answer
Situation: a product-return prediction model had 0.68 AUC with logistic regression. Task: improve it for a warehouse pilot. Action: I engineered features like past return rate per customer and category, moved to LightGBM with early stopping, and tuned it with Optuna on time-based folds. Result: AUC rose to 0.81, and the pilot reduced avoidable returns in two categories. I documented each step's gain.
25

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

k-means gives one huge cluster and several tiny ones. What could be wrong?

Save to ▾
Show answer
Likely causes are unscaled features, where one large-range feature dominates distance; heavy skew or outliers pulling centroids; or data that is not naturally spherical. I would log-transform and scale features, remove or cap extreme outliers, and try different k values. If shapes are irregular, DBSCAN, HDBSCAN or a Gaussian Mixture Model may fit better.
27

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

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

How does a support vector machine work?

Save to ▾
Show answer
An SVM finds the hyperplane that separates classes with the maximum margin, and the points on the margin are the support vectors. The soft-margin version uses C to trade off margin width against misclassification. Kernels like RBF or polynomial let SVMs learn non-linear boundaries by implicitly mapping data to higher dimensions. SVMs need scaled features and become slow beyond roughly a hundred thousand rows.
30

Why do you want to work as a machine learning engineer?

Save to ▾
Show answer
I enjoy turning data into decisions that people actually use. During my projects I liked the full cycle: framing the problem, cleaning messy data, comparing models and explaining results. ML engineering lets me combine coding with statistics and see measurable business impact, such as reducing manual review time. I also want to keep growing into deployment and monitoring, which I am already practising with FastAPI and Docker.
31

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

What are learning curves and validation curves?

Save to ▾
Show answer
A learning curve plots training and validation scores against training set size; if both converge at a low score the model underfits, and if a gap remains, more data may help. A validation curve plots scores against one hyperparameter, such as max_depth, showing where overfitting starts. Both help decide whether to collect data, add features or change complexity.
33

What makes XGBoost, LightGBM and CatBoost different?

Save to ▾
Show answer
XGBoost adds regularisation to the objective, uses second-order gradients and handles missing values natively. LightGBM grows trees leaf-wise and uses histogram binning, making it very fast on large data, though it can overfit small data. CatBoost handles categorical features with ordered target statistics and uses symmetric trees, giving strong defaults with less tuning. All three support GPU training.
34

Compute permutation importance on validation data.

Save to ▾
Show answer
from sklearn.inspection import permutation_importance import pandas as pd r = permutation_importance(model, X_val, y_val, n_repeats=10, scoring='roc_auc', random_state=42, n_jobs=-1) imp = pd.Series(r.importances_mean, index=X_val.columns) print(imp.sort_values(ascending=False)) Near-zero or negative values mean the feature adds little on unseen data.
35

Marketing wants customer segments for campaigns. How do you approach it?

Save to ▾
Show answer
I would agree on the purpose first, such as retention or upsell. Then build RFM features (recency, frequency, monetary) plus category preferences, log-transform skewed values and scale them. I would try k-means for k between 3 and 8, use silhouette and business review to pick k, profile each segment and give them clear names. Finally, test segment-based campaigns against a control group.
36

40 percent of values in an important income column are missing. What do you do?

Save to ▾
Show answer
I would study the missingness pattern first, for example whether self-employed applicants skip it. I would add a binary was_missing feature, impute with the median within relevant groups or use IterativeImputer, and compare against models that handle missing values natively, like HistGradientBoosting or XGBoost. I would also raise the issue with the data owner so collection can improve.

Few big employers listed in Lucknow?

Many Lucknow candidates also apply to teams in Noida and to remote or hybrid roles. Practise the Noida set as well.

Frequently asked questions

Which companies hire Machine Learning professionals in Lucknow?

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

Are Machine Learning interviews in Lucknow different from other cities?

The questions depend more on the company than the city. Lucknow's mix of employers decides the style: Many Lucknow candidates target Noida and Gurgaon roles or remote jobs, so interviews follow the NCR pattern

How do I find Machine Learning jobs in Lucknow?

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