InterviewStack.io LogoInterviewStack.io

Handling Class Imbalance Questions

Addressing scenarios where one class significantly outnumbers others (common in fraud, churn, disease detection). Problems: accuracy becomes misleading (95% accuracy can be trivial if 95% are negative class), model biased toward majority class. Solutions: Resampling (undersampling majority, oversampling minority, or SMOTE), adjusting class weights in loss function, choosing appropriate metrics (F1, precision-recall instead of accuracy), ensemble methods. For junior level, recognize imbalance problems, understand why accuracy fails, and know multiple approaches to handling it.

EasyTechnical
51 practiced
Contrast unsupervised anomaly detection with supervised imbalanced classification. For a fraud detection product with very limited labeled fraud samples, discuss when an unsupervised anomaly detector is preferable, and how you would evaluate and combine both approaches in production.
MediumTechnical
48 practiced
Describe a robust algorithm to choose a decision threshold that maximizes recall subject to a minimum precision constraint (e.g., precision >= 90%). Provide step-by-step procedure using validation predicted probabilities and explain how to make it robust under class imbalance and over cross-validation folds.
EasyTechnical
55 practiced
Explain the tradeoff between precision and recall. Provide three concrete real-world scenarios where precision should be prioritized and three where recall should be prioritized. For a disease screening system describe which to prioritize and the consequences of the choice.
HardTechnical
50 practiced
Design a statistical significance testing approach for A/B experiments that measure imbalanced metrics like recall where event rates are low. Explain how to compute required sample size for desired power, how bootstrapping or permutation tests can be used when assumptions are weak, and how to control for sequential testing and multiple comparisons.
EasyTechnical
41 practiced
Define class prior shift and covariate shift. Explain how a change in class priors between training and production can affect predicted probabilities and thresholds, and outline concrete methods to detect and correct prior shift in a deployed model.

Unlock Full Question Bank

Get access to hundreds of Handling Class Imbalance interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.