Machine Learning Engineer (MLE) roles are among the most competitive and highest-paying in Indian tech. Google India, Amazon India, Flipkart, Swiggy, Razorpay, and a growing number of AI-first startups actively hire MLEs. This guide covers the complete ML engineer interview preparation path for 2026: algorithms, system design, and Python coding.
Core ML algorithm interview questions
ML algorithm interview questions:
1. 'What is the bias-variance trade-off?' Bias: error from wrong assumptions (underfitting); model too simple to capture the true pattern. High bias: high training error AND high test error. Fix: more complex model, more features, less regularisation. Variance: error from over-sensitivity to training data (overfitting); model captures noise. High variance: low training error but high test error. Fix: more data, regularisation, dropout, ensemble methods, simpler model.
2. 'Explain gradient descent. What is the difference between batch, mini-batch, and SGD?' Gradient descent iteratively updates parameters in the direction of steepest descent of the loss function. Batch GD: computes gradient over the entire dataset per update; slow but stable. SGD: one training example per update; fast but noisy. Mini-batch GD: small batch (32-512 examples); balances speed and stability; the default for deep learning.
3. 'What is regularisation? L1 vs L2?' L1 (Lasso): penalty = sum of |weights|; can drive weights to exactly zero (feature selection). L2 (Ridge): penalty = sum of squared weights; shrinks all weights but rarely to zero.
4. 'When would you use random forest vs XGBoost?' Random forest: bagging (parallel trees); robust to outliers; easy to tune. XGBoost/LightGBM: boosting (sequential trees, each correcting the previous); typically higher accuracy; more hyperparameters. In Indian industry: XGBoost dominates for structured/tabular data (fraud scoring, credit risk, demand forecasting).
5. 'What is cross-validation and why is it used?' K-fold cross-validation: split the dataset into K folds; train on K-1 folds and evaluate on the held-out fold; repeat K times; average the scores. Purpose: gives a more reliable estimate of model performance than a single train-test split.
ML system design and Python interview questions
ML system design interview questions:
1. 'Design a recommendation system for Flipkart.' Offline training: collaborative filtering (users who bought X also bought Y), content-based filtering (item feature similarity), and matrix factorisation (user-item embeddings). Feature store: precomputed user and item features stored in Redis for sub-10ms serving latency. Online serving: candidate generation (retrieve 500-1000 items from an approximate nearest neighbour index, e.g. FAISS or ScaNN), ranking (gradient boosting model scoring each candidate on purchase probability), filtering (out-of-stock, already-purchased), and A/B testing.
2. 'Design a fraud detection system for Razorpay.' Real-time scoring: each payment scored before authorisation (P99 latency under 50ms). Features: transaction amount vs user's historical baseline (z-score), device fingerprint novelty score, time since last transaction, merchant category risk score. Model: gradient boosting (offline trained weekly on labelled fraud data). Decision thresholds: score above T1 flags for human review; score above T2 auto-blocks.
Python and model evaluation interview questions:
3. 'What is the difference between L1 and L2 loss?' L1 (MAE): |y - yhat|. Robust to outliers. L2 (MSE): (y - yhat)^2. Sensitive to outliers (squared penalty amplifies large errors).
4. 'How do you evaluate a classifier beyond accuracy?' Precision: TP / (TP + FP). Recall: TP / (TP + FN). F1: harmonic mean of precision and recall. AUC-ROC: model's ability to discriminate between classes at all thresholds. PR curve: better than ROC for class-imbalanced datasets (fraud detection with 0.1% positive rate).
5. 'What is the train-validation-test split and why do you need all three?' Training set: fit the model. Validation set: tune hyperparameters and select the best model. Test set: final unbiased evaluation. The test set must not be used for any decision during model development; otherwise it gives an optimistic estimate of real-world performance.
Frequently asked questions
Explore more