Google Machine Learning Interview Questions & Answers
Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About Google hiring for Machine Learning roles
Google, part of Alphabet, builds products such as Search, YouTube, Android, Google Cloud, Maps and Pay. Its Indian offices contribute to engineering, cloud, payments and research work for local and global products. It hires in India for software engineers, test and reliability engineers, data scientists and analysts who work on large-scale data and experimentation.
For Machine Learning roles, this Google practice set focuses most on Model Evaluation and Tuning (7), Decision Trees and Ensembles (6), MLOps and Deployment (4), Regression Models (4). It has 2 easy, 17 medium, 11 hard questions, so you can start easy and work up to the harder ones.
Company type
Product
Headquarters
Mountain View, California, USA
Main India offices
Bengaluru, Hyderabad, Gurugram, Mumbai, Pune
Google Machine Learning interview process
Recruiter screening
Online coding assessment or phone screen
Technical interviews (coding, 3-4 rounds)
Googleyness and leadership round
Hiring committee review
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for GoogleStart 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 manager asks for a single number showing the model's business value. What do you give?
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.
02
How would you build a quick baseline before trying complex models?
Use a DummyClassifier or DummyRegressor to see the score of a trivial guess, then a simple model.
from sklearn.dummy import DummyClassifier
base = DummyClassifier(strategy='most_frequent')
base.fit(X_train, y_train)
print(base.score(X_test, y_test))
Any real model must clearly beat this number; otherwise the features carry little signal.
03
A new model has slightly better AUC but worse precision in the top 1,000 cases the team acts on. Which do you pick?
I would pick the model that does better where decisions are actually made. If the team only reviews the top 1,000 cases, precision at 1,000 or recall at that cut-off matters more than global AUC. I would make that the primary metric in future comparisons, and confirm the result holds across several time periods before switching.
04
Which hyperparameters matter most when tuning a gradient boosting model?
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.
import lightgbm as lgb
m = lgb.LGBMClassifier(n_estimators=5000, learning_rate=0.05,
num_leaves=31, subsample=0.8, subsample_freq=1, colsample_bytree=0.8)
m.fit(X_train, y_train, eval_set=[(X_val, y_val)],
eval_metric='auc', callbacks=[lgb.early_stopping(100)])
print(m.best_iteration_)
The large n_estimators is only an upper limit; early stopping picks the real number.
06
Your model must run on a mobile app with no internet. What do you consider?
Model size, memory and latency on low-end phones become key. I would choose a compact model, reduce features, and convert it to a mobile format such as ONNX, TensorFlow Lite or Core ML, applying quantisation if needed. I would make sure all preprocessing is replicated on-device, test accuracy after conversion, and plan how model updates will ship with app releases.
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.
08
Business users do not trust a gradient boosting model because it is a black box. How do you help?
I would use SHAP to show global drivers with a summary plot and explain individual decisions with waterfall plots, such as why one applicant got a high risk score. I would also check that the top drivers make business sense, add monotonic constraints where logic requires it, and share a few real case examples. If trust is still an issue, a scorecard model can serve as a transparent benchmark.
09
Compute permutation importance on validation data.
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.
10
What is Local Outlier Factor and how does it differ from Isolation Forest?
Local Outlier Factor compares the local density of a point with the density of its neighbours; a point in a much sparser area than its neighbours gets a high outlier score. It catches local anomalies inside varied-density data but is distance-based, so it needs scaling and is slower on large data. Isolation Forest is tree-based, faster and scales better, but is less sensitive to local density differences.
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.
13
How do you handle pressure to report better model numbers than the data supports?
I explain the risk clearly: inflated numbers lead to bad decisions and lose trust when production results arrive. I present the honest metric with confidence intervals, and then offer a concrete plan to improve it, such as new data sources. In one case I showed that a 'better' number came from leakage, and leadership agreed to report the lower but reliable figure.
14
How do you evaluate clustering when there are no labels?
Use internal metrics: silhouette score, Davies-Bouldin index (lower is better) and Calinski-Harabasz index (higher is better). Check stability by re-clustering on bootstrap samples. Most important is external usefulness: profile each cluster with key statistics and check whether business teams find the segments distinct and actionable, for example different response to a campaign.
15
How do one-vs-rest and multinomial approaches differ for multiclass classification?
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.
16
Grid search with 5 hyperparameters is taking two days. How do you speed it up?
Switch to random search or Optuna with pruning, which find good settings with far fewer trials. Narrow ranges using a quick coarse search, tune the most important parameters first, use early stopping for boosting, run trials in parallel with n_jobs, and tune on a stratified sample of the data before a final refit on the full set. HalvingRandomSearchCV is another quick option.
17
You need prediction intervals, not just point estimates, for delivery time. How?
Options are quantile regression, training separate models for the 10th and 90th percentiles with GradientBoostingRegressor(loss='quantile') or LightGBM; conformal prediction, which wraps any model and gives intervals with guaranteed coverage; or bootstrapping. I would check calibration: about 80 percent of actual values should fall within an 80 percent interval on a holdout set.
18
Use statsmodels to get p-values for regression coefficients.
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.
19
Tell me about a time your model did not work as expected. What did you do?
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.
20
What is heteroscedasticity and why does it matter?
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.
21
What is target encoding and how do you avoid leakage with it?
Target encoding replaces each category with the mean target value for that category, which works well for high-cardinality features. It leaks if computed on the full data because each row sees its own label. Avoid this by computing encodings out-of-fold within cross-validation and adding smoothing toward the global mean for rare categories. scikit-learn 1.3+ has TargetEncoder with built-in cross-fitting.
22
What is k-fold cross-validation and why is it better than a single split?
k-fold cross-validation splits training data into k folds, trains on k-1 folds and validates on the remaining one, repeating k times so every row is validated once. Averaging the k scores gives a more stable estimate than one random split and shows variance across folds. Five or ten folds are common. Use StratifiedKFold for classification and GroupKFold when rows from one user must stay together.
from sklearn.model_selection import LearningCurveDisplay
import numpy as np
LearningCurveDisplay.from_estimator(model, X, y, cv=5,
train_sizes=np.linspace(0.1, 1.0, 6), scoring='roc_auc', n_jobs=-1)
plt.show()
A persistent gap between curves suggests more data or regularisation; two low curves suggest a richer model or better features.
24
You need to detect unusual transactions but have no fraud labels. What do you do?
I would start with unsupervised anomaly detection: Isolation Forest or Local Outlier Factor on features like amount relative to the customer's usual spend, time of day, new device and merchant risk. I would set the threshold based on what the review team can handle, collect investigator feedback as labels, and move to a supervised model once enough labelled cases exist.
25
Your tree model predicts higher risk for customers with higher income, which is illogical. What do you do?
First check whether data supports it, perhaps due to confounding or a small segment. If the relationship should be one-directional for business or regulatory reasons, I would apply monotonic constraints, available in XGBoost, LightGBM and HistGradientBoosting, so risk can only decrease with income. Then compare validation metrics; usually the loss is small and the model becomes more trustworthy.
26
How do you choose a classification threshold that maximises F1?
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.
27
How do you approach a time series forecasting problem differently from normal regression?
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.
28
Get a bootstrap confidence interval for a test metric.
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.
30
Describe a project where you improved a model's performance significantly.
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.
Tips to crack the Google Machine Learning interview
Practise solving DSA problems in a plain document without autocomplete, since Google interviews often use a shared editor without running code.
For data science roles, revise statistics, A/B testing and product metrics for products like YouTube, Search or Google Pay.
Prepare examples showing collaboration, handling ambiguity and doing the right thing, which the Googleyness round tends to explore.
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; Google interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the Google Machine Learning interview?
Candidates usually go through 5 stages: Recruiter screening; Online coding assessment or phone screen; Technical interviews (coding, 3-4 rounds); Googleyness and leadership round; Hiring committee review. 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 Google Machine Learning interview?
This practice set leans on Model Evaluation and Tuning (7), Decision Trees and Ensembles (6), MLOps and Deployment (4), Regression Models (4). Revise those first, then practise explaining one or two of your own projects end to end, because most Google interviewers ask you to walk through real work.
Are these the exact questions asked at Google?
No. These are curated practice questions that match the skills and difficulty usually tested in product interviews like Google's. They are not a leaked or verified list of past questions.
Where does Google hire Machine Learning professionals in India?
Google has large teams in Bengaluru, Hyderabad, Gurugram, Mumbai, Pune. Openings and locations change often, so check the Google careers page and filter by city and experience.