15Implement precision, recall, F1, and a confusion matrix from raw predictions in NumPy.▼mediumAmazonMetaGoogle1 replies○ sign inA common ML-coding check that verifies you actually understand the metrics you quote. The signal is getting TP/FP/FN/TN right and knowing macro vs micro averaging for multiclass, not reaching for sklearn.Open full answer →
52Implement a precision-recall (or ROC) curve and AUC from scores and labels.▼mediumAmazonGoogleMeta2 replies◆ premiumBuilding a PR/ROC curve from scratch proves you understand thresholds and the precision/recall tradeoff. The real signal is sweeping the threshold in one sorted pass and integrating the area. Here is the implementation.Open full answer →
03Define precision, recall, F1, and AUC, and give a case where each (and accuracy) is misleading.▼medium★ EssentialAmazonMetaGoogle2 repliesunlockedThe interviewer is testing whether you pick metrics for the problem or recite definitions. The real signal is knowing when accuracy and even AUC lie, and tying each metric to a decision.Open full answer →
83Your classifier outputs probabilities, but you need a decision. How do you pick the threshold (it's rarely 0.5)?▼mediumAmazonStripeMeta1 replies◆ premiumDefaulting to 0.5 is leaving money or safety on the table. The right cutoff comes from the cost of each error and the operating constraint, not the model. Here is how to set it deliberately.Open full answer →
07Design a real-time content moderation system for text and images at platform scale.▼hardMetaGoogleMicrosoft1 repliesunlockedModeration is a multi-stage classification problem with brutal tradeoffs: false negatives cause real harm, false positives censor legitimate users, and the adversary adapts. The signal is the tiered pipeline, per-severity precision/recall calibration, and human-in-the-loop. Here is the design.Open full answer →