← Questions

Classification model lifecycle and click-through prediction

0
AppleAI/ML designLast asked Dec 2025

An AI/ML design interview question asked in Apple's AI/ML design round, last asked Dec 2025. It tests classification, ctr prediction and monitoring.

A machine learning fundamentals conversation. Answer each topic in a structured way.

Topics

  1. Bag-of-words features. One practical text pipeline: tokenization, building the vocabulary, rare and unseen words, sparse storage, and weighting by raw counts or TF-IDF.
  2. Out-of-bag evaluation. In bagging and random forests, how out-of-bag samples arise, and how to use them for validation.
  3. Click-through prediction. Build a binary model that predicts the probability a user clicks: problem definition, data and labels, features, model choice, training, calibration and evaluation.
  4. Any classification model from scratch. Walk through every major step, naming suitable techniques and models at each.
  5. Debugging a drop in production. The model's online performance falls after launch. How do you find out why? Consider the data, the model, the serving system and the product.

What a strong answer covers

  • Bag of words: a fixed vocabulary with an out-of-vocabulary bucket or hashing, minimum frequency cutoffs, sparse vectors, and why TF-IDF downweights common words.
  • Out-of-bag: each tree's bootstrap sample leaves out about 37% of rows (1 - 1/e), so each row can be scored by the trees that never saw it.
  • Click-through: impressions as rows and clicks as labels, position bias, class imbalance, features from user, item and context, logistic regression or gradient-boosted trees as baselines, log loss and AUC, and calibration (why predicted probabilities must match observed rates when they feed an auction or ranking).
  • The lifecycle: framing, labels, splits by time to avoid leakage, baselines, error analysis, deployment and monitoring.
  • Debugging: training and serving skew, feature pipeline breaks, data drift, label delays, a changed product surface, and how to tell them apart with slices and logs.

Follow-ups

  • Offline AUC went up but online clicks went down. How can that happen?
  • How do you pick the decision threshold for a classifier in production?
  • When would you not use out-of-bag error?

Where it's asked

  • Apple · AI/ML design · Last asked Dec 2025

What it tests

classification · ctr prediction · monitoring

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing