Supervised ML Fundamentals, Regularization, And Troubleshooting
Asked of: Machine Learning Engineer
Last updated

What's being tested
Candidates must demonstrate end-to-end supervised learning ownership: framing a regression/classification problem, choosing representations and model families, applying and reasoning about regularization, and diagnosing train/serve failures with evidence-driven fixes. Interviewers probe whether you can trade off model complexity, data-quality efforts, and monitoring needs in realistic production constraints for a Machine Learning Engineer role.
Core knowledge
-
Bias–variance tradeoff: high-capacity models reduce bias but increase variance; quantify with training vs validation error curves and expected generalization gap. Use learning curves to detect which regime you’re in.
-
Regularization families: L2 (weight decay) adds penalty , L1 encourages sparsity, dropout stochastically removes units, early stopping is an implicit regularizer; each has different effects on interpretability and sparsity.
-
Data augmentation & label smoothing: synthetic examples (e.g., SMILES augmentation, graph augmentations for molecules) increase effective data; label smoothing reduces overconfident predictions and improves calibration for classification.
-
Normalization & preprocessing: apply consistent pipelines (e.g., per-feature standardization, log-scaling) offline and in serving; record and version normalization params in
feature storeor model artifact. -
Loss choice & metrics: regression: MSE, MAE, RMSE, and R^2; pick loss matching business utility and noise (MAE less sensitive to outliers). For probabilistic outputs, evaluate NLL, sharpness, and calibration (reliability diagrams).
-
Model families & toolchain: tree models (
XGBoost,LightGBM) often excel with tabular features; neural graph models (PyTorch Geometric) suit molecular graphs; calibrate choices to dataset size (trees for <10M rows, deep nets for large, structured data). -
Diagnostics for data issues: check target leakage, duplicated examples, label noise, covariate shift (compare feature distributions via KS or population stability index), and missing-value mechanisms; instrument dataset lineage so you can reproduce problematic splits.
-
Hyperparameter search & validation: use nested cross-validation for model selection if dataset small; prefer a temporally-respecting holdout for time-dependent signals; budget Bayesian or asynchronous bandit search for large pipelines.
-
Uncertainty decomposition: distinguish aleatoric (noise in labels) vs epistemic (model uncertainty); use ensembles, MC Dropout, or Bayesian approaches to quantify epistemic uncertainty for active retraining.
-
Ensembling & calibration tradeoffs: ensembles (bagging, stacking) reduce variance but increase latency and maintenance; apply temperature scaling or isotonic regression to fix miscalibration post hoc.
-
Training/serving parity & drift monitoring: ensure same preprocessing and features in training and serving; deploy data-drift and label-drift monitors, and track training/online feature distribution, prediction distribution, and downstream metric regressions.
-
Regularization vs underfitting: don’t over-regularize; monitor both train and validation error. If both are high, add capacity or improve features rather than increase regularization.
Worked example — Design a reaction-factor prediction system
First 30 seconds: clarify the target (scalar reaction yield/regression or factor range), available inputs (molecular graphs, experimental conditions, dataset size, label noise), and production constraints (latency, retraining cadence). Organize your answer into four pillars: data & labeling, representation & features, model & training pipeline, and evaluation, deployment & monitoring. Data work: validate labels, deduplicate reactions, augment via chemically-valid transformations (e.g., alternate SMILES, graph augmentations), and compute domain-specific features (fingerprints, computed descriptors) stored in the feature store. Representation: evaluate both tabular (fingerprints + reaction conditions) with XGBoost and a graph neural network for pairwise molecular interactions; choose simpler model when dataset <100k examples. Training: implement weight decay, early stopping on validation RMSE, and mixup-like augmentations for regression (interpolating inputs/targets carefully only when chemically valid). Evaluation: use holdout test with scaffold-aware splits to avoid overoptimistic generalization; report RMSE, MAE, calibration plots, and uncertainty estimates via ensembles. Deployment: expose model behind a low-latency service, ensure identical preprocessing artifacts (serialize scalers/encoders), and monitor drift on reaction chemotype distributions plus downstream experimental success rates. Tradeoff to call out: complex GNNs may increase offline performance but cost latency and operational complexity — prefer a strong tree baseline plus targeted GNN for high-value predictions. Close: state you'll implement a rollout with shadow testing and A/B evaluation, then iterate on data labeling and uncertainty-driven active learning if model confidence is insufficient.
A second angle — Explain modeling challenges and fixes
Framing here shifts from design to diagnosis. Start by instrumenting: collect per-slice training/validation metrics, feature distributions, and model outputs. Common pillars are reproduce the failure, isolate cause (data/model/hyperparams/serving), then test a hypothesis (e.g., train on cleaned subset, remove suspect feature, or disable regularizer). Practical fixes include correcting label noise via human relabeling or noise-robust losses, reducing overfitting via stronger weight decay or augmentation, and restoring parity by aligning preprocessing in training and serving. Emphasize experiments that produce measurable improvements (e.g., val RMSE drop, calibration improvement) and guard against overfitting fixes to the validation set by using a fresh holdout or cross-validation.
Common pitfalls
Pitfall: confusing validation leakage with generalization — tuning hyperparameters on a test set gives optimistic estimates.
Always define separate train / validation / test sets; when performing many experiments, keep a final untouched test split or use nested CV.
Pitfall: blaming the model when the signal is missing — complex models amplify noisy labels.
If both training and validation errors are high, prioritize improving features, collecting cleaner labels, or changing loss (e.g., MAE) instead of increasing model capacity.
Pitfall: ignoring train/serve mismatch — production inputs undergo different preprocessing.
Version and serialize preprocessing artifacts (scalers, categorical maps) with the model; include end-to-end integration tests and synthetic shadow runs to validate parity.
Connections
Expect pivots to feature-store design and versioning, online learning / incremental update strategies, and model evaluation pipelines (CI for ML, continuous validation). Interviewers may also ask about deployment tradeoffs (latency vs ensemble size) or experiment design for model rollouts (ramp schedules, guardrail metrics).
Further reading
-
Deep Learning — Goodfellow et al., foundational for regularization and optimization principles.
-
mixup: Beyond Empirical Risk Minimization — original paper on input interpolation augmentation with practical tradeoffs.
Practice questions
- Design a reaction-factor prediction systemGoogle · Machine Learning Engineer · Technical Screen · hard
- Explain modeling challenges and fixesGoogle · Machine Learning Engineer · Technical Screen · medium
- List regularization methods and trade-offsGoogle · Machine Learning Engineer · Technical Screen · hard
- Explain ML model fundamentalsGoogle · Machine Learning Engineer · Onsite · hard
Related concepts
- Supervised ML Fundamentals, Evaluation And Feature EngineeringMachine Learning
- Supervised ML, Imbalance, Overfitting, And OptimizationMachine Learning
- ML Fundamentals: Backprop, Attention, And RLMachine Learning
- Logistic Regression, Regularization, And Imbalanced ClassificationMachine Learning
- ML Model Evaluation, Metrics, And ExperimentationML System Design
- Applied Machine Learning Modeling And EvaluationMachine Learning