Model Evaluation and Validation Questions
Measuring whether a model is good enough to trust and ship. Covers metric selection for classification, regression, and ranking (precision/recall, ROC-AUC, calibration, RMSE), offline validation design, evaluation-metric-to-business-objective alignment, and production safety guardrails. Emphasizes choosing metrics that reflect real objectives and avoiding misleading evaluations.
Explain k-fold cross-validation and stratified k-fold cross-validation, and when you would prefer stratified k-fold over plain k-fold. Walk through a concrete example with severe class imbalance (roughly 1% positive rate) showing what can go wrong with plain random folds there.
Write a SQL query against a predictions log table (prediction_id, user_id, model_version, predicted_label, ground_truth_label, event_time) that computes daily precision and recall per model_version for the last 30 days, excluding rows with a null ground-truth label. Then explain how you would extend it to break the same metrics out per customer segment without re-scanning the full table for every segment.
Walk through precision, recall, specificity, F1 score, and accuracy for a binary classifier: what each measures, the formula in terms of TP/FP/TN/FN, and one realistic scenario where you would prioritize each over the others. Then explain how moving the decision threshold changes these numbers.
Explain how evaluation leakage can occur when you scale, impute, or otherwise preprocess features before splitting into train and validation folds in a scikit-learn workflow. Demonstrate, in code or pseudocode, how to structure a Pipeline so that preprocessing is fit only on training folds, and name the specific API features that help enforce this.
Define overfitting and underfitting, and explain how learning curves (training versus validation performance as a function of training-set size) let you tell them apart. Given a curve where training error stays low while validation error stays high and roughly flat, what's going on and what would you change? Then describe how the curves would look instead if the model were underfitting, and what you would do in that case.
Unlock Full Question Bank
Get access to all 15 Model Evaluation and Validation interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.