Skip to content
Tech Interview Prep
Technical interview guide

Supervised vs. Unsupervised Learning

Learning from labeled examples versus finding structure in unlabeled data, and where semi-supervised and reinforcement learning fit.

Read
25 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: scikit-learn stable documentation and Google Machine Learning Crash Course accessed 2026-08-30..

Curated: · Written: · Reviewed:

25 questions

MCQ-12An engineering team is choosing between formulating an intrusion detection system as supervised classification or as unsupervised outlier detection. How do their data assumptions and primary failure modes fundamentally differ?
MCQ-2You have 200k completed delivery orders with actual minutes. The distribution is right-skewed: median 18 min, mean 27 min, p99 95 min. Product wants a point estimate that is not dragged by the long tail. Which training objective best fits?
MCQ-1An online store's analytics team has three years of session logs: about 5M sessions a day, each with session ID, user ID, start and end timestamps and the clickstream: plus a purchases table of 120,000 rows with user ID, amount and timestamp. They want a model that, for a live session, returns the probability that this session ends in a purchase before it expires, and it is scored on every session whether that session converts or not. Which training setup defines the labels for that model?
MCQ-3A team wants to use 'refund_issued' as the target for a model that predicts, at the moment an order is placed, whether the customer will be dissatisfied. They train on two years of orders and evaluate on a held-out month from last quarter. Why is this column unsafe?
MCQ-4A team predicts 30-day readmission from EHR data in which each patient contributes a median of 6 encounters. They split rows at random, train, and report AUC 0.94 on the held-out rows; the same model scores 0.71 on a later cohort of new patients. Which property of the random split explains the gap?
MCQ-21A team predicts next-day order volume from 18 months of daily logs. A shuffled 80/20 split gives offline R² 0.93, but the model scores 0.41 in its first live week. Which change to the evaluation split addresses the gap?
MCQ-5A team has 2,500 labeled rows and 400 features. Their pipeline is StandardScaler → PCA(50) → logistic regression, and they fit the scaler and PCA once on all 2,500 rows before splitting. Five-fold CV reports 0.93 ± 0.01 accuracy; a separate 500-row holdout drawn from the same pool scores 0.68. They re-run with the scaler and PCA fit inside each fold, and CV falls to 0.70. Which reading of these numbers is correct?
MCQ-22A team tunes 30 configurations of a gradient-boosted model with 5-fold CV on 1,000 labeled examples. Run A standardizes every feature once, using the mean and standard deviation of all 1,000 examples, then runs nested CV: outer 5-fold, inner 5-fold, the same 30 configurations and the same splits. It scores 0.91. Run B is identical except the scaler is fit on each outer training split (800 examples) and applied to that fold's inner CV and outer test fold. It scores 0.87. Which statement explains the 0.04 gap?
MCQ-17A fraud team evaluates a detector on 100,000 transactions, 200 of which are fraudulent. The detector flags 50 transactions, and 40 of those flagged are fraudulent. The team lead reports 99.83% accuracy and proposes shipping the model. Which conclusion about this evaluation is correct?
MCQ-19A fraud model outputs a probability of fraud for each transaction. On a held-out set of 1,000 transactions, the 200 scored between 0.90 and 0.95 include 120 that were actually fraudulent. The team plans to multiply each transaction's amount by its score to estimate expected loss. What should they do?
MCQ-18An e-commerce fraud model outputs calibrated probabilities. On a 10,000-transaction validation set containing 20 confirmed frauds, the team measures three candidate thresholds: | threshold | transactions flagged | frauds caught | frauds missed | | --- | --- | --- | --- | | 0.5 | 30 | 12 | 8 | | 0.2 | 90 | 18 | 2 | | 0.05 | 400 | 20 | 0 | A missed fraud costs $400 in chargebacks and lost goods; a flagged legitimate transaction costs $8 in manual review. Which threshold should ship?
MCQ-20A retail bank that screens applications with a rule counting triggered fraud signals is deploying a gradient-boosted model that scores PR-AUC 0.44 on a year of applications it never saw, where 2.9% of applications are fraudulent. The approval board sent the first submission back: the 0.44 has to mean something on this metric and this population before it will fund the deployment. Which baselines should the resubmission carry?
MCQ-6Four one-dimensional points (0, 2, 3, 7) are clustered with k-means, k = 2, starting from centroids at 1 and 6. Assignment and update steps alternate until the assignment stops changing. Which clustering does the run end with, and what is its within-cluster sum of squared distances (inertia)?
MCQ-7A team runs k-means with Euclidean distance on two raw columns: annual income in dollars (20,000–200,000) and age in years (18–90). The clusters separate almost entirely by income, though the team wants both attributes to shape them. Which change makes both attributes shape the clusters?
MCQ-8During a k-means audit, point P has mean distance 0.4 to the other points in its assigned cluster A and mean distance 0.7 to the points in the nearest other cluster B. The team must decide whether to keep P in A or reassign it to B. What should they do, and why?
MCQ-9A team centers a two-feature training set (x1, x2) and computes the sample covariance matrix [[5, 2], [2, 2]]. They project the data onto the first principal component. Which unit vector is the first principal component?
MCQ-10A team fits PCA (scikit-learn defaults) on two features from a web-analytics table: session duration in seconds (std ≈ 100) and click-through rate as a 0–1 fraction (std ≈ 0.02). The first component explains 99.99% of the total variance and loads ≈1.0 on session duration. They wanted one component that blends both engagement signals. Which action addresses the cause of this imbalance?
MCQ-25A retailer fits k-means with k=6 on 1.8M customers and 40 behavioral features. Silhouette on the full sample is 0.41. Refit separately on two random halves of the data, the adjusted Rand index (ARI) between the two partitions is 0.28. A holdout test of a reactivation campaign sent only to segment 4 shows +0.9pp conversion versus a no-contact control (95% CI −0.2 to +2.0pp). Which action is best supported by this evidence?
MCQ-16A fraud team ships a frozen KMeans(k=64) artifact trained on a 2023 snapshot of 4M transactions. The classifier is retrained weekly on the trailing 90 days (about 600k rows), and at serving time every transaction is scored with those frozen 2023 centroids. Which evaluation estimates the AUC the deployed system will show next week?
MCQ-23A team clusters 800,000 support tickets nightly with k-means (k=40) over 768-d embeddings. The alert rule fires when the mean cosine distance from a ticket to its assigned centroid exceeds 0.35, the p99 of the training snapshot. After upgrading the encoder from v2 to v3, the mean distance is 0.41 every night and the alert fires. Cluster sizes are unchanged (max shift 0.4 percentage points), the Adjusted Rand Index between consecutive nightly assignments is 0.95, and routing accuracy on a labeled holdout is 87% (was 88%). What is the right action?
MCQ-11A fleet of 300 pumps produces 50,000 ten-minute vibration windows over a year. Forty pumps failed; the 6,000 windows in the 24 hours before each failure are labelled pre-failure, and the other 44,000 windows are unlabelled. Sensor calibration and operating conditions were constant all year. A one-class model fitted on all 50,000 windows is scored on a held-out month containing 9 failures: recall on pre-failure windows is 0.11, and 12% of normal windows are flagged. Which change is most likely to raise recall on the held-out failures without raising the normal-window flag rate?
MCQ-14A team is doing self-training for a 12-class image classifier. They have 10,000 human-labeled images: 6,000 train the teacher, 2,000 pick the pseudo-label confidence threshold (0.9), and 2,000 are held out untouched. The teacher pseudo-labels 400,000 unlabeled images; 320,000 pass 0.9 and join the 6,000 to train the student. The student is then scored on five 2,000-image sets: Set A, 2,000 of the 6,000 training images (96.8%); Set B, the 2,000 threshold-selection images (89.4%); Set C, the 2,000 untouched held-out images (72.1%); Set D, 2,000 of the pseudo-labeled images it trained on (97.5%); Set E, 2,000 of the 80,000 images that scored below 0.9, pseudo-labeled by the teacher anyway (63.7%). Which score should the team report as the student's expected accuracy on new, unseen images?
MCQ-13A team trains a classifier on 2,000 labeled rows, then adds the 12,000 unlabeled rows whose predicted probability exceeds 0.95 as hard labels and retrains. After three rounds, held-out accuracy has fallen from 81% to 74% while training loss keeps dropping. Which mechanism explains the drop?
MCQ-15A team pretrains a transformer on 40M unlabeled support tickets with a masked-token objective (15% of tokens masked), then attaches a classification head and fine-tunes on 3,000 labeled tickets. On a held-out set the fine-tuned model scores 88% overall but 41% on the 'billing dispute' intent, which has only 9 labeled examples. A supervised model trained from scratch on the same 3,000 labels scores 71% overall and 38% on that intent. Which conclusion about the two stages fits these numbers?
MCQ-24A payments team retrains its fraud model weekly on every reviewed alert from the past 200 days: 200,000 cases, each confirmed as fraud or cleared by a human reviewer. On held-out reviewed alerts the model scores 0.95 AUC, and inter-reviewer agreement is 96%. An independent audit that adjudicates a random sample of all transactions finds recall stuck at 0.62 across three retrains. What most likely explains the flat recall?