CORE MACHINE LEARNING QUESTIONSCore ML exam and interview questions, each with the best way to answer it and the best free reading. |
Showing 799 of 799 questions.
Level: L1 = Beginner, L2 = Elementary, L3 = Intermediate, L4 = Advanced, L5 = Expert
Length: One-liner, Short, Medium, Long
Nature: Th = Theoretical, Mat = Mathematical, Th+Mat = Both
| Done | # | Question | Topic | Level | Length | Nature |
|---|---|---|---|---|---|---|
| 1 | What is the bias–variance tradeoff? |
Foundations | L1 | Short | Th | |
| 2 | Why must you never tune hyperparameters on the test set? |
Foundations | L1 | One-liner | Th | |
| 3 | What is empirical risk minimisation? |
Foundations | L1 | One-liner | Th | |
| 4 | What is the difference between a parametric and a non-parametric model, with one example of each? |
Foundations | L1 | Short | Th | |
| 5 | What is the difference between semi-supervised learning and self-supervised learning? |
Foundations | L1 | One-liner | Th | |
| 6 | When would you use online learning instead of batch (offline) learning, and what is the main trade-off? |
Foundations | L1 | Short | Th | |
| 7 | What is inductive bias in machine learning, and why is it necessary for generalisation? |
Foundations | L1 | One-liner | Th | |
| 8 | What are the three mechanisms of missing data — MCAR (Missing Completely At Random), MAR (Missing At Random) and MNAR (Missing Not At Random) — and what is an everyday example of each? |
Foundations | L1 | Short | Th | |
| 9 | What is data leakage, and what are two examples you could plausibly meet in practice? |
Foundations | L2 | Short | Th | |
| 10 | Your model has 2% training error and 25% validation error. What is the problem, and what would you try? What if instead both errors were about 24%? |
Foundations | L2 | Short | Th | |
| 11 | What is -fold cross-validation, how do the bias and the computation cost of the error estimate change with , and why are and the usual choices? |
Foundations | L2 | Medium | Th+Mat | |
| 12 | Data are spread uniformly in the unit hypercube . A nearest-neighbour method uses a small cube around each point that contains 1% of the data. What edge length must that cube have for , and , and what does this say about local methods in high dimensions? |
Foundations | L2 | Medium | Th+Mat | |
| 13 | What is pool-based active learning, and if a three-class classifier outputs predicted probabilities , and for unlabelled points , and , which point do least-confidence and margin sampling query first? |
Foundations | L2 | Short | Th+Mat | |
| 14 | Suppose a concept is a conjunction of three attributes with , and . Given the training examples , , and , what sequence of hypotheses does the Find-S algorithm produce, and what assumptions does it rely on? |
Foundations | L2 | Medium | Th+Mat | |
| 15 | Consider inputs with Boolean features . How many distinct Boolean functions exist in total, how many semantically distinct conjunctions of literals (allowing unnegated literals , negated literals , or omitting feature ) exist, and what are both counts for ? |
Foundations | L2 | Short | Th+Mat | |
| 16 | You fit two nested Gaussian regression models on data points: Model A has parameters and maximised log-likelihood , while Model B has parameters and . Using and (lower is better), which model does each criterion select? |
Foundations | L2 | Medium | Mat | |
| 17 | Compute both the z-score standardised values (using population standard deviation) and the min-max scaled values on for the feature vector . What drawback of min-max scaling does this example reveal, and which ML algorithms do or do not require feature scaling? |
Foundations | L2 | Medium | Th+Mat | |
| 18 | For a -dimensional input vector , a full polynomial expansion of degree at most (including the constant bias term ) has features. What is when and , and what happens to unregularised least-squares linear regression if you only have training examples? |
Foundations | L2 | Short | Mat | |
| 19 | What is the difference between a restriction (language) bias and a preference (search) bias, with one standard ML algorithm as an example of each, and why is a preference bias usually safer in practice? |
Foundations | L2 | Short | Th | |
| 20 | Cross-validation for polynomial regression of degree 1 to 6 gives these mean errors (standard error in brackets): degree 1: 0.300 (0.030); degree 2: 0.180 (0.020); degree 3: 0.115 (0.020); degree 4: 0.100 (0.020); degree 5: 0.095 (0.025); degree 6: 0.110 (0.030). Which degree does the one-standard-error rule choose, and why prefer it to the plain minimum? |
Foundations | L2 | Medium | Th+Mat | |
| 21 | How do you derive the bias–variance decomposition of the expected squared error , where is the model fitted to a random training set? |
Foundations | L3 | Long | Mat | |
| 22 | For a single weight and a number , solve and . Why does this show that L1 regularisation gives sparse solutions and L2 does not? |
Foundations | L3 | Medium | Th+Mat | |
| 23 | Why is the predictor that minimises the expected squared loss the conditional mean , and why is the classifier that minimises the expected 0-1 loss ? |
Foundations | L3 | Medium | Mat | |
| 24 | Consider a -dimensional unit-radius hypersphere inscribed inside the hypercube . Using the hypersphere volume (where for an integer ), what fraction of the hypercube's volume does the sphere occupy for , and , and what does this imply about uniformly sampled points in high dimensions? |
Foundations | L3 | Medium | Mat | |
| 25 | In positive-unlabelled (PU) learning, every labelled example is positive (), and each true positive is labelled independently of its features with constant probability . How do you express the true posterior in terms of the observed-label posterior and , and how can be estimated from a held-out set of labelled positives? |
Foundations | L3 | Medium | Mat | |
| 26 | Consider a conjunctive hypothesis space over three binary attributes . What sequences of specific boundaries and general boundaries does the candidate-elimination algorithm produce on the four examples , , and , and which hypotheses remain in the final version space? |
Foundations | L3 | Long | Th+Mat | |
| 27 | How do AIC and BIC compare in terms of their complexity penalties and their large-sample behaviour () regarding model-selection consistency versus predictive efficiency, and when would you prefer one over the other? |
Foundations | L3 | Medium | Th | |
| 28 | How does the minimum description length (MDL) principle turn model selection into a data-compression problem, and how does a two-part MDL code connect mathematically to MAP estimation and BIC? |
Foundations | L3 | Medium | Th+Mat | |
| 29 | For a categorical variable with categories, why does keeping all one-hot indicator columns together with an intercept make unregularised linear regression singular, why does ridge regression remove this singularity, and what precaution is required when using target encoding instead? |
Foundations | L3 | Medium | Th+Mat | |
| 30 | Suppose a feature has mean and variance , and each entry is missing independently with probability (MCAR). If missing entries are replaced by , what are the mean and variance of the imputed feature , how does this affect with a target , and why is adding a binary missingness indicator often better? |
Foundations | L3 | Medium | Mat | |
| 31 | Let be two independent -dimensional standard Gaussian vectors. Compute and as functions of . Why does the ratio tend to as , and how does this break distance-based methods like -NN? |
Foundations | L3 | Medium | Mat | |
| 32 | A colleague standardises all features using the mean and standard deviation of the entire dataset, selects the 20 features most correlated with the label , and then runs 5-fold cross-validation to tune and report the accuracy of a classifier. Is the resulting CV accuracy unbiased, how do you fix the pipeline, and how badly can full-dataset feature screening distort pure random noise? |
Foundations | L3 | Medium | Th+Mat | |
| 33 | When data are missing at random (MAR), suppose an outcome is observed only when , where the observation probability depends only on fully observed covariates . Why is the unweighted complete-case sample mean biased for , and how do you prove that the inverse-probability-weighted (IPW) estimator is unbiased? |
Foundations | L3 | Medium | Mat | |
| 34 | Suppose the fold errors in cross-validation each have variance and every pair has correlation . Derive the variance of their average. Evaluate it for and with , and explain why this is used to argue that leave-one-out has high variance? |
Foundations | L3 | Medium | Mat | |
| 35 | Derive the number of monomial features of degree at most in input variables, using a stars-and-bars counting argument. Check it for by listing the terms, then evaluate it for and explain why a polynomial kernel avoids building these features? |
Foundations | L3 | Medium | Mat | |
| 36 | What does the no-free-lunch theorem say, and what does it imply for choosing a learning algorithm in practice? |
Foundations | L4 | Medium | Th | |
| 37 | For least-squares linear regression with hat matrix , how do you prove that the leave-one-out residual is , so that leave-one-out cross-validation needs only one fit? |
Foundations | L4 | Long | Mat | |
| 38 | Does Occam's razor claim that nature itself prefers simple laws, or is there a formal statistical reason to prefer simpler hypotheses that fit the training data — and when can counting parameters mislead you? |
Foundations | L4 | Medium | Th | |
| 39 | Suppose you evaluate hyperparameter settings using a single 5-fold cross-validation loop and report the minimum CV error as your model's expected generalisation error. Why is this estimate optimistically biased, how does nested cross-validation eliminate this selection bias, and how many model fits does a -outer, -inner nested CV over hyperparameter candidates require for , and (including refitting)? |
Foundations | L4 | Medium | Th+Mat | |
| 40 | Suppose you use a train/validation/test split to choose among candidate models (with 0–1 loss) on a validation set of size . Using Hoeffding's inequality and the union bound, how large must be so that simultaneously all validation errors are within of their true errors with probability at least , why do large datasets not need 20\% validation splits, and should you retrain on train+validation before testing? |
Foundations | L4 | Medium | Th+Mat | |
| 41 | A binary classification population has positive-class proportion , and a fixed classifier has true error rates on positives and on negatives. How do the bias and variance of the validation error estimate compare between i.i.d. validation draws (simple random sampling) and stratified validation draws ( positives and negatives, assumed integers), and when does stratification reduce variance the most? |
Foundations | L4 | Long | Mat | |
| 42 | How is Schwarz's Bayesian Information Criterion derived from the Bayesian marginal likelihood using Laplace's approximation? |
Foundations | L5 | Long | Mat | |
| 43 | Consider fixed-design regression () with independent noise and , and let be any fitted predictor. How do you prove that the expected in-sample optimism equals , and how does this simplify to for rank- ordinary least squares (giving Mallows' )? |
Foundations | L5 | Long | Mat | |
| 44 | What do the expected value and the variance (or standard deviation) of a random variable measure intuitively, and what are their values for a game that pays ₹10 with probability and ₹0 otherwise? |
Probability and statistics | L1 | Short | Th+Mat | |
| 45 | What do covariance and correlation tell you about two variables, and why is correlation usually easier to interpret than covariance? |
Probability and statistics | L1 | Short | Th | |
| 46 | Why is generally not equal to , and how does Bayes' rule connect the two, with a small example? |
Probability and statistics | L1 | Short | Th+Mat | |
| 47 | If two events and both have positive probability and are mutually exclusive, can they be independent? |
Probability and statistics | L1 | One-liner | Th | |
| 48 | Does need and to be independent? What about ? |
Probability and statistics | L1 | Short | Th+Mat | |
| 49 | In statistics and machine learning, what is the difference between probability and likelihood, and what is the idea behind maximum likelihood estimation (MLE)? If you toss a coin 10 times and get 7 heads, what is the MLE of its heads probability? |
Probability and statistics | L1 | Short | Th+Mat | |
| 50 | Can a probability density function take values greater than 1? |
Probability and statistics | L1 | One-liner | Th | |
| 51 | What are the mean and variance of a Poisson random variable, and what kind of data is it used to model? |
Probability and statistics | L1 | Short | Th | |
| 52 | In a hypothesis test, what are a type I error, a type II error and the power, and how do they appear in a spam filter that tests "this email is spam"? |
Probability and statistics | L1 | Short | Th | |
| 53 | A test gives . Is it true that "there is a 3% probability the null hypothesis is true", and why? |
Probability and statistics | L1 | Short | Th | |
| 54 | Can an estimator be unbiased but not consistent, and can it be biased but consistent? What is one example of each? |
Probability and statistics | L1 | Short | Th | |
| 55 | A 95% confidence interval for a model's accuracy is . Is it true that the true accuracy lies in this interval with probability 0.95, and why? |
Probability and statistics | L1 | Short | Th | |
| 56 | Using and , how can you show that two random variables can be uncorrelated but not independent? |
Probability and statistics | L2 | Short | Th+Mat | |
| 57 | A disease affects 1% of people. A test detects it 99% of the time when it is present, and gives a false positive 5% of the time when it is absent. If a person tests positive, what is the probability that they have the disease? |
Probability and statistics | L2 | Short | Mat | |
| 58 | What does the central limit theorem say? If per-example test losses have mean and standard deviation , roughly what is the probability that their average over test examples differs from by more than 2? |
Probability and statistics | L2 | Short | Th+Mat | |
| 59 | A bootstrap sample of size is drawn with replacement from data points. What is the probability that a given point is left out, what does it tend to as , and how is this used? |
Probability and statistics | L2 | Short | Th+Mat | |
| 60 | A coin's probability of heads has prior , and you observe 7 heads in 10 tosses. What is the posterior, and how do the MLE, the MAP estimate and the posterior mean compare? |
Probability and statistics | L2 | Medium | Mat | |
| 61 | A bag holds 4 red and 6 blue balls. You draw 3 balls at random without replacement. What is the probability that exactly 2 are red? |
Probability and statistics | L2 | Short | Mat | |
| 62 | Machines A, B and C produce 50%, 30% and 20% of a factory's items. Their defect rates are 1%, 2% and 3%. An item is picked at random and found defective. What is the probability that it came from machine C? |
Probability and statistics | L2 | Short | Mat | |
| 63 | A classifier errs independently on each test example with probability 0.1. On 20 test examples, what is the probability of at most one error? |
Probability and statistics | L2 | Short | Mat | |
| 64 | A server's waiting time (in minutes) is exponential with mean 5. Given that you have already waited 3 minutes, what is the probability you wait more than 8 minutes in total? Why is the answer what it is? |
Probability and statistics | L2 | Short | Th+Mat | |
| 65 | Two binary variables and have joint probabilities , , , . What are and the correlation ? |
Probability and statistics | L2 | Medium | Mat | |
| 66 | If and , what is the distribution of , and what is , given ? |
Probability and statistics | L2 | Short | Mat | |
| 67 | A model's latency has a known standard deviation of ms. On requests the mean latency is ms. Test against with a z-test at the 5% level. What is the p-value, and what is your conclusion? |
Probability and statistics | L2 | Medium | Mat | |
| 68 | A non-negative random variable (say, the response time of a server) has mean and variance . Using Markov's and Chebyshev's inequalities, what bounds do you get for and for , and why is one bound much tighter? |
Probability and statistics | L2 | Medium | Mat | |
| 69 | Let and on three outcomes. Compute , the cross-entropy , and both and in bits. What do the numbers show? |
Probability and statistics | L2 | Medium | Mat | |
| 70 | Two binary variables and have the joint distribution and . What is the mutual information in bits, and what would it be if and were independent? |
Probability and statistics | L2 | Medium | Mat | |
| 71 | A classifier's accuracy is measured on independent random splits, giving a sample mean of and sample standard deviation of . Give a 95% confidence interval for the true mean accuracy, using . Why not use ? |
Probability and statistics | L2 | Short | Mat | |
| 72 | You run independent hypothesis tests, all with true null hypotheses, each at level . What is the probability of at least one false positive? What level per test does the Bonferroni correction use, and what family-wise error rate does that achieve? |
Probability and statistics | L2 | Short | Mat | |
| 73 | A die is rolled 60 times and faces 1 to 6 appear times. The critical value for 5 degrees of freedom is . Is the die fair according to a chi-squared goodness-of-fit test at the 5% level? |
Probability and statistics | L2 | Medium | Mat | |
| 74 | In a sample of 100 emails, a rule fires on 40 of them. Of the 50 emails that are spam, the rule fires on 30. The 50 non-spam emails give the other 10 firings. The critical value for 1 degree of freedom at 5% is . According to a chi-squared test of independence, are the rule and the spam label independent? |
Probability and statistics | L2 | Medium | Mat | |
| 75 | Model A and model B are compared on the same 5 cross-validation folds. A's accuracy minus B's accuracy, in percentage points, is . Run a paired t-test of "no difference" at 5% (the two-sided critical value for 4 degrees of freedom is ). Why should you be careful with this test? |
Probability and statistics | L2 | Medium | Th+Mat | |
| 76 | A classifier wrongly flags a transaction with probability , independently, and it scores transactions. How do you approximate the probability of at most 2 false flags, and why does the approximation work? |
Probability and statistics | L2 | Medium | Mat | |
| 77 | You pick door 1 out of three, one of which hides a car. The host, who knows where the car is, always opens a different door that has a goat and offers you a switch. He opens door 3. Using Bayes' rule, what is the probability that the car is behind door 2, and why is the host's knowledge important? |
Probability and statistics | L2 | Medium | Mat | |
| 78 | What is the difference between MLE and MAP estimation, and how can you show that L2-regularised linear regression is MAP with a Gaussian prior? |
Probability and statistics | L3 | Medium | Th+Mat | |
| 79 | Is KL divergence a distance, and why is minimising cross-entropy the same as maximum likelihood? |
Probability and statistics | L3 | Medium | Th+Mat | |
| 80 | What are the maximum likelihood estimates of and from independent samples of , and how do you derive them? |
Probability and statistics | L3 | Medium | Mat | |
| 81 | Why is a biased estimator of , and why does dividing by instead remove the bias? |
Probability and statistics | L3 | Medium | Mat | |
| 82 | You can draw samples from Uniform, and you have , the inverse CDF of the standard normal . How do you generate samples from a 2D normal distribution , and how do you show that they have the right mean and covariance? |
Probability and statistics | L3 | Medium | Th+Mat | |
| 83 | Two classifiers A and B are evaluated on the same 1,000 test examples. A is right and B wrong on 30 examples; B is right and A wrong on 15. Is A significantly better at the 5% level, and what does the p-value mean here? |
Probability and statistics | L3 | Medium | Th+Mat | |
| 84 | Counts are independent Poisson samples. Derive the MLE of . For the counts , what is and the probability that the next count is zero? |
Probability and statistics | L3 | Medium | Mat | |
| 85 | The number of attempts until the first success has , for . You observe 4 independent runs needing 3, 1, 4 and 2 attempts. How do you derive the MLE of , and what is its value? |
Probability and statistics | L3 | Medium | Mat | |
| 86 | A website gets visitors per hour. Each visitor independently spends an amount with mean and variance . Using the laws of total expectation and total variance, what are the mean and variance of the hourly revenue ? What are the values for ? |
Probability and statistics | L3 | Medium | Mat | |
| 87 | Event counts are Poisson. You use a Gamma prior with shape and rate , whose density is . You observe counts . What are the posterior, its mean, the MAP estimate and the MLE? |
Probability and statistics | L3 | Medium | Mat | |
| 88 | If and , show that is exponential with rate . How does this give a way to sample, and what is for , ? |
Probability and statistics | L3 | Medium | Mat | |
| 89 | is bivariate Gaussian with means and covariance . Why is Gaussian, and what are its mean and variance at ? |
Probability and statistics | L3 | Medium | Mat | |
| 90 | A die-like variable takes values in with probabilities . Given observations of category (total ), derive the MLE of with a Lagrange multiplier. For counts , what is it? |
Probability and statistics | L3 | Medium | Mat | |
| 91 | Why is the Bernoulli distribution with parameter in the exponential family? What are its natural parameter, sufficient statistic and log-partition function, and why does the derivative of the log-partition function give the mean? |
Probability and statistics | L3 | Medium | Mat | |
| 92 | A variable is drawn from with probability 0.3 and from (variance 2) with probability 0.7. Use the law of total variance to find its mean and variance. Why is the variance more than the weighted average of the two component variances? |
Probability and statistics | L3 | Medium | Mat | |
| 93 | Data are i.i.d. with known and prior . What is the posterior of , and what is it for , , , , ? Why is the MAP estimate a ridge-type shrinkage of ? |
Probability and statistics | L3 | Long | Mat | |
| 94 | Is it true that if and are each Gaussian and uncorrelated, then they are independent, and what construction justifies your answer? |
Probability and statistics | L3 | Medium | Th+Mat | |
| 95 | Samples are i.i.d. Uniform. What is the MLE of , why is it biased, and what is an unbiased correction? What are both estimates for the data ? |
Probability and statistics | L3 | Long | Mat | |
| 96 | For i.i.d. Bernoulli() samples, derive the Fisher information, state the Cramér–Rao bound, and show that the sample mean attains it. What does the bound say numerically for and ? |
Probability and statistics | L3 | Medium | Mat | |
| 97 | For i.i.d. data, consider . Which gives the smallest mean squared error, and how do the unbiased choice and the MLE compare for ? |
Probability and statistics | L3 | Long | Mat | |
| 98 | You test against with a one-sided z-test at , where is known and . Use and . If the true mean is , what is the power? How large must be for 80% power? |
Probability and statistics | L3 | Medium | Mat | |
| 99 | For the sample , what is the exact bootstrap variance and standard error of the sample mean, and how does it compare with the usual ? How would you get a 95% percentile bootstrap interval in practice? |
Probability and statistics | L3 | Medium | Th+Mat | |
| 100 | A fair coin is tossed times and is the fraction of heads. Compare the Chebyshev bound, the Hoeffding bound and the CLT approximation for . The exact value is about . What do the comparisons teach? |
Probability and statistics | L3 | Medium | Mat | |
| 101 | Eight tests give the p-values . Which hypotheses are rejected by (a) Bonferroni, (b) Holm and (c) Benjamini–Hochberg at level , and what error rate does each control? |
Probability and statistics | L3 | Long | Th+Mat | |
| 102 | In 100 tosses of a coin, 60 heads appear. What is the result of a likelihood-ratio test of at the 5% level, using Wilks' theorem (critical value ), and how does it compare with the z-test? |
Probability and statistics | L3 | Medium | Mat | |
| 103 | For a bivariate Gaussian with correlation , show that . What is the value for , and what happens as and ? |
Probability and statistics | L3 | Long | Mat | |
| 104 | keys are hashed independently and uniformly into slots. How do you find the probability that at least two keys share a slot, and how large must be for this probability to pass when (the birthday problem)? |
Probability and statistics | L3 | Medium | Mat | |
| 105 | Three independent jobs have exponential run times with rates , and per hour. What is the distribution of the time until the first job finishes, and what is the probability that job 1 is the first to finish? |
Probability and statistics | L3 | Medium | Mat | |
| 106 | Word counts in a class for a 4-word vocabulary are . With a symmetric Dirichlet prior on the word probabilities , what is the posterior, and how does the posterior mean give add- (Laplace) smoothing as used in naive Bayes? |
Probability and statistics | L3 | Medium | Mat | |
| 107 | How do you prove the weak law of large numbers for i.i.d. random variables with mean and finite variance , using Chebyshev's inequality? If , how many samples guarantee ? |
Probability and statistics | L3 | Medium | Mat | |
| 108 | Each draw picks one of classes uniformly at random with replacement. What is the expected number of draws until every class has appeared at least once, and what is it for and for ? |
Probability and statistics | L3 | Medium | Mat | |
| 109 | Show that an estimator whose bias and variance both tend to 0 is consistent. For i.i.d. with , what are an unbiased but inconsistent and a biased but consistent estimator of , and for , how do the mean squared errors (MSE) of the divide-by- and divide-by- estimators of compare? |
Probability and statistics | L3 | Medium | Mat | |
| 110 | For a natural exponential family , why is and , and hence why does the MLE satisfy ? What does this give for exponential data ? |
Probability and statistics | L4 | Long | Mat | |
| 111 | Let with partitions and . How do you derive the conditional distribution of given by completing the square with the precision matrix ? |
Probability and statistics | L4 | Long | Mat | |
| 112 | Let be independent Uniform. Define , , and . Why are and independent variables, and what are for , ? |
Probability and statistics | L4 | Long | Mat | |
| 113 | Lifetimes are i.i.d. exponential with rate , with density . What are the MLE and its Fisher information? For and , what is a 95% Wald interval for , and what does the delta method give for the mean lifetime ? |
Probability and statistics | L4 | Long | Mat | |
| 114 | For i.i.d. samples from Uniform, compare and the sample maximum (and its rescaled version ) as estimators of in terms of bias, variance and MSE. Why does the Cramér–Rao bound not apply? |
Probability and statistics | L4 | Long | Mat | |
| 115 | Let be independent with . Prove that using the moment generating function. What is the bound for and , and how does it compare with the exact tail probability? |
Probability and statistics | L4 | Long | Mat | |
| 116 | Is it true that averaging more samples always makes the sample mean more concentrated? For i.i.d. standard Cauchy samples with density , why do the law of large numbers and the central limit theorem fail? |
Probability and statistics | L4 | Long | Th+Mat | |
| 117 | What is the Cramér–Rao lower bound for an unbiased estimator of a scalar parameter , how do you prove it, and how does it show that the sample mean is the best unbiased estimator of a Bernoulli parameter ? |
Probability and statistics | L5 | Long | Mat | |
| 118 | Let be i.i.d. . Why are the sample mean and sample variance independent, and why is ? What is for ? |
Probability and statistics | L5 | Long | Mat | |
| 119 | For a smooth parametric family , show that for small , where is the Fisher information. How do you check it for with known? |
Probability and statistics | L5 | Long | Mat | |
| 120 | State and prove the Neyman–Pearson lemma for testing a simple against a simple . How do you show that for data with known , the test "reject when " is most powerful for against ? |
Probability and statistics | L5 | Long | Mat | |
| 121 | What does the dot product of two vectors measure, and what does it mean when the dot product is zero? What is for and ? |
Linear algebra and optimisation | L1 | Short | Th+Mat | |
| 122 | What is a vector norm, how do the (Manhattan) norm and the (Euclidean) norm differ geometrically, and what are both norms for ? |
Linear algebra and optimisation | L1 | Short | Th+Mat | |
| 123 | What is the gradient of a function of two variables, and what does it tell you? What is the gradient of at the point ? |
Linear algebra and optimisation | L1 | Short | Th+Mat | |
| 124 | Why does gradient descent step in the direction ? |
Linear algebra and optimisation | L1 | One-liner | Th | |
| 125 | How do full-batch gradient descent, stochastic gradient descent (SGD) and mini-batch gradient descent differ in how they compute each parameter update, and why is mini-batch SGD the standard choice in machine learning (ML)? |
Linear algebra and optimisation | L1 | Short | Th | |
| 126 | What is constrained optimisation in plain words, and why does a constraint change where the best answer is? Use a farmer who has 20 m of fencing and wants the biggest rectangular field? |
Linear algebra and optimisation | L1 | Short | Th | |
| 127 | What are an eigenvector and an eigenvalue of a square matrix intuitively, why are they useful, and how do you check that is an eigenvector of and find its eigenvalue? |
Linear algebra and optimisation | L1 | Short | Th+Mat | |
| 128 | What do span, linear independence and rank tell you about the columns of a feature matrix ? |
Linear algebra and optimisation | L1 | Short | Th | |
| 129 | What is an orthogonal matrix geometrically, and what properties of vectors does multiplying by one preserve? |
Linear algebra and optimisation | L1 | One-liner | Th | |
| 130 | What is the null space (kernel) of a matrix , and what does a non-trivial null space mean for the linear system ? |
Linear algebra and optimisation | L1 | One-liner | Th | |
| 131 | What does it mean for a symmetric matrix to be positive definite rather than positive semidefinite, and what shape does have in each case? |
Linear algebra and optimisation | L1 | Short | Th+Mat | |
| 132 | What is a convex set, what is a convex function, and what does the bowl shape of a convex problem mean for finding a minimum? |
Linear algebra and optimisation | L1 | Short | Th | |
| 133 | What is a saddle point on a loss surface, and intuitively why are saddle points far more common than local minima in high-dimensional neural networks? |
Linear algebra and optimisation | L1 | One-liner | Th | |
| 134 | Why do training pipelines often start with a learning-rate warmup and then decay the learning rate over time? |
Linear algebra and optimisation | L1 | Short | Th | |
| 135 | Why is every covariance matrix symmetric positive semidefinite, and when is it singular? |
Linear algebra and optimisation | L2 | Short | Th+Mat | |
| 136 | You minimise by gradient descent with a fixed learning rate , starting from . (a) What is the largest learning rate for which gradient descent converges? (b) What do the iterates do at that learning rate, and above it? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 137 | A matrix has a null space of dimension , and lies in the column space of . What is the rank of , how many free parameters does the solution to have, and could have a solution for every ? |
Linear algebra and optimisation | L2 | Short | Mat | |
| 138 | For which values of does the linear system , , have (a) a unique solution, (b) infinitely many solutions and (c) no solution? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 139 | A matrix has trace , determinant , and one eigenvalue equal to . What are its other two eigenvalues, and what are the trace and determinant of ? |
Linear algebra and optimisation | L2 | Short | Mat | |
| 140 | What are the eigenvalues and unit eigenvectors of , and how do you use them to compute without multiplying matrices four times? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 141 | For , how do you compute the Frobenius norm , the induced norm , the induced norm and the spectral norm ? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 142 | How do you compute the factorisation (with unit diagonal in ) of , use it to solve , and explain when row pivoting () is needed? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 143 | Geometrically, why must the gradient of the objective be parallel to the gradient of the constraint at a smooth optimum of subject to ? |
Linear algebra and optimisation | L2 | Short | Th | |
| 144 | Starting from , perform two steps of gradient descent on with learning rate . Does the iterate overshoot the minimum, and do the iterates still converge? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 145 | Minimise starting from with initial velocity , learning rate and momentum . Compute and using (a) heavy-ball momentum (, ) and (b) Nesterov accelerated gradient (, ). How do the two updates differ? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 146 | How does RMSProp fix AdaGrad's diminishing step size, and for starting from with , and , what are and under (a) AdaGrad () and (b) RMSProp () with ? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 147 | For what values of the constant is convex, for what values is it strictly convex, and what is its minimum when ? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 148 | Using Lagrange multipliers, find the point on the line that minimises , and what is the minimum value? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 149 | How does projected gradient descent handle a closed convex constraint set , what is the Euclidean projection onto (a) a box and (b) the non-negative orthant , and what does one step from with give for ? |
Linear algebra and optimisation | L2 | Medium | Th+Mat | |
| 150 | Find all stationary points of , and use the Hessian at each stationary point to classify it as a local minimum, local maximum or saddle point. What happens if gradient descent is initialised at versus ? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 151 | For a matrix the inverse is (when ). How do you use it to solve and ? |
Linear algebra and optimisation | L2 | Medium | Mat | |
| 152 | The determinant of is . Compute it for and . Which matrix is invertible, and what does the determinant tell you about its columns? |
Linear algebra and optimisation | L2 | Medium | Th+Mat | |
| 153 | How do you show that the negative log-likelihood of logistic regression is convex in the weights ? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 154 | What are for a square matrix and , and how do you derive them? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 155 | Which of these functions are convex, and why: (a) ; (b) ; (c) on ; (d) ; (e) the hinge loss as a function of ? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 156 | How is the SVD of a matrix related to the eigendecomposition of ? What are the singular values of , and what is the error of its best rank-1 approximation? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 157 | What is the Adam update, why does it need bias correction, and how large is its very first step? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 158 | How do you solve subject to using the KKT conditions, and what does each condition mean? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 159 | Using the Gram–Schmidt process, how do you turn the columns of into an orthonormal basis, and how do you write the resulting factorisation? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 160 | What is an idempotent matrix, what are its possible eigenvalues, and how do you construct the orthogonal projection matrix onto the column space of a full-column-rank matrix and show that ? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 161 | For which values of is the symmetric matrix positive definite by Sylvester's criterion, and what is its Cholesky factorisation when ? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 162 | How do you classify the quadratic form as positive definite, semidefinite or indefinite, and how do you write it in diagonal form via an orthogonal change of variables ? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 163 | When is a square matrix diagonalisable, why can repeated eigenvalues break diagonalisability, and how do you tell whether and are diagonalisable? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 164 | How is the Moore–Penrose pseudoinverse defined from the SVD , what does compute in general, and what are and for and ? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 165 | For a symmetric positive definite matrix and a square matrix , how do you derive and , and how does appear in fitting a multivariate Gaussian by maximum likelihood? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 166 | What is the condition number of an invertible matrix , how does it bound the relative sensitivity of to perturbations in , and what happens for when is perturbed by ? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 167 | How do you prove that every real symmetric matrix has only real eigenvalues and that eigenvectors corresponding to distinct eigenvalues are orthogonal? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 168 | Why does hold, why is for every real matrix , and what does this imply for the consistency of the normal equations ? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 169 | What are the four fundamental subspaces of a matrix of rank , how do they pair up as orthogonal complements, and how does the SVD give an orthonormal basis for every one of them? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 170 | Is it true that (a) a uniformly sampled mini-batch gradient is an unbiased estimator of the full-batch gradient, (b) every SGD step decreases the training objective, and (c) SGD with a fixed learning rate converges to the exact minimum, and why? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 171 | Why are the non-negative weighted sum (), the pointwise maximum , and the affine composition convex whenever each and is convex, and how do these rules show that the L2-regularised hinge loss is convex without computing any Hessian? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 172 | What are the first-order and second-order conditions for a twice-differentiable function to be convex, and how do you prove that the second-order condition ( everywhere) implies the first-order condition ()? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 173 | What is the Armijo (sufficient decrease) condition in backtracking line search, why is simply requiring not enough to guarantee convergence, and what step size does backtracking choose on from in direction with initial , shrink factor and ? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 174 | What is a subgradient of a convex function at a non-differentiable point, and what is the subdifferential of at ? Why can the subgradient method increase the objective on some steps, and why must its step size decay instead of staying constant? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 175 | How is the Lagrange dual function defined for a constrained optimisation problem, why is always concave even when the primal problem is non-convex, and how do you prove weak duality ()? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 176 | How do step decay, decay and cosine annealing learning-rate schedules differ, and why do the Robbins–Monro conditions (, ) require the step size to decay neither too fast nor too slow for SGD convergence? |
Linear algebra and optimisation | L3 | Short | Th+Mat | |
| 177 | What is strong duality, what does Slater's condition state, and how do you derive the Lagrange dual of subject to and verify that the duality gap is zero? |
Linear algebra and optimisation | L3 | Long | Mat | |
| 178 | Solve subject to and using the KKT conditions. Which constraint is active at the optimum, and why does the unconstrained minimum fail? |
Linear algebra and optimisation | L3 | Long | Mat | |
| 179 | Applying power iteration to starting from for three steps, what is the estimate of the dominant eigenvalue from the Rayleigh quotient, and how fast does the method converge? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 180 | For the underdetermined system with and , how do you find the solution with the smallest norm, and why is the answer ? |
Linear algebra and optimisation | L3 | Medium | Mat | |
| 181 | If is known, how do you derive the Sherman–Morrison formula for ? How do you verify it for and , and why does it matter for online ridge regression? |
Linear algebra and optimisation | L3 | Long | Mat | |
| 182 | Derive why the direction of fastest local decrease of at is , using a first-order Taylor expansion and the Cauchy–Schwarz inequality. For at , compare the rate of decrease along with the one along ? |
Linear algebra and optimisation | L3 | Medium | Th+Mat | |
| 183 | Prove that for a convex function on a convex set , every local minimum is a global minimum. Then show on that the minimiser need not be unique, and what extra condition makes it unique? |
Linear algebra and optimisation | L3 | Medium | Th | |
| 184 | Why does momentum speed up gradient descent on ill-conditioned problems? |
Linear algebra and optimisation | L4 | Medium | Th+Mat | |
| 185 | How does Newton's method compare with gradient descent? What does one Newton step do on from , and why is Newton's method not used to train large neural networks? |
Linear algebra and optimisation | L4 | Medium | Th+Mat | |
| 186 | How does the mini-batch size affect the noise in stochastic gradient descent? What is the variance of a mini-batch gradient, and what is the “linear scaling rule” for the learning rate? |
Linear algebra and optimisation | L4 | Medium | Th+Mat | |
| 187 | If a data matrix has singular values , how does adding () change the eigenvalues and condition number of , and why does this explain both numerical stability and Tikhonov regularisation? |
Linear algebra and optimisation | L4 | Medium | Th+Mat | |
| 188 | For , where , , and is symmetric, how do you derive using differentials and verify every matrix product by its shapes? |
Linear algebra and optimisation | L4 | Medium | Mat | |
| 189 | How do quasi-Newton methods (BFGS and L-BFGS) approximate the Hessian without computing second derivatives, what are the secant equation and the curvature condition , and how does L-BFGS reduce memory from to ? |
Linear algebra and optimisation | L4 | Medium | Th+Mat | |
| 190 | Why can deterministic gradient descent take arbitrarily long or get trapped near a strict saddle point, and how do stochastic gradient noise (SGD) or perturbed gradient descent escape strict saddles? |
Linear algebra and optimisation | L4 | Medium | Th+Mat | |
| 191 | For least-squares linear regression , how does the condition number of govern the convergence speed of gradient descent, and why does standardising features speed up gradient descent even though it leaves the closed-form predictions unchanged? |
Linear algebra and optimisation | L4 | Medium | Th+Mat | |
| 192 | Minimise with , and using the conjugate gradient method. How do you show that it reaches the exact minimiser in two steps, and why does this happen? |
Linear algebra and optimisation | L4 | Long | Mat | |
| 193 | Let be convex and -smooth, with minimiser . How do you prove that gradient descent with step size satisfies ? |
Linear algebra and optimisation | L5 | Long | Mat | |
| 194 | How do you prove that for a real symmetric matrix with eigenvalues , the Rayleigh quotient satisfies , and how does the Courant–Fischer min–max theorem characterise the -th eigenvalue ? |
Linear algebra and optimisation | L5 | Long | Mat | |
| 195 | How do you prove the Eckart–Young–Mirsky theorem in the spectral norm: for any matrix with singular values and any matrix of rank at most , why must , and why does the truncated SVD achieve equality? |
Linear algebra and optimisation | L5 | Long | Mat | |
| 196 | How do you derive the block-matrix determinant formula via block factorisation (assuming is invertible), and how does it prove the matrix determinant lemma ? |
Linear algebra and optimisation | L5 | Long | Mat | |
| 197 | Let be -strongly convex and -smooth with unique minimiser . How do you prove that gradient descent with step size achieves linear convergence ? |
Linear algebra and optimisation | L5 | Long | Mat | |
| 198 | Let be convex with minimiser , and suppose stochastic gradients satisfy and . How do you prove that SGD with fixed step size satisfies for , and what step size gives the optimal rate? |
Linear algebra and optimisation | L5 | Long | Mat | |
| 199 | For a differentiable convex optimisation problem subject to ( convex) and (affine), how do you prove that any point satisfying the KKT conditions is globally primal-dual optimal and achieves zero duality gap? |
Linear algebra and optimisation | L5 | Long | Mat | |
| 200 | When we fit a straight line to data points by least squares, what exactly is the line trying to make small? |
Supervised learning | L1 | One-liner | Th | |
| 201 | A model scores each student with a number (positive leans towards "will pass", negative towards "will fail"). Why does logistic regression pass through the sigmoid function , and what does the output mean? For example, what does become? |
Supervised learning | L1 | Short | Th | |
| 202 | What is a decision tree, and how does it use a chain of yes/no questions to decide the class of a new example? Use "go out to play or stay in" as your example? |
Supervised learning | L1 | Short | Th | |
| 203 | What is the difference between multiclass and multilabel classification? Can you give one everyday example of each? |
Supervised learning | L1 | One-liner | Th | |
| 204 | Why should you standardise features before running k-nearest neighbours (k-NN)? |
Supervised learning | L1 | One-liner | Th | |
| 205 | What is the difference between bagging and boosting, in one sentence? |
Supervised learning | L1 | One-liner | Th | |
| 206 | In plain words, what does the hinge loss punish in a classifier, and what is the loss for a point with correct label when the model's score for it is ? |
Supervised learning | L1 | Short | Th+Mat | |
| 207 | In a soft-margin support vector machine (SVM), what does the hyperparameter control? |
Supervised learning | L1 | One-liner | Th | |
| 208 | A fraud dataset has 99.5% legitimate and 0.5% fraudulent transactions, and your classifier reports 99.5% accuracy. Is it a good classifier, and how would you handle the imbalance? |
Supervised learning | L1 | Short | Th | |
| 209 | What is the Bayes classifier for minimum error rate, and why does picking the most probable class minimise your chance of being wrong? |
Supervised learning | L1 | Short | Th | |
| 210 | What is the difference between a generative and a discriminative classifier? What is one example of each, and when would you prefer each? |
Supervised learning | L1 | Short | Th | |
| 211 | In k-nearest neighbours classification, what happens to the decision boundary when and when (the training set size)? How does this show the bias–variance trade-off, and how would you choose ? |
Supervised learning | L1 | Short | Th | |
| 212 | What is a kernel density estimate (Parzen window estimate), and what does the bandwidth control? Why is the method called non-parametric? |
Supervised learning | L1 | Short | Th | |
| 213 | What is the perceptron learning rule for labels , and how does one update move the prediction in the right direction? |
Supervised learning | L1 | Short | Th+Mat | |
| 214 | Why should you standardise the features before fitting ridge or lasso regression, but not necessarily before ordinary least squares? |
Supervised learning | L1 | One-liner | Th | |
| 215 | How does Adaline (trained with the delta or LMS rule) differ from the perceptron, in the quantity used for the update and in the loss being minimised? |
Supervised learning | L1 | Short | Th+Mat | |
| 216 | What do Gini impurity and entropy measure in a two-class decision-tree node, and what are their values when the positive-class proportion is (evenly mixed) and (pure)? |
Supervised learning | L1 | Short | Th+Mat | |
| 217 | How many binary classifiers do one-vs-rest (OvR) and one-vs-one (OvO) need for classes? For classes , suppose the OvO classifiers say beats , beats , beats , beats , beats and beats . What does OvO predict, and why can OvR be ambiguous? |
Supervised learning | L1 | Short | Th+Mat | |
| 218 | Why does a random forest have lower variance than a single deep decision tree? |
Supervised learning | L2 | Short | Th | |
| 219 | A logistic regression model gives , with , and . (a) What is the decision boundary for threshold 0.5? (b) What is it for threshold 0.8? (c) How is the point classified under each threshold? |
Supervised learning | L2 | Short | Mat | |
| 220 | A spam filter uses two yes/no features: = “contains the word offer” and = “contains a link”. The training set has 10 emails: 4 spam and 6 ham (not spam). Among spam, in 3 emails and in 3. Among ham, in 1 email and in 2. Using Bernoulli naive Bayes, how is a new email with classified (a) with maximum-likelihood estimates and (b) with Laplace (add-one) smoothing, and what is the posterior in each case? |
Supervised learning | L2 | Medium | Mat | |
| 221 | A node holds 16 samples, 8 positive and 8 negative. Split sends 6 samples (5 positive, 1 negative) left and 10 samples (3 positive, 7 negative) right. Split sends 8 samples (6 positive, 2 negative) left and 8 samples (2 positive, 6 negative) right. What is the information gain (using base-2 entropy) of each split, and which split is chosen? |
Supervised learning | L2 | Medium | Mat | |
| 222 | Write the hinge loss and the logistic loss as functions of the margin , where is the label and the classifier's score, and evaluate both at . What does the difference in their shapes mean for the classifiers they produce? |
Supervised learning | L2 | Short | Th+Mat | |
| 223 | A feature has class-conditional densities for class and for class , with priors and . For equal-variance 1-D Gaussians, the Bayes decision boundary is . What is , which class is predicted for , and how does the unequal prior shift the boundary? |
Supervised learning | L2 | Medium | Mat | |
| 224 | A screening test must decide between "disease" () and "healthy" (). The loss is 0 for a correct decision, 20 for declaring "healthy" when the person has the disease, and 1 for declaring "disease" when the person is healthy. For one patient the posterior is . Which decision minimises the expected loss, and above what posterior probability of disease should we declare "disease"? |
Supervised learning | L2 | Medium | Mat | |
| 225 | A 3-class classifier may also reject (refuse to decide). A wrong decision costs 1, a correct decision costs 0, and rejecting costs . For the posteriors and , what should the classifier do? What is the general rule in terms of ? |
Supervised learning | L2 | Short | Mat | |
| 226 | The training points are red, red, blue, blue and blue. Using Euclidean distance, classify the query with , and . What does this tell you about the choice of ? |
Supervised learning | L2 | Short | Mat | |
| 227 | A multinomial naive Bayes spam filter uses the vocabulary . Training: spam documents "win win cash" and "cash cash"; ham documents "meeting win" and "meeting meeting cash". Using Laplace (add-one) smoothing, classify the new document "win meeting meeting". Why is the smoothing needed? |
Supervised learning | L2 | Medium | Mat | |
| 228 | Four observations are . What is the estimated density at using (a) a box kernel of width , that is for with , and (b) a Gaussian kernel with ? |
Supervised learning | L2 | Medium | Mat | |
| 229 | For the four data points , set up and solve the normal equations for the line . What are the residual sum of squares and the unbiased noise-variance estimate ? |
Supervised learning | L2 | Medium | Mat | |
| 230 | Run the perceptron algorithm with learning rate 1, starting from and , on the points with label , with , with and with , in this order. A point counts as a mistake if . What are the weights after each update, and when does it stop? |
Supervised learning | L2 | Medium | Mat | |
| 231 | An Adaline has two weights, no bias, starting at , with learning rate and the delta rule . Apply it to the sample with target , then to with target . What are the weights after each step? For what range of is a single repeated sample stable? |
Supervised learning | L2 | Medium | Mat | |
| 232 | With candidate features, how many models does best-subset selection have to consider, and how many model fits does forward stepwise selection need? What changes for , and why might forward stepwise still give a worse model than best subset? |
Supervised learning | L2 | Short | Th+Mat | |
| 233 | A three-class softmax model produces scores (logits) for an input. Compute the class probabilities. If the true class is class 2, what is the cross-entropy loss, and what is the gradient of the loss with respect to ? |
Supervised learning | L2 | Medium | Mat | |
| 234 | A linear classifier has and . What are the hinge loss and the 0–1 loss on the points with label , with label , and with label ? |
Supervised learning | L2 | Short | Mat | |
| 235 | What is the difference between multiclass and multilabel classification, and how do the output activation, the loss and the prediction rule differ for a neural or linear model with outputs? What are three ways to reduce multilabel to simpler problems? |
Supervised learning | L2 | Medium | Th | |
| 236 | A node has 10 samples, 6 positive and 4 negative. A split sends 5 samples left (4 positive, 1 negative) and 5 right (2 positive, 3 negative). What is the Gini impurity of the parent and of the two children, and what is the Gini gain of the split? |
Supervised learning | L2 | Short | Mat | |
| 237 | A node has 12 samples, 6 of each class. Attribute takes 12 distinct values (one per sample). Attribute splits the samples into two groups of 6: (5 positive, 1 negative) and (1 positive, 5 negative). Compute the information gain and the gain ratio of both attributes. Which one does ID3 pick and which does C4.5 pick, and why? |
Supervised learning | L2 | Medium | Mat | |
| 238 | Take the Gaussian (RBF) kernel on the 1-D points . Write the Gram matrix. What happens to the Gram matrix when the width is made very small and when it is made very large, and what does that mean for an SVM? |
Supervised learning | L2 | Medium | Th+Mat | |
| 239 | In round 1 of AdaBoost on points with equal weights , a stump misclassifies 3 points. What are its error , its weight , and the new normalised weights of the misclassified and the correctly classified points? |
Supervised learning | L2 | Medium | Mat | |
| 240 | A regression tree is grown on with . Which threshold does the first split choose using the sum of squared errors (SSE), and what are the leaf predictions and the SSE reduction? |
Supervised learning | L2 | Medium | Mat | |
| 241 | In cost-complexity pruning, the cost of a tree is , where is the training error rate and the number of leaves. Node (as a leaf) has , and the subtree below it has 4 leaves with total error . Node in another branch has , and its subtree has 2 leaves with . At what is each pruned, which goes first, and how is chosen? |
Supervised learning | L2 | Medium | Th+Mat | |
| 242 | In stacking, a meta-learner is trained on the predictions of base models. Why must the meta-features be out-of-fold predictions, and how are they produced with 5-fold cross-validation for 3 base models? What goes wrong if you use the base models' predictions on their own training data? |
Supervised learning | L2 | Medium | Th | |
| 243 | The Huber loss with threshold has derivative equal to minus the clipped residual, where , so the optimal constant fit satisfies . When fitting a constant to , what does squared loss give, verify that satisfies the Huber condition for , and compare it with the mean and median? |
Supervised learning | L2 | Short | Th+Mat | |
| 244 | A linear regression model predicts monthly rent, in thousands of rupees, as , where is the flat's area in square feet and is the number of bedrooms. (a) What rent does it predict for a 600 sq ft flat with 2 bedrooms? (b) What does the number 3 mean? (c) Two flats both have 2 bedrooms but one is 100 sq ft larger. How much more rent does the model predict for it? |
Supervised learning | L2 | Short | Th+Mat | |
| 245 | Two weight vectors fit a training set equally well: and . Ridge adds the penalty and lasso adds , with . Compute both penalties for each vector. Which vector does each method prefer? |
Supervised learning | L2 | Short | Th+Mat | |
| 246 | How do you derive the hard-margin SVM objective, and why is the margin , where is the weight vector? |
Supervised learning | L3 | Long | Mat | |
| 247 | How do you derive the normal equations for least-squares linear regression? When is singular, what do you do then, and what is a concrete example of a singular design? |
Supervised learning | L3 | Medium | Mat | |
| 248 | What is the closed-form solution of ridge regression, , and, using the singular value decomposition , which directions does ridge shrink the most? |
Supervised learning | L3 | Medium | Mat | |
| 249 | Why does the lasso give coefficients that are exactly zero while ridge does not? When the design is orthonormal (), what is the lasso solution and how does it compare with ridge? |
Supervised learning | L3 | Medium | Th+Mat | |
| 250 | How can you show that on is a valid kernel by finding a feature map with ? What is Mercer's condition, and why does it show that is not a valid kernel? |
Supervised learning | L3 | Medium | Th+Mat | |
| 251 | A linear support vector regression (SVR) with an -insensitive loss, and , is trained on five points and learns (so , ). The points are , , , and . Using the dual variables, which points are support vectors, and which have zero training loss? |
Supervised learning | L3 | Medium | Th+Mat | |
| 252 | Two regression models and are combined as . Assume both are unbiased, their errors and have variances and , and , where is the correlation of the errors. Which minimises the variance of the combined error, and what is that minimum variance? |
Supervised learning | L3 | Medium | Mat | |
| 253 | A binary classification training set has 64 one-dimensional samples, 32 from each class, and all 64 values of are distinct. A decision tree splits with thresholds and keeps splitting until every leaf is pure. Justify each answer. (a) What is the maximum possible training accuracy? (b) What is the maximum possible depth of the tree? (c) What is the minimum possible depth? (d) Does the minimum-depth tree need regularisation? |
Supervised learning | L3 | Medium | Th+Mat | |
| 254 | What is the AdaBoost algorithm for binary labels , and when and why must a weak classifier be rejected, in terms of its weight ? |
Supervised learning | L3 | Long | Th+Mat | |
| 255 | Class 0 has points and class 1 has points . With equal priors, fit LDA (shared covariance). What are the discriminant direction and the boundary, and which class is the query assigned to? |
Supervised learning | L3 | Long | Mat | |
| 256 | For two classes, Fisher's criterion is , where are the class means and is the total within-class scatter matrix. Show that the maximiser is . How do you check it for and ? |
Supervised learning | L3 | Long | Th+Mat | |
| 257 | In Gaussian discriminant analysis with (the same for both classes) and , show that , the logistic function of a linear function of . Give and . For , , , in one dimension, what is ? |
Supervised learning | L3 | Medium | Th+Mat | |
| 258 | In one dimension, class 1 has density and class 2 has density (variance 4), with equal priors. Where are the Bayes decision boundaries, and which class is chosen in each region? Why is the boundary not a single point? |
Supervised learning | L3 | Medium | Mat | |
| 259 | A Gaussian naive Bayes classifier has two classes. Class A has prior , feature means and feature variances . Class B has prior , means and variances . Which class is the point assigned to? |
Supervised learning | L3 | Medium | Mat | |
| 260 | points are drawn uniformly in the unit ball in dimensions. Show that the median distance from the origin to the nearest point is . What is its value for with and , and what does it mean for k-NN? |
Supervised learning | L3 | Medium | Th+Mat | |
| 261 | Multiple discriminant analysis (multi-class Fisher LDA) solves . For classes in dimensions with training points, how many useful discriminant directions are there, and what goes wrong with ? How can you fix it? |
Supervised learning | L3 | Medium | Th+Mat | |
| 262 | For GDA with binary , and , how do you derive the maximum likelihood estimates of , , and from labelled points? |
Supervised learning | L3 | Long | Mat | |
| 263 | Show that a naive Bayes classifier with two classes and binary features is a linear classifier in , and give its weights. For , , , , , find the log-odds for and . What goes wrong if feature 2 is copied twice? |
Supervised learning | L3 | Long | Th+Mat | |
| 264 | In least-squares linear regression, why is the fitted vector the orthogonal projection of onto the column space of , and what does this say about the residuals? |
Supervised learning | L3 | Short | Th | |
| 265 | Fit a straight line (intercept and slope) to the three points . What are the hat matrix diagonal entries , do they sum to 2, and what is the residual vector? |
Supervised learning | L3 | Medium | Mat | |
| 266 | How do you derive the log-likelihood, the gradient and the Hessian of binary logistic regression, show that the log-likelihood is concave, and carry out one Newton step from on the data , (one feature, no intercept)? |
Supervised learning | L3 | Long | Mat | |
| 267 | For ridge regression, define the effective degrees of freedom and express it with the singular values of . If has singular values and , what are and the shrinkage factor on each direction? |
Supervised learning | L3 | Medium | Mat | |
| 268 | Assume with , and of full column rank . How do you prove that , so that is unbiased? |
Supervised learning | L3 | Medium | Mat | |
| 269 | Write a distribution in exponential-dispersion form . How do you show that the Bernoulli and Poisson distributions fit this form, what is the canonical link in each case, and why does a canonical link make the log-likelihood gradient equal to ? |
Supervised learning | L3 | Long | Mat | |
| 270 | For -class softmax regression with , derive the gradient of the negative log-likelihood with respect to . How do you show that the parameters are redundant (not identifiable), and how is this fixed? |
Supervised learning | L3 | Long | Mat | |
| 271 | Fit the points with (a) a quadratic and (b) a straight line. Find each fit and its residual sum of squares. Why is the quadratic exact, and what goes wrong if you try a cubic? |
Supervised learning | L3 | Medium | Mat | |
| 272 | The elastic net minimises . How do you show that it is a lasso problem on augmented data, and what does this imply for the number of variables it can select and for correlated features? |
Supervised learning | L3 | Long | Mat | |
| 273 | Show that ridge regression is the MAP (maximum a posteriori) estimate under a Gaussian prior, and lasso under a Laplace prior, when the noise is Gaussian. If the noise variance is and the prior is with , what ridge does this give? |
Supervised learning | L3 | Medium | Mat | |
| 274 | Take an orthonormal design () with noise variance . For one coefficient with true value , find the mean squared error of the ridge estimate as a function of . Show that some always beats OLS, find the best , and evaluate it for , . Why is this not a free lunch? |
Supervised learning | L3 | Long | Mat | |
| 275 | A 1-D training set has with label , and and with label . What are the hard-margin SVM , and the dual variables , and which points are support vectors? |
Supervised learning | L3 | Medium | Mat | |
| 276 | How do you derive the dual of the soft-margin SVM subject to and ? How do you show the box constraint , and what are the KKT conditions that classify each point? |
Supervised learning | L3 | Long | Mat | |
| 277 | The SVM objective is minimised by stochastic subgradient descent (Pegasos) with step . With and , what is the result of running three steps on the single points , and , in that order, and what is the update rule? |
Supervised learning | L3 | Medium | Mat | |
| 278 | With squared loss, run two rounds of gradient boosting on and , using a stump that splits between and in each round and a learning rate . What is the training MSE before boosting (the constant model), after round 1, and after round 2? |
Supervised learning | L3 | Medium | Mat | |
| 279 | How do you show that the AdaBoost classifier weight is the value that minimises the exponential loss, given a weak classifier with weighted error ? |
Supervised learning | L3 | Medium | Mat | |
| 280 | In a screening task, a false negative costs 20 and a false positive costs 1, with no cost for correct decisions. What probability threshold minimises expected cost? A model trained after keeping only 10% of the negatives outputs for a patient. What is the true probability, and what do we decide? |
Supervised learning | L3 | Medium | Mat | |
| 281 | The four XOR points and with label , and and with label , are not linearly separable. Solving the hard-margin SVM dual with the kernel , what are the , the bias and the decision function? |
Supervised learning | L3 | Long | Mat | |
| 282 | A soft-margin SVM uses a different penalty for each class: with the usual constraints. What changes in the dual and in the KKT conditions? In what direction does the boundary move if , and how would you choose for an imbalanced dataset? |
Supervised learning | L3 | Medium | Th+Mat | |
| 283 | Prove that information gain from any split is non-negative, and say when it is exactly zero. Can it be zero for a split that is useful? |
Supervised learning | L3 | Medium | Mat | |
| 284 | Kernel ridge regression uses the kernel on one-dimensional inputs, with penalty . The training data are and . Find the dual coefficients and predict at . Why is the dual form useful? |
Supervised learning | L3 | Medium | Th+Mat | |
| 285 | Locally weighted linear regression predicts at a query by minimising with weights . For the data , bandwidth and query , compute the prediction. How does it compare with the ordinary least-squares prediction at ? |
Supervised learning | L3 | Medium | Mat | |
| 286 | The pinball (quantile) loss for level is if and if , with . Show that the constant minimising is the -quantile of . How do you check it numerically for on ? |
Supervised learning | L3 | Long | Th+Mat | |
| 287 | Gradient boosting for binary classification uses the log loss with as the log-odds. The data are with labels . Start from the best constant, grow a stump that splits between and , and use Newton leaf values with learning rate . What are the new probabilities? |
Supervised learning | L3 | Long | Mat | |
| 288 | A hard-margin linear SVM is trained on with label and on , and with label . Find , , the margin and the dual variables . Which points are support vectors? |
Supervised learning | L3 | Medium | Mat | |
| 289 | In Poisson regression the count has mean (one weight, no intercept). The data are and . What are the log-likelihood, its gradient and Hessian, and the result of two Newton steps from ? |
Supervised learning | L3 | Medium | Mat | |
| 290 | Two classes have one-dimensional Gaussian class-conditional densities with the same variance , means and priors , . What is the Bayes decision boundary (derive it), and what is it for , , , , , and which class is predicted at ? |
Supervised learning | L3 | Medium | Th+Mat | |
| 291 | The Huber loss with threshold is for and otherwise, where is the residual. How do you derive , show that is convex, and use this to show that the optimal constant for the data with is ? |
Supervised learning | L3 | Medium | Mat | |
| 292 | You want an ensemble of linear SVMs. What are two different ways to get different linear SVMs from one training set, why does each make the SVMs differ, and why must the ensemble combine their votes rather than average their real-valued scores? |
Supervised learning | L4 | Medium | Th | |
| 293 | The linear SVM minimises , where and is the label. What changes if the penalty is replaced by , in the solution, the optimisation problem, the use of kernels and the meaning of the margin? |
Supervised learning | L4 | Medium | Th+Mat | |
| 294 | Why is gradient boosting called gradient descent in function space, what are the pseudo-residuals for squared, absolute and logistic loss, and what is the full algorithm with regression trees as base learners? |
Supervised learning | L4 | Long | Th+Mat | |
| 295 | For a kernel density estimate in one dimension, derive the leading terms of its bias and variance at a point . Hence what is the bandwidth that minimises the asymptotic mean squared error, and at what rate does the error shrink with ? |
Supervised learning | L4 | Long | Mat | |
| 296 | Show that, as , the error rate of the 1-nearest-neighbour classifier for two classes is at most , where is the Bayes error. What does it say numerically for ? |
Supervised learning | L4 | Long | Mat | |
| 297 | LDA and logistic regression both give linear decision boundaries. When would you expect each to do better, and why, in terms of data size, model correctness and outliers? |
Supervised learning | L4 | Medium | Th | |
| 298 | Under what conditions on does the k-NN classifier approach the Bayes error as ? Why does a fixed not suffice, and why is a sensible choice? |
Supervised learning | L4 | Medium | Th | |
| 299 | Two classes have densities and with equal priors. Show that the Bayes error is , where and is the standard normal cdf. What is its value for , , , and how does it compare with the Bhattacharyya bound? |
Supervised learning | L4 | Long | Mat | |
| 300 | Derive why the directions that maximise the multi-class Fisher criterion are the leading eigenvectors of . Start with a single direction and maximise . How do you show that for two classes the result reduces to ? |
Supervised learning | L4 | Long | Mat | |
| 301 | Prove that the leave-one-out residual of ordinary least squares is , where is the ordinary residual and the leverage, so LOOCV needs only one fit. How do you check it on the points by computing the LOOCV mean squared error both ways? |
Supervised learning | L4 | Long | Mat | |
| 302 | Prove the perceptron convergence theorem: if there is a unit vector and a margin such that for all , and , then the perceptron (starting from ) makes at most mistakes. Why does the bound not depend on the number of points or the dimension? |
Supervised learning | L4 | Long | Mat | |
| 303 | Describe the least angle regression (LAR) algorithm and how it relates to the lasso path. In the case (two orthonormal columns) with : what is the path of coefficients as a function of the penalty , and where does each variable enter? |
Supervised learning | L4 | Long | Th+Mat | |
| 304 | A 1-D dataset has with and with , and the model is (no intercept). How do you show that the maximum-likelihood estimate does not exist, what happens to the Hessian, and how does an L2 penalty fix it? |
Supervised learning | L4 | Long | Mat | |
| 305 | Describe how partial least squares (PLS) builds its first component, and how it differs from principal components regression (PCR). Take centred with , for samples: what are the first PLS direction and the one-component fit coefficients, and how do they compare with OLS? |
Supervised learning | L4 | Long | Th+Mat | |
| 306 | How is the optimal leaf weight and the split gain derived in XGBoost's second-order objective? How do you apply it to 6 samples with logistic loss, current prediction (so ), labels in the left candidate leaf and in the right, , ? |
Supervised learning | L4 | Long | Mat | |
| 307 | A random forest has features (a truly informative binary variable) and (a continuous pure-noise variable). Why can mean decrease in impurity (MDI) rate as important, and how does permutation importance on the out-of-bag (OOB) data fix this? What is its own weakness with correlated features? |
Supervised learning | L4 | Medium | Th | |
| 308 | For a hard-margin SVM trained on linearly separable points, how do you prove that the leave-one-out error is at most , where is the number of support vectors, and what does this imply about the expected test error? |
Supervised learning | L5 | Medium | Th+Mat | |
| 309 | For two classes, how do you derive the asymptotic error of the 3-nearest-neighbour rule as a function of the posterior , and how do you show that it is never worse than the 1-NN rule at every ? What are the errors of both rules when the local Bayes error is ? |
Supervised learning | L5 | Long | Mat | |
| 310 | Write the optimality (KKT) conditions for the lasso . Using them, what is the smallest at which , and how do you verify that is the solution for , , ? |
Supervised learning | L5 | Long | Mat | |
| 311 | Prove the Gauss–Markov theorem: under with , and of full column rank, the OLS estimator has the smallest covariance matrix among all linear unbiased estimators. Why does this not rule out ridge regression doing better in MSE? |
Supervised learning | L5 | Long | Mat | |
| 312 | How do you prove that the Gaussian kernel is a valid (positive semi-definite) kernel, using only the linear kernel and closure rules? |
Supervised learning | L5 | Long | Mat | |
| 313 | How do you prove that the training error of AdaBoost is at most , where ? For and training points, after how many rounds is the training error zero? |
Supervised learning | L5 | Long | Mat | |
| 314 | Consider a kernel with reproducing-kernel Hilbert space (RKHS) . How do you prove that a minimiser of , with , has the form ? Why does this make kernel SVMs practical? |
Supervised learning | L5 | Long | Mat | |
| 315 | In clustering we group points that are "close" to each other. How do we measure closeness with the Euclidean (straight-line) distance, and what is it between the points and ? |
Unsupervised learning | L1 | Short | Th+Mat | |
| 316 | How does the k-means clustering algorithm group unlabelled data points into clusters, and what happens in one full iteration on the 1-D (one-dimensional) points with starting from initial centres and ? |
Unsupervised learning | L1 | Short | Th+Mat | |
| 317 | What does principal component analysis (PCA) do to a dataset, what are principal components geometrically, and why do we often keep only the first few? |
Unsupervised learning | L1 | Short | Th | |
| 318 | Why should you usually standardise features before running principal component analysis (PCA)? |
Unsupervised learning | L1 | One-liner | Th | |
| 319 | How do you choose the number of clusters for k-means, and why can't you just pick the that minimises the k-means objective? |
Unsupervised learning | L1 | Short | Th | |
| 320 | Why is k-medoids (PAM) more robust to outliers than k-means, and what does it cost you? |
Unsupervised learning | L1 | Short | Th | |
| 321 | What is the difference between AGNES and DIANA in hierarchical clustering, and which is cheaper to run? |
Unsupervised learning | L1 | Short | Th | |
| 322 | In DBSCAN with radius and threshold , how are a core point, a border point and a noise point defined, and how are clusters formed from them? |
Unsupervised learning | L1 | Short | Th | |
| 323 | How does an isolation forest detect anomalies, and why do anomalous points end up with shorter average path lengths? |
Unsupervised learning | L1 | Short | Th | |
| 324 | What is an undercomplete autoencoder, and why does it need a bottleneck narrower than the input to learn anything useful? |
Unsupervised learning | L1 | Short | Th | |
| 325 | What is collaborative filtering, and how do user-based and item-based neighbourhood methods differ? Which one scales better when there are far more users than items, and why? |
Unsupervised learning | L1 | Short | Th | |
| 326 | Does k-means always converge, and does it find the global optimum? |
Unsupervised learning | L2 | Short | Th+Mat | |
| 327 | What is k-means++ initialisation, and for the 1-D points with , if the first centre chosen is 0, what is the probability that each remaining point becomes the second centre? |
Unsupervised learning | L2 | Short | Th+Mat | |
| 328 | Five 1-D points are , , , and . With agglomerative clustering, what merges and merge heights do (a) single linkage and (b) complete linkage give, and how do the two linkages differ in practice? |
Unsupervised learning | L2 | Medium | Mat | |
| 329 | A clustering of 1-D data gives cluster 1 and cluster 2 . What are the silhouette values of the points and , and what do they tell you? |
Unsupervised learning | L2 | Short | Mat | |
| 330 | Six records have three categorical attributes: , , , , , . Run k-modes with from initial modes and , using the simple matching dissimilarity. What are the clusters, the new modes and the total cost? |
Unsupervised learning | L2 | Medium | Mat | |
| 331 | In mini-batch k-means (Sculley's version) each centre has a count of points it has absorbed. For each point assigned to it, the update is , with . In 1-D the centres are with and with . A mini-batch arrives. What are the new centres, and why does this update make sense? |
Unsupervised learning | L2 | Medium | Mat | |
| 332 | Take the 1-D points with and absolute-difference distance. Starting from medoids , compute the total cost, then the cost after swapping medoid 1 with the non-medoid 2. Does PAM accept the swap, and is optimal? |
Unsupervised learning | L2 | Medium | Mat | |
| 333 | Six points have true classes (points 1–6) and a clustering puts points in cluster 1 and in cluster 2. Compute the Rand index and the purity. Why is the Rand index alone not enough? |
Unsupervised learning | L2 | Medium | Mat | |
| 334 | Three 1-D clusters are , and . Using the Euclidean distance, compute the Davies–Bouldin index. Is a larger or smaller value better? |
Unsupervised learning | L2 | Medium | Mat | |
| 335 | Run DBSCAN with and (counting the point itself) on the 1-D points . Label each point as core, border or noise. What happens to the point 5? |
Unsupervised learning | L2 | Medium | Mat | |
| 336 | Four items have dissimilarities , , , , , . If you run agglomerative clustering with single, complete and average linkage, what are the merge order and heights for each, and which linkage shows the chaining effect? |
Unsupervised learning | L2 | Medium | Mat | |
| 337 | A self-organising map has three neurons on a line with weight vectors , and . The input is , the learning rate is and the neighbourhood is with , where is the distance on the map between neurons (neurons 1, 2, 3 are at positions 1, 2, 3). Which neuron wins, and what are the three weight vectors after one update? |
Unsupervised learning | L2 | Medium | Mat | |
| 338 | The covariance matrix of a 4-dimensional dataset has eigenvalues , , and . (a) What fraction of the variance does each principal component explain? (b) How many components are needed to keep at least 90% of the variance? (c) What is the average squared reconstruction error per point when you keep that many? |
Unsupervised learning | L2 | Medium | Mat | |
| 339 | Four 2-D points are , , and . What are the sample covariance matrix, the first principal component, the fraction of variance it explains, and the coordinate of the first point along it? |
Unsupervised learning | L2 | Medium | Mat | |
| 340 | In matrix factorisation for recommendation, a rating is modelled as with user vector and item vector . With squared loss plus L2 penalty , learning rate and , perform one stochastic gradient step on this rating. What are the new , and prediction? |
Unsupervised learning | L2 | Medium | Mat | |
| 341 | A Gaussian kernel density estimate with bandwidth is built from the three 1-D points , and . (a) Write and compute for . (b) What does become for , and what does the change in do to the estimate in general? |
Unsupervised learning | L2 | Medium | Th+Mat | |
| 342 | A one-class SVM with an RBF kernel is trained on normal points with . (a) What does guarantee about the number of training points outside the learned boundary and the number of support vectors? (b) What happens if you set instead, and why would be a poor choice for contaminated data if set too small? |
Unsupervised learning | L2 | Short | Th+Mat | |
| 343 | Five shopping baskets are T1 = {A, B, C}, T2 = {A, B}, T3 = {A, C}, T4 = {B, C, D} and T5 = {A, B, C, D}. Run Apriori with minimum support count 2 to list all frequent itemsets. Then, for the rules and , compute confidence and lift. Which rule shows a real association? |
Unsupervised learning | L2 | Medium | Mat | |
| 344 | Six points on a line are 1, 2, 3, 10, 11 and 12. Using a flat kernel of radius 2.5 (all points within distance 2.5 get equal weight), run mean shift by hand from the starting positions and . Where does each run stop, and what do you learn about the number of clusters? |
Unsupervised learning | L2 | Medium | Mat | |
| 345 | How do you derive PCA as finding the direction of maximum variance? |
Unsupervised learning | L3 | Long | Mat | |
| 346 | A data matrix has one feature per column. Its covariance matrix decomposes as with and . (a) What is the shape of ? (b) What steps compute from , and what is explicitly? (c) To what dimension would you reduce the data with PCA, onto which direction, and why? |
Unsupervised learning | L3 | Medium | Mat | |
| 347 | Normal data in 2-D is modelled as a Gaussian with mean and covariance . What is the squared Mahalanobis distance of and of , which is anomalous at the 1% level, and would a model that treats the two features as independent Gaussians notice the difference? |
Unsupervised learning | L3 | Medium | Mat | |
| 348 | A 2-D dataset has two clusters: 50 points evenly spaced on a circle of radius 1 and 200 points evenly spaced on a circle of radius 5, both centred at the origin. (a) Can fuzzy c-means with separate the two rings? (b) Can DBSCAN, and which values of and MinPts work, which fail, and why? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 349 | How do you compute PCA from the singular value decomposition (SVD) of the centred data matrix , how are the principal directions, variances and projected coordinates read off it, and why is the SVD route preferred in practice? |
Unsupervised learning | L3 | Medium | Mat | |
| 350 | How do you show that Ward's linkage, which merges the pair of clusters that least increases the total within-cluster sum of squares, has merge cost ? How do you check it on and ? |
Unsupervised learning | L3 | Long | Mat | |
| 351 | A 1-D Gaussian mixture has two components with equal weights , means and , and both variances equal to 1. For the data , what are the E-step responsibilities and the updated weights and means after one EM iteration? |
Unsupervised learning | L3 | Long | Mat | |
| 352 | In EM for a Gaussian mixture with weights , means and covariances , how do you derive the M-step updates for , and from the expected complete-data log-likelihood? |
Unsupervised learning | L3 | Long | Mat | |
| 353 | A graph on four nodes has edge weights , , and no other edges. Write the unnormalised Laplacian and find its second-smallest eigenvalue and eigenvector. What clustering does the sign of that eigenvector give, and how does the eigenvalue compare with the RatioCut of that split? |
Unsupervised learning | L3 | Long | Mat | |
| 354 | BIRCH summarises a sub-cluster by a clustering feature . Why are these three numbers enough, and what are the CFs and radius when is merged with ? If the threshold is , is the merge allowed? |
Unsupervised learning | L3 | Long | Th+Mat | |
| 355 | In OPTICS with and (counting the point itself) on the 1-D points , compute the core distance of points 4, 6 and 7.2 and the reachability distances of 6 from 4, of 7.0 from 6, and of 7.4 from 7.2. Why does OPTICS handle this data better than one DBSCAN run? |
Unsupervised learning | L3 | Long | Th+Mat | |
| 356 | CURE represents each cluster by several well-scattered representative points that are shrunk towards the cluster centroid by a factor . In 2-D, a cluster with centroid has a representative at . With , where does it go? Why does the shrinking help, and what happens at and ? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 357 | The gap statistic compares (the log within-cluster dispersion) with its expectation under a reference null with no cluster structure. For suppose , the reference expectations are , and all . Compute the gaps and choose by the standard "one standard error" rule. Why not pick the with the largest gap? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 358 | Three points have pairwise distances , and . Use classical multidimensional scaling (MDS) with double centring to find the matrix and the 1-D embedding. Why is one dimension enough? |
Unsupervised learning | L3 | Medium | Mat | |
| 359 | How do you show that the directions of maximum variance also minimise the squared reconstruction error of PCA? How do you derive the error for components in terms of the eigenvalues of the covariance matrix? |
Unsupervised learning | L3 | Long | Mat | |
| 360 | Factor analysis models , with and noise where is diagonal. (a) What covariance does this imply for ? (b) For observed variables and factors, how many free parameters does it use compared with a full covariance, taking the rotation ambiguity into account? (c) How does it differ from PCA? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 361 | In independent component analysis (ICA) we observe with independent sources . (a) Why must at most one source be Gaussian? (b) Why is whitening the first step? (c) A source with unit variance is uniform on . Its excess kurtosis is . What is it, and what is the kurtosis of for two independent such sources? |
Unsupervised learning | L3 | Long | Th+Mat | |
| 362 | Five points lie on a unit half-circle at angles . Isomap uses a neighbourhood graph in which two points are joined if they are less than apart. (a) What is the graph (geodesic) distance between the first and last points, and how does it compare with the straight-line distance and the true arc length? (b) What goes wrong if the radius is too large, for example ? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 363 | An isolation forest uses sub-samples of size and scores a point with , where . (a) Compute . (b) Find for average path lengths , and and say what each means. (c) Why is in the formula? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 364 | In alternating least squares (ALS) for matrix factorisation, a user has rated two items, with item vectors and fixed and ratings and . (a) Derive the update that minimises for the user vector . (b) Compute for , and for . (c) Why is ALS attractive for large recommenders? |
Unsupervised learning | L3 | Long | Mat | |
| 365 | Probabilistic PCA models with and . The maximum-likelihood solution is and . (a) For and sample covariance eigenvalues , find and the scale of each column of for . (b) Why does the covariance of the model match the data in the top directions? (c) How does PPCA relate to ordinary PCA as ? |
Unsupervised learning | L3 | Long | Th+Mat | |
| 366 | A variational autoencoder's encoder outputs, for a 1-D latent code, a mean and standard deviation . (a) Compute . (b) Draw by the reparameterisation trick if the noise sample is . (c) Why do we need this trick, and what role does the KL term play compared with a plain autoencoder? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 367 | For , find the singular values, the best rank-1 approximation in the Frobenius norm, and the approximation error. What fraction of the squared Frobenius norm does keep, and why is this the best possible rank-1 choice? |
Unsupervised learning | L3 | Medium | Mat | |
| 368 | For a clustering of data points into clusters with centroids and overall mean , prove that total scatter = within-cluster scatter + between-cluster scatter. Why does this show that minimising k-means cost is the same as maximising between-cluster scatter? How do you check it on the 1-D clusters and ? |
Unsupervised learning | L3 | Medium | Mat | |
| 369 | Centred 2-D data has covariance . What is a whitening matrix so that has identity covariance? What is for , and how do you check that equals the Mahalanobis distance of ? |
Unsupervised learning | L3 | Medium | Mat | |
| 370 | Why can exact divisive (top-down) clustering not simply try every possible split of a cluster, and how does DIANA's splinter-group heuristic get around this? How many splits exist for and points, and what does one DIANA split give on the 1-D points (absolute difference as dissimilarity)? |
Unsupervised learning | L3 | Medium | Th+Mat | |
| 371 | t-SNE maps points to by minimising , where in the original space and in the embedding. (a) What happens to the embedding if is very large, or very small? (b) How is chosen in practice? |
Unsupervised learning | L4 | Medium | Th+Mat | |
| 372 | How is k-means a limiting case of EM for a Gaussian mixture model, and what assumptions about the clusters does this reveal? |
Unsupervised learning | L4 | Medium | Th+Mat | |
| 373 | How can the principal components in a feature space be found by solving an eigenvalue problem for the kernel matrix , with ? How are the coefficients normalised, how is centred, and how is a new point projected? |
Unsupervised learning | L4 | Long | Mat | |
| 374 | A linear autoencoder with a -dimensional bottleneck, encoder and decoder , is trained with squared reconstruction error on centred data. How does its solution relate to PCA, and what changes with a nonlinear autoencoder? |
Unsupervised learning | L4 | Medium | Th+Mat | |
| 375 | For a similarity graph with symmetric non-negative weights and degree matrix , let . How do you prove that , how does this show that the number of zero eigenvalues of equals the number of connected components, and why does this justify spectral clustering? |
Unsupervised learning | L4 | Medium | Mat | |
| 376 | In locally linear embedding (LLE), the weights reconstruct a point from its neighbours by minimising subject to . (a) Derive the closed-form weights using the local Gram matrix. (b) For with neighbours and , compute the weights. (c) What is the second stage of LLE, and why is regularisation needed when ? |
Unsupervised learning | L4 | Long | Mat | |
| 377 | UMAP builds a weighted neighbour graph with membership strengths , where is the distance from to its nearest neighbour. (a) For a point with neighbours at distances , and , find , solve for so the strengths sum to , and give the three strengths. (b) How are directed strengths combined into an undirected weight? (c) How do UMAP and t-SNE differ? |
Unsupervised learning | L4 | Long | Th+Mat | |
| 378 | Why is the log-likelihood of a Gaussian mixture unbounded above when each component has its own covariance matrix? How do you show it in one dimension with , and how do EM implementations avoid the problem? |
Unsupervised learning | L4 | Medium | Th+Mat | |
| 379 | For symmetric t-SNE with high-dimensional affinities (symmetric, with ) and low-dimensional affinities , how do you derive for ? What do the two terms mean, and why does the Student-t kernel help with the crowding problem? |
Unsupervised learning | L5 | Long | Mat | |
| 380 | How can the k-means objective be written as a trace problem over cluster indicator vectors, and what lower bound on the optimal SSE do you get by relaxing it to orthonormal matrices when the data are centred? |
Unsupervised learning | L5 | Long | Mat | |
| 381 | For a similarity graph with weights , degrees and Laplacian , how do you derive the relaxation of the two-way normalised cut into the generalised eigenproblem ? How do you check the bound on the graph with , ? |
Unsupervised learning | L5 | Long | Mat | |
| 382 | How do you show that DBSCAN* (DBSCAN without border points) at radius is the same as cutting a single-linkage tree built on the mutual reachability distance , where is the core distance? What does this say about and about the order-dependence of DBSCAN? |
Unsupervised learning | L5 | Long | Th+Mat | |
| 383 | For whitened data (zero mean, identity covariance), FastICA finds one independent component with the update followed by . How do you derive this fixed-point rule from the kurtosis contrast under using Newton's method? |
Unsupervised learning | L5 | Long | Mat | |
| 384 | Let be a symmetric positive semi-definite matrix with eigenvalues . How do you prove that over all matrices with orthonormal columns, is maximised by the top eigenvectors, with maximum value (the Ky Fan theorem)? Why does this justify PCA with components? |
Unsupervised learning | L5 | Long | Mat | |
| 385 | What is the difference between a perceptron and a logistic (sigmoid) neuron? |
Deep learning | L1 | Short | Th | |
| 386 | Why can a deep network with no non-linear activation functions represent nothing more than a single linear (affine) layer? |
Deep learning | L1 | Short | Th | |
| 387 | What is backpropagation in a neural network, and what roles do the forward pass and the backward pass play during training? |
Deep learning | L1 | Short | Th | |
| 388 | A neural network is trained on 2000 labelled examples with a batch size of 50. What are an epoch, a batch and an iteration, and how many iterations make up one epoch? |
Deep learning | L1 | One-liner | Th+Mat | |
| 389 | What is dropout in a neural network, why does randomly switching off neurons during training reduce overfitting, and what happens at test time? |
Deep learning | L1 | Short | Th | |
| 390 | What does batch normalisation do to the values a layer produces, and why does it help training? What are the new values if a feature takes the values and in a mini-batch? |
Deep learning | L1 | Short | Th+Mat | |
| 391 | What does it mean that a convolutional layer "shares" one small filter across the whole image, and why does that suit images? How many weights does one filter need, compared with one fully connected neuron looking at a greyscale image? |
Deep learning | L1 | Short | Th+Mat | |
| 392 | What is a "dead" ReLU unit? |
Deep learning | L1 | One-liner | Th | |
| 393 | What is the difference between valid padding and same padding in a stride-1 convolution? |
Deep learning | L1 | One-liner | Th | |
| 394 | When adapting a pretrained image classifier to a new dataset, when should you freeze the backbone and train only a new head versus fine-tuning the whole network? |
Deep learning | L1 | Short | Th | |
| 395 | Why does an ordinary autoencoder need a bottleneck smaller than the input dimension, or an explicit regulariser? |
Deep learning | L1 | One-liner | Th | |
| 396 | A multilayer perceptron takes 10-dimensional inputs, passes them through two hidden layers of widths 32 and 16 (each with biases), and outputs 4 class scores (logits). How many learnable parameters does it have? |
Deep learning | L1 | One-liner | Mat | |
| 397 | What goes wrong if you initialise every weight in a multi-layer perceptron to zero (or to the same non-zero constant )? |
Deep learning | L1 | Short | Th | |
| 398 | What is data augmentation, why does it reduce overfitting without collecting new labelled examples, and what are two concrete examples where a standard image augmentation like horizontal flipping or rotation breaks the ground-truth label? |
Deep learning | L1 | Short | Th | |
| 399 | You plot training and validation loss against epochs. What do the curves look like for (a) underfitting, (b) overfitting and (c) a learning rate that is too high, and what would you do in each case? |
Deep learning | L2 | Short | Th | |
| 400 | A three-class classifier outputs the probability vector , and the true class is the second one. What is the cross-entropy loss? |
Deep learning | L2 | One-liner | Mat | |
| 401 | Let , where the inputs and the parameters are all scalars and is the natural log. What is the computational graph with intermediate nodes, and how do you use backpropagation on it to compute ? |
Deep learning | L2 | Medium | Mat | |
| 402 | A convolutional layer takes a input and applies 16 filters of size with stride 1 and padding 2. What is the output shape, and how many learnable parameters does the layer have? What changes if the stride is 2 and the padding is 0? |
Deep learning | L2 | Short | Mat | |
| 403 | What is the receptive field of a unit after three stacked convolutions with stride 1, and how does their total parameter count compare with a single convolution (both with input and output channels, ignoring biases)? |
Deep learning | L2 | Short | Mat | |
| 404 | In dropout with keep probability , why are the kept activations divided by during training (inverted dropout), and what goes wrong at test time if you do not scale? |
Deep learning | L2 | Short | Th+Mat | |
| 405 | Why do convolutional neural networks suit image data better than fully connected MLPs, and what is the difference between translation equivariance and translation invariance? |
Deep learning | L2 | Short | Th | |
| 406 | Given the single-channel input and filter with bias , stride 1 and no padding, what is the output after cross-correlation, ReLU activation and max pooling with stride 1? |
Deep learning | L2 | Medium | Mat | |
| 407 | An activation tensor of shape passes through a convolutional layer with 64 filters (including biases). What are the output shape, the number of learnable parameters and the multiply-accumulate (MAC) count, and why do architectures such as Inception and ResNet use convolutions? |
Deep learning | L2 | Short | Mat | |
| 408 | A small CNN takes a image through: (1) a conv with 16 filters, stride 1, padding 1; (2) max pooling, stride 2; (3) a conv with 32 filters, stride 1, padding 1; (4) global average pooling; and (5) a 10-class linear head. Including biases, what are the output shape after each layer and the total parameter count, and why does global average pooling avoid a parameter explosion? |
Deep learning | L2 | Medium | Mat | |
| 409 | What single key architectural change did each of AlexNet, VGG, Inception, ResNet and DenseNet introduce over prior CNNs? |
Deep learning | L2 | Medium | Th | |
| 410 | In a U-Net encoder–decoder for image segmentation, why are encoder feature maps concatenated directly to the corresponding decoder layers instead of relying on the bottleneck alone? |
Deep learning | L2 | Short | Th | |
| 411 | How can a two-layer MLP with two ReLU hidden units and a linear output unit compute the XOR function on , and what values do its hidden units and output take on all four inputs? |
Deep learning | L2 | Short | Mat | |
| 412 | In a small computation graph, input feeds two branches that share the same weight : and , and the loss is . How do you compute by backpropagation, and what happens if an implementation overwrites instead of accumulating branch gradients? |
Deep learning | L2 | Short | Mat | |
| 413 | A hidden layer with independent inputs (each of mean and variance ) computes with zero bias, which gives when weights are drawn independently with mean and variance . What is the standard deviation of under () versus Xavier-style normal (), and why does stall training under a activation? |
Deep learning | L2 | Short | Mat | |
| 414 | Why are bias vectors and normalisation scale/shift parameters () usually excluded from L2 weight decay in deep neural networks? |
Deep learning | L2 | One-liner | Th | |
| 415 | Is it true that an additive bias term in a linear or convolutional layer immediately followed by batch normalisation is redundant, and why? |
Deep learning | L2 | One-liner | Th | |
| 416 | What are the Huber loss for residual with threshold and its derivative ? For , what are and at and , and why does Huber loss combine the benefits of MSE and MAE? |
Deep learning | L2 | Medium | Th+Mat | |
| 417 | How does clipping gradients by global L2 norm differ from clipping element-wise by value? Given a gradient vector and threshold , what is the clipped gradient under each method, and which preserves the steepest-descent direction? |
Deep learning | L2 | Short | Mat | |
| 418 | A network uses cosine annealing without restarts from down to over steps: . What is the learning rate at , and why is cosine decay often preferred over step decay? |
Deep learning | L2 | Short | Th+Mat | |
| 419 | A feature map goes through pooling with stride , giving a output. The gradient of the loss with respect to that output is . What is the gradient with respect to for max pooling and for average pooling? |
Deep learning | L2 | Medium | Mat | |
| 420 | A network has two layers with no activation function. Layer 1 is with , . Layer 2 is with , . What single layer does the same job, and does it agree with the two layers at ? |
Deep learning | L2 | Medium | Mat | |
| 422 | How do you derive the gradient of the softmax cross-entropy loss with respect to the logits? |
Deep learning | L3 | Short | Mat | |
| 423 | Suppose you train a binary classification network with a sigmoid output using mean-squared error (MSE) instead of cross-entropy. Is training still useful, judging by the gradient of each loss with respect to the logit (the input to the sigmoid)? How do the two losses look as functions of for a positive example? |
Deep learning | L3 | Medium | Th+Mat | |
| 424 | For a two-layer network , , trained with cross-entropy on one example with true class , what are the gradients of the loss with respect to in matrix form, and do their shapes check out? |
Deep learning | L3 | Long | Mat | |
| 425 | How does the product of layer Jacobians explain vanishing and exploding gradients in a deep feed-forward network, and why are sigmoid networks especially prone to vanishing gradients? |
Deep learning | L3 | Medium | Th+Mat | |
| 426 | What is the batch normalisation forward pass for one feature? For a mini-batch of activations with , and , what are the outputs? What changes at inference time, and why do transformers use layer normalisation instead? |
Deep learning | L3 | Medium | Th+Mat | |
| 427 | How does the multiply-accumulate cost of a standard convolution compare with that of a depthwise separable convolution ( depthwise followed by pointwise), for an output with input and output channels? What is the ratio for and ? |
Deep learning | L3 | Short | Mat | |
| 428 | With label smoothing on classes, what is the target distribution, and what is the gradient of the cross-entropy loss with respect to the logits? For , and true class 2, what are the target vector and the logit gap the model is pushed towards? |
Deep learning | L3 | Short | Mat | |
| 429 | How do you derive the Xavier (Glorot) and He initialisation variances from the requirement that activation variance stays constant from layer to layer? |
Deep learning | L3 | Long | Mat | |
| 430 | In a variational autoencoder (VAE), the encoder outputs mean and log-variance for a scalar latent variable . How does the reparameterisation trick produce for auxiliary noise , why is it needed for backpropagation, and what are and ? |
Deep learning | L3 | Short | Mat | |
| 431 | An undirected 3-node path graph has initial scalar features . Using one Kipf–Welling graph convolutional layer with , and scalar weight , what is ? |
Deep learning | L3 | Medium | Mat | |
| 432 | What is a dilated (atrous) convolution with dilation factor ? For a 1-D input of length , what are the output length and the receptive field after two stacked convolutions with stride 1, no padding and dilations and , and why does exponential dilation () avoid the gridding problem? |
Deep learning | L3 | Medium | Mat | |
| 433 | A single-channel input is cross-correlated (no padding, stride 1, no bias) with a kernel , giving output . Given upstream loss gradient , what is , and how is computed in general? |
Deep learning | L3 | Medium | Mat | |
| 434 | How does a transposed convolution upsample a feature map (give its output size formula for input size , kernel , stride and padding ), and why does it often create checkerboard artefacts when is not divisible by ? |
Deep learning | L3 | Short | Th+Mat | |
| 435 | A ResNet bottleneck block maps 256 channels to 256 channels via a conv (to 64), a conv (at 64) and a conv (to 256), ignoring biases. How many parameters and MACs per spatial position does it use compared with a basic block of two convs at 256 channels, and how does the same idea cut the cost of a Inception branch ( channels via 16 bottleneck channels)? |
Deep learning | L3 | Medium | Mat | |
| 436 | How does a DenseNet block differ from a ResNet block in how earlier features are combined, what is the channel count entering layer (with initial channels and growth rate ), and what is the trade-off between parameter efficiency and GPU memory? |
Deep learning | L3 | Short | Th+Mat | |
| 437 | In a VAE with prior and diagonal Gaussian encoder , how do you derive the closed-form KL divergence , and what does each term encourage? |
Deep learning | L3 | Long | Mat | |
| 438 | For the minimax GAN objective , how do you derive the optimal discriminator for a fixed generator , and show that substituting reduces the generator objective to ? |
Deep learning | L3 | Long | Mat | |
| 439 | In SimCLR with a mini-batch of images (giving augmented views), write the NT-Xent (InfoNCE) loss for a positive pair with cosine similarity and temperature . Why is this a -way cross-entropy loss, and how does affect the gradients? |
Deep learning | L3 | Medium | Mat | |
| 440 | What is the general message-passing neural network (MPNN) update for node , and how do you prove that relabelling nodes with any permutation matrix makes a node-level GNN layer permutation-equivariant while global sum or mean pooling makes a graph-level readout permutation-invariant? |
Deep learning | L3 | Medium | Th+Mat | |
| 441 | Consider a small ReLU network with input , hidden layer with , , and scalar output with (no biases). For target and squared loss , what are the exact gradients and ? |
Deep learning | L3 | Medium | Mat | |
| 442 | For a mini-batch of examples stacked as rows in , a two-layer network computes , and , where , , , and is the all-ones vector. Given the batch-averaged loss gradient , what are the gradients with respect to , and how do matrix dimensions verify the transposes? |
Deep learning | L3 | Medium | Mat | |
| 443 | How do you express the derivatives of and purely in terms of and , what are their maximum values, and why is generally preferred over in hidden layers? |
Deep learning | L3 | Medium | Th+Mat | |
| 444 | For , how do you derive the full Jacobian matrix for both diagonal () and off-diagonal () entries, and why does shifting every logit by a constant leave unchanged? |
Deep learning | L3 | Medium | Mat | |
| 445 | What are the GELU and SiLU (Swish) activation functions, what is the exact derivative of , and why do modern deep architectures often prefer them over ReLU? |
Deep learning | L3 | Short | Th+Mat | |
| 446 | Using the update convention and , how does Nesterov accelerated gradient (NAG) differ from classical momentum, and for with , , and , what is under each method? |
Deep learning | L3 | Medium | Th+Mat | |
| 447 | What are the per-parameter update rules for AdaGrad and RMSProp, why does AdaGrad’s effective step size decay towards zero in deep learning, and for a constant gradient with base learning rate , decay rate and stability constant , what are the effective learning rates after steps under AdaGrad versus RMSProp (at steady state)? |
Deep learning | L3 | Medium | Th+Mat | |
| 448 | A convolutional layer outputs a tensor of shape (batch size, channels, height, width). Over which axes are the mean and variance computed, how many distinct pairs are computed per batch, and how many learnable scale and shift parameters exist (assuming one pair per channel) for (a) batch normalisation, (b) layer normalisation, (c) instance normalisation and (d) group normalisation with groups? |
Deep learning | L3 | Medium | Mat | |
| 449 | For binary classification with logit and target , evaluating naively can overflow or take . How do you derive the numerically stable form , and what value does it give at ? |
Deep learning | L3 | Short | Mat | |
| 450 | How does focal loss modify cross-entropy for extreme class imbalance, where is the predicted probability for the true class and is the focusing parameter? What is the ratio of the loss on a hard example () to an easy example () for versus , and why does this help? |
Deep learning | L3 | Medium | Th+Mat | |
| 451 | A scalar parameter starts at and is trained with Adam using learning rate , , and . The first two gradients are and . What are and , and what would the first step have been without bias correction? |
Deep learning | L3 | Medium | Mat | |
| 452 | You have implemented backpropagation by hand and want to test it with gradient checking. Why is the central difference preferred to the forward difference, how do you compare it with your analytic gradient, and what goes wrong if is too large or too small? Illustrate with at and ? |
Deep learning | L3 | Medium | Th+Mat | |
| 453 | A network has input , two hidden units, and one linear output . All weights and biases start at . The loss is and the learning rate is . What happens over two gradient-descent steps (a) with sigmoid hidden units and (b) with ReLU hidden units, and what happens to the two hidden units? |
Deep learning | L3 | Medium | Mat | |
| 454 | How do you derive the recurrence for the receptive field of a stack of convolution and pooling layers with kernel sizes and strides , and what receptive field does it give for a unit in (a) a conv with stride 2 followed by two convs with stride 1, and (b) a conv with stride 1, a max-pool with stride 2, then two convs with stride 1? |
Deep learning | L3 | Medium | Th+Mat | |
| 455 | Why do residual connections make very deep networks trainable? |
Deep learning | L4 | Medium | Th | |
| 456 | Why is L2 regularisation not the same as weight decay when training with Adam, and what does AdamW change? |
Deep learning | L4 | Medium | Th+Mat | |
| 457 | What does the universal approximation theorem say for networks with one hidden layer, what does it not guarantee, and why are deep networks used anyway? |
Deep learning | L4 | Medium | Th | |
| 458 | Why can a deterministic autoencoder not generate realistic new images by sampling from its latent space, and how does the VAE’s KL term fix this? What is posterior collapse in VAEs, when does it happen, and how do -VAE and KL annealing address it? |
Deep learning | L4 | Medium | Th | |
| 459 | Why do gradients of the original minimax GAN objective vanish when and have disjoint supports, what is mode collapse, and how does the Wasserstein-1 distance in WGAN fix both? |
Deep learning | L4 | Medium | Th+Mat | |
| 460 | In a denoising diffusion probabilistic model (DDPM), the forward process is . How do you derive the closed-form marginal with and , and why does predicting the noise match predicting the score ? |
Deep learning | L4 | Long | Mat | |
| 461 | At DDPM reverse step with , , and scalar noisy value , a trained noise network predicts . What is the estimated clean signal , and what is the reverse-step mean used to sample ? |
Deep learning | L4 | Medium | Mat | |
| 462 | In joint-embedding self-supervised learning, what is representation collapse, why does simply maximising similarity between two augmented views fail, and how do contrastive methods (SimCLR), asymmetric self-distillation (BYOL, DINO) and covariance methods (Barlow Twins, VICReg) prevent it? |
Deep learning | L4 | Medium | Th | |
| 463 | What is over-smoothing in deep graph convolutional networks (GCNs), why does repeated multiplication by push node representations towards a low-dimensional subspace, and how do residual connections, Jumping Knowledge (JK-Net) or DropEdge mitigate it? |
Deep learning | L4 | Medium | Th+Mat | |
| 464 | At most how many linear regions can a 1-D ReLU network with one hidden layer of units create, and how can composing hidden layers of width 2 create linear regions instead? |
Deep learning | L4 | Long | Mat | |
| 465 | What is orthogonal weight initialisation, why does it preserve both forward activation norms and backward gradient norms exactly in a deep linear network with , and what gain factor should scale it when used with ReLU? |
Deep learning | L4 | Medium | Mat | |
| 466 | Excluding the weights and gradients themselves, how much optimiser-state memory per parameter (in fp32) do plain SGD, SGD with momentum and Adam require, and why can SGD with momentum still beat Adam on test accuracy in image classification benchmarks? |
Deep learning | L4 | Medium | Th+Mat | |
| 467 | Why is standard test-time weight scaling in dropout only an exact ensemble average for a single linear layer, and how does Monte Carlo (MC) dropout use dropout at inference time to estimate predictive uncertainty? |
Deep learning | L4 | Medium | Th | |
| 468 | For a quadratic loss with symmetric positive definite Hessian (whose largest eigenvalue is ), started at with gradient descent step size , how do you show that stopping after iterations acts approximately like L2 regularisation with penalty ? |
Deep learning | L4 | Long | Mat | |
| 469 | Taking , how do you prove that batch normalisation makes a layer’s output invariant to positive scalar rescaling of its weights, for any , and what does this imply for the weight gradient and the effective learning rate during SGD? |
Deep learning | L4 | Long | Mat | |
| 470 | Why do modern deep networks such as Transformers and large-batch CNNs typically start training with a learning-rate warm-up instead of immediately using the peak learning rate? |
Deep learning | L4 | Medium | Th | |
| 471 | What is epoch-wise double descent in deep neural networks, why can test error spike mid-training before falling again as training continues, and how do weight decay, data augmentation and early stopping affect the double-descent peak in practice? |
Deep learning | L4 | Medium | Th | |
| 472 | Consider an overparameterised linear model with , and , trained to minimise by gradient descent from . How do you prove that if gradient descent converges to an interpolating solution, it must converge to the unique minimum--norm interpolator , and what changes if ? |
Deep learning | L4 | Long | Mat | |
| 473 | For linear regression with inverted dropout on the inputs (keep probability ), why does the expected squared loss equal the ordinary squared loss plus an adaptive L2 penalty? What is the closed-form solution, and what does the penalty say about how dropout regularises? |
Deep learning | L5 | Long | Mat | |
| 474 | In a DDPM, why is the reverse-time conditional tractable when conditioned on even though is not, and how do you derive its mean and variance by completing the square in Bayes’ rule? |
Deep learning | L5 | Long | Mat | |
| 475 | For a positive pair and independent negative samples with critic score , how do you prove that minimising the InfoNCE loss maximises a lower bound on the mutual information , and what is the optimal critic ? |
Deep learning | L5 | Long | Mat | |
| 476 | Why is the expressive power of standard message-passing GNNs bounded by the 1-Weisfeiler–Lehman (1-WL) graph isomorphism test, what is an explicit pair of non-isomorphic graphs (with identical node features) that GCNs cannot distinguish, and what architectural changes go beyond 1-WL? |
Deep learning | L5 | Long | Th+Mat | |
| 478 | In a recurrent neural network, what is a "gate", and how does a number between 0 and 1 act like a tap that controls how much information passes through? |
Sequence models and transformers | L1 | Short | Th | |
| 479 | When we train a model to write a sentence one word at a time, what does it mean to feed it the correct previous words during training, and why might that cause trouble later? |
Sequence models and transformers | L1 | Short | Th | |
| 480 | In attention, what do the query, keys and values stand for, and how is the output a weighted average? If the attention weights over three values are , what is the output? |
Sequence models and transformers | L1 | Short | Th+Mat | |
| 481 | Why does a transformer need positional encodings? |
Sequence models and transformers | L1 | One-liner | Th | |
| 482 | What is the difference between the skip-gram and CBOW models of word2vec, and when would you prefer each? |
Sequence models and transformers | L1 | Short | Th | |
| 483 | Why does a maximum-likelihood -gram language model fail on unseen -grams, and what does smoothing do about it? |
Sequence models and transformers | L1 | Short | Th | |
| 484 | What is the difference between greedy decoding and beam search for generating a sequence? Why is neither guaranteed to find the most probable sequence? |
Sequence models and transformers | L1 | Short | Th | |
| 485 | How do the training objectives of BERT (masked language modelling) and GPT (causal language modelling) differ, and what does each allow the model to attend to? |
Sequence models and transformers | L1 | Short | Th | |
| 486 | How much memory do the weights of a 7-billion-parameter LLM (large language model) need in fp32, fp16, int8 and int4? What are these four number formats, why does lower precision help, and what else uses GPU (graphics processing unit) memory at inference time? |
Sequence models and transformers | L1 | Short | Th+Mat | |
| 487 | What is retrieval-augmented generation (RAG), and when should you choose it instead of fine-tuning an LLM (large language model)? |
Sequence models and transformers | L1 | Short | Th | |
| 488 | What is teacher forcing when training a sequence-to-sequence decoder, and what is exposure bias? |
Sequence models and transformers | L2 | Short | Th | |
| 489 | How is causal (look-ahead) masking implemented in decoder self-attention? What is the mask for a sequence of length 4, and why are masked logits set to rather than the attention weights being set to 0? |
Sequence models and transformers | L2 | Short | Th+Mat | |
| 490 | What are the time and memory costs of one self-attention layer for sequence length and model dimension ? For and , which part dominates? |
Sequence models and transformers | L2 | Short | Mat | |
| 491 | How many parameters does a multi-head self-attention layer with and heads have (with biases)? Does the number of heads change the count? How many does a full transformer encoder layer with feed-forward width have? |
Sequence models and transformers | L2 | Short | Mat | |
| 492 | A language model assigns probabilities , , and to the four tokens of a test sentence (each conditioned on the tokens before it). What is the perplexity? What is the perplexity of a model that is uniform over a vocabulary of size ? |
Sequence models and transformers | L2 | Short | Mat | |
| 493 | The corpus word counts are: hug , pug , pun , bun , hugs . Starting from single characters, what are the first three merges of byte-pair encoding (BPE), done by hand? How are the words "bugs" and "mug" then tokenised? |
Sequence models and transformers | L2 | Medium | Mat | |
| 494 | What are the two gates of a GRU and what does each control? How is a GRU different from an LSTM? |
Sequence models and transformers | L2 | Short | Th | |
| 495 | A training corpus has three sentences: " i like tea ", " i like coffee " and " you like tea ". The vocabulary of predicted words is i, you, like, tea, coffee, , so . Using add-one smoothing, what is the bigram probability of the sentence " you like coffee ", and what does the unsmoothed MLE give? |
Sequence models and transformers | L2 | Medium | Mat | |
| 496 | Reference: "the cat is on the mat" (6 words). Candidate 1: "the the the the the the the". Candidate 2: "the cat mat". (a) What is the clipped unigram precision of Candidate 1? (b) For Candidate 2, what are the unigram precision and the brevity penalty, so what is its unigram-only BLEU? |
Sequence models and transformers | L2 | Medium | Mat | |
| 497 | Three tokens have embeddings , and . Take (no projection matrices) and . What are the attention weights and output for token 1 using scaled dot-product attention? |
Sequence models and transformers | L2 | Medium | Mat | |
| 498 | A language model gives logits for four tokens. What are the sampling probabilities at temperature , and ? What happens as and as ? |
Sequence models and transformers | L2 | Medium | Mat | |
| 499 | A weight matrix is adapted with LoRA of rank . How many trainable parameters does LoRA add for this matrix, and what fraction of the full matrix is that? If LoRA is applied to the query and value matrices of all layers, how many trainable parameters is that in total? |
Sequence models and transformers | L2 | Short | Mat | |
| 500 | A scalar RNN has with , and . For inputs and , what are , and the gradient ? |
Sequence models and transformers | L2 | Medium | Mat | |
| 501 | Take the sinusoidal positional encoding with , ordered as pairs, and . What is the vector for position ? |
Sequence models and transformers | L2 | Short | Mat | |
| 502 | A transformer layer-norm sees the feature vector for one token, with , for every feature and . What is the output? How does the statistics axis of layer norm differ from batch norm? |
Sequence models and transformers | L2 | Medium | Mat | |
| 503 | An encoder gives hidden states , and . The decoder state is . Using Luong dot-product attention, compute the attention weights and the context vector. How does Bahdanau (additive) attention differ? |
Sequence models and transformers | L2 | Medium | Th+Mat | |
| 504 | A model gives next-token probabilities for tokens A–E. What is the sampling distribution under top- with , and under nucleus (top-) sampling with ? Why is nucleus sampling often preferred to a fixed ? |
Sequence models and transformers | L2 | Medium | Th+Mat | |
| 505 | In BERT's masked language modelling, of tokens are chosen for prediction. Of those, become [MASK], become a random token and stay unchanged. What fraction of all tokens are in each case? Why not simply use [MASK] every time? |
Sequence models and transformers | L2 | Medium | Th+Mat | |
| 506 | Training compute is approximately FLOPs for parameters and tokens. The Chinchilla result suggests a compute-optimal ratio of about . (a) For FLOPs, what and are compute-optimal? (b) How many tokens and how much compute does a compute-optimal B model need? (c) How much compute does a B model trained on T tokens use? |
Sequence models and transformers | L2 | Medium | Mat | |
| 507 | Two finished hypotheses have token probabilities and . Which one does beam search prefer by raw log-probability? Which by average log-probability, and which by GNMT length normalisation ? What bias does this show? |
Sequence models and transformers | L2 | Medium | Mat | |
| 508 | A single-layer LSTM has input size and hidden size . How many trainable parameters does it have (one bias vector per gate), and how does the count compare with a GRU and a plain RNN of the same sizes? What changes if the LSTM is bidirectional? |
Sequence models and transformers | L2 | Short | Mat | |
| 509 | In scaled dot-product attention, why divide by , where and are the query and key matrices and is the key dimension? |
Sequence models and transformers | L3 | Short | Th+Mat | |
| 510 | For a vanilla RNN with loss , how does backpropagation through time give for , and why do gradients over long time spans vanish or explode? |
Sequence models and transformers | L3 | Long | Mat | |
| 511 | What are the LSTM cell equations, and why does the cell state ease the vanishing-gradient problem of a vanilla RNN? How does a GRU differ, and how many parameters does each have for input size 100 and hidden size 128? |
Sequence models and transformers | L3 | Medium | Th+Mat | |
| 512 | In an RNN encoder–decoder for translation, what is the bottleneck problem, and how does attention fix it? What are the equations for the context vector at decoder step , and what is the context vector for scores over three encoder states with (scalar) values ? |
Sequence models and transformers | L3 | Medium | Th+Mat | |
| 513 | What is the KV cache in autoregressive transformer decoding? How does it change the cost of generating each token, and how much memory does it need for a 32-layer model with , a context of 4096 tokens, and fp16 values? |
Sequence models and transformers | L3 | Medium | Th+Mat | |
| 514 | Skip-gram with negative sampling uses the loss , where is the centre-word vector, the true context vector and the vectors of sampled negative words. Derive . Then, for , and one negative , what are the gradient and the result of one SGD step with learning rate ? |
Sequence models and transformers | L3 | Long | Mat | |
| 515 | In skip-gram with a full softmax, and the loss is . Show that . For a three-word vocabulary with , , , centre vector and true context word , what is the gradient? |
Sequence models and transformers | L3 | Long | Mat | |
| 516 | How does the GloVe objective arise from the idea that meaning is carried by ratios of co-occurrence probabilities? What is the role of ? |
Sequence models and transformers | L3 | Long | Th+Mat | |
| 517 | For a GRU with , what is the direct term in , and why does a small let gradients survive many steps? If at every step, what does that direct path contribute over steps? |
Sequence models and transformers | L3 | Medium | Mat | |
| 518 | Count the matrix-multiply FLOPs of one transformer layer's forward pass for sequence length , model width and feed-forward width (one sequence, ignoring softmax, layer norm and biases). Which part dominates, and at what does attention's term equal the linear-in- part? |
Sequence models and transformers | L3 | Long | Mat | |
| 519 | Assume GPT-2 small has layers, , feed-forward width , vocabulary and context length with learned positional embeddings, and output weights tied to the token embedding, where each projection has a bias and each layer has two layer norms. How many parameters does it have? |
Sequence models and transformers | L3 | Long | Mat | |
| 520 | A corpus has the words low (), lower (), newest () and widest (), each split into characters. BPE merges the most frequent adjacent pair. WordPiece merges the pair with the highest score . Which pair does each choose first, and why do they differ? |
Sequence models and transformers | L3 | Long | Mat | |
| 521 | LoRA computes , where is initialised to zero and is random. How do you show that at initialisation the model equals the pre-trained one, what are the gradients and at the start, and what is the factor for? |
Sequence models and transformers | L3 | Long | Mat | |
| 522 | For a vanilla RNN with , show that , where is the largest singular value. What does this say for and over steps? How does gradient-norm clipping help, for example when the gradient norm is and the threshold is ? |
Sequence models and transformers | L3 | Medium | Mat | |
| 523 | Let be attention weights over scores . Derive the Jacobian and the backward rule where . For and , compute , and again for the peaky . What does this say about saturated attention? |
Sequence models and transformers | L3 | Long | Mat | |
| 524 | A decoder has layers, query heads of dimension () and stores keys and values in 16-bit floats ( bytes). How large is the KV cache for one sequence of tokens with multi-head attention (MHA), grouped-query attention with KV heads (GQA), and multi-query attention (MQA, one KV head)? How many parameters does GQA save in the and projections? |
Sequence models and transformers | L3 | Medium | Mat | |
| 525 | Show that the cross-entropy of a model on text from the true distribution equals , so perplexity can never go below . Why can the perplexities of two models with different tokenisers not be compared directly, and how do you convert to bits per character? For a model with perplexity per token and characters per token, what is the bits per character? |
Sequence models and transformers | L3 | Long | Th+Mat | |
| 526 | Interpolated absolute discounting uses with . Choose so that the distribution sums to , and prove it. Then explain why Kneser–Ney replaces the lower-order unigram by the continuation probability , and check that this also sums to . If with distinct followers and , what is ? |
Sequence models and transformers | L3 | Long | Th+Mat | |
| 527 | In connectionist temporal classification (CTC), an acoustic model gives, for each of frames, a distribution over the symbols . How are alignments mapped to labels, how many alignments of length 4 collapse to the label "ab", how many to "aa", and what is the probability of "ab" if every frame is uniform over the three symbols? |
Sequence models and transformers | L3 | Medium | Mat | |
| 528 | ALiBi adds no positional embedding. It adds a bias to the attention score between query position and key position , with a head-specific slope . For a query at position 4 whose four raw scores are all equal, what attention weights result when and when ? Give the slopes for 8 heads, and explain why ALiBi can help a model run on longer sequences than it was trained on? |
Sequence models and transformers | L3 | Medium | Th+Mat | |
| 529 | A unigram language-model tokeniser has the vocabulary and probabilities h , u , g , s , hu , ug , hug , gs , ugs . Which segmentation of "hugs" does it choose, how is it found efficiently, and how does this differ from BPE? |
Sequence models and transformers | L3 | Medium | Mat | |
| 530 | A mixture-of-experts layer has 4 experts, each a feed-forward block with and hidden width (two weight matrices, no biases), and a router that picks the top 2 experts per token. For router logits over the four experts, what are the gate weights of the top-2 experts? Compare the total and active parameters of the layer with one dense feed-forward block, and compute the load-balancing loss for and for these experts? |
Sequence models and transformers | L3 | Medium | Mat | |
| 531 | An encoder gives states , and . The decoder state is . Bahdanau (additive) attention scores each state as , here with and . Compute the attention weights and the context vector, and say when additive attention is preferred to dot-product scoring? |
Sequence models and transformers | L3 | Medium | Mat | |
| 532 | In an encoder–decoder transformer with and 8 heads, a decoder layer cross-attends to an encoder output of length while it has target tokens. What are the shapes of , and and of the score matrix, which projections cost the most, and why does cross-attention need no causal mask? |
Sequence models and transformers | L3 | Medium | Mat | |
| 533 | How much GPU memory do model states take when fine-tuning a -billion-parameter model with mixed-precision Adam under (a) full fine-tuning, (b) LoRA with million trainable adapter parameters on an fp16 base, and (c) QLoRA with a -bit NormalFloat base? How do NF4, double quantisation and paged optimisers work, and what is the trade-off? |
Sequence models and transformers | L3 | Medium | Mat | |
| 534 | Why is autoregressive LLM decoding at batch size memory-bandwidth bound? For a -billion-parameter fp16 model () on a GPU with memory bandwidth and of fp16 compute, what is the upper bound on tokens/s at batch size , what is the arithmetic intensity, and near what batch size does decoding reach the compute ridge point? |
Sequence models and transformers | L3 | Medium | Mat | |
| 535 | In speculative decoding, a draft model proposes tokens and each is accepted independently with probability . How do you derive the expected number of tokens produced per target-model forward pass, what is its value for and , and what is the expected speedup if one draft forward pass costs of a target forward pass? |
Sequence models and transformers | L3 | Medium | Mat | |
| 536 | What is the sinusoidal positional encoding, and why is a linear function of ? How do rotary position embeddings (RoPE) make attention scores depend only on relative position? |
Sequence models and transformers | L4 | Medium | Th+Mat | |
| 537 | How can softmax attention be written as a kernel smoother? Why does replacing by a feature-map kernel reduce the cost from to ? How can causal linear attention be computed as an RNN, and what is lost? |
Sequence models and transformers | L4 | Medium | Mat | |
| 538 | A transformer block can be written post-LN, , or pre-LN, . How do gradients flow back through layers in the two, and why does post-LN usually need learning-rate warm-up? |
Sequence models and transformers | L4 | Long | Th+Mat | |
| 539 | What is an induction head, and how can a two-layer attention-only transformer use a pair of heads to complete a pattern such as ? What evidence ties induction heads to in-context learning? |
Sequence models and transformers | L4 | Long | Th | |
| 540 | How do you show that skip-gram with negative sampling, with negatives per positive pair, has an optimum at for each (word, context) pair, so it implicitly factorises a shifted PMI matrix (Levy and Goldberg). What assumptions do you need? |
Sequence models and transformers | L4 | Long | Mat | |
| 541 | Assume the loss follows and training compute is . Derive the compute-optimal and and their scaling exponents. What do and imply? |
Sequence models and transformers | L4 | Long | Mat | |
| 542 | FlashAttention computes softmax attention one block of keys at a time, without storing the full score matrix. Derive the online softmax recurrence that keeps a running maximum and a running sum , and test it on the scores split into the blocks and with values ? |
Sequence models and transformers | L4 | Long | Th+Mat | |
| 543 | Prove that a transformer encoder layer without positional encodings is permutation-equivariant: permuting the input tokens permutes the outputs in the same way. How do you show that a decoder with a causal mask and no positional encodings is not, and that it can still recover position information? |
Sequence models and transformers | L5 | Long | Th+Mat | |
| 544 | In speculative decoding, a small draft model with next-token distribution proposes a token , and the large target model with distribution accepts it with probability . If it is rejected, a token is drawn from the residual . Show that the output token is distributed exactly as . For and , find the acceptance probability and the expected number of tokens per target pass when tokens are drafted? |
Sequence models and transformers | L5 | Long | Mat | |
| 545 | In reinforcement learning, what are the agent, environment, state, action, reward and policy, and how do they interact in one step of the loop? |
Reinforcement learning | L1 | Short | Th | |
| 546 | What is the exploration–exploitation dilemma, and why can a purely greedy agent get stuck choosing a poor action? |
Reinforcement learning | L1 | Short | Th | |
| 547 | Why do we use a discount factor in reinforcement learning? |
Reinforcement learning | L1 | One-liner | Th | |
| 548 | What is a Markov decision process, what are its components, and what objective does an agent optimise? |
Reinforcement learning | L1 | Short | Th | |
| 549 | What is the difference between on-policy and off-policy learning, and why might you want to learn off-policy? |
Reinforcement learning | L1 | Short | Th | |
| 550 | What is the difference between model-free and model-based reinforcement learning, and what is the main trade-off between them? |
Reinforcement learning | L1 | Short | Th | |
| 551 | What are the three stages of reinforcement learning from human feedback (RLHF) used to fine-tune a language model, and what does each stage produce? |
Reinforcement learning | L1 | Short | Th | |
| 552 | What is the difference between the state-value and the action-value , and how are they related? If , , and , what is ? |
Reinforcement learning | L1 | Short | Th+Mat | |
| 553 | A deterministic MDP has two states, A and B, and . In A you can "stay" (reward 1, remain in A) or "go" (reward 0, move to B). In B the only action is "stay" (reward 2, remain in B). Starting from , what are the values after three iterations of value iteration, and what are and the optimal policy? |
Reinforcement learning | L2 | Medium | Mat | |
| 554 | Write the Q-learning update. With , , , reward and , compute the new . Why is Q-learning called off-policy? |
Reinforcement learning | L2 | Short | Th+Mat | |
| 555 | An episode gives rewards , , , and then ends. With , compute the returns . Which recursion lets you compute them quickly? |
Reinforcement learning | L2 | Short | Mat | |
| 556 | An agent receives reward at every step forever, with . What is its return? How many steps does it take to collect at least of that return, and what does this say about the "effective horizon" ? |
Reinforcement learning | L2 | Short | Mat | |
| 557 | An agent has four actions with estimated values and uses -greedy with , where the random choice is uniform over all four actions. What is the probability of each action, and what is the expected estimated value of the chosen action? |
Reinforcement learning | L2 | Short | Mat | |
| 558 | An arm gives rewards , , in its first three pulls. Compute the estimate using (a) the sample-average update with step , and (b) a constant step size starting from . Why would you prefer (b) when the arm's reward distribution drifts over time? |
Reinforcement learning | L2 | Short | Mat | |
| 559 | In TD(0), the current estimate is . The agent moves from to with reward , and . With and , what are the TD target, the TD error and the updated ? |
Reinforcement learning | L2 | Short | Mat | |
| 560 | In state the agent takes action with , gets reward and lands in , where and . The -greedy policy then picks the exploratory action . With and , compute the new under SARSA and under Q-learning. Why do they differ? |
Reinforcement learning | L2 | Short | Mat | |
| 561 | A corridor has three non-terminal cells 1, 2, 3 in a row, with a terminal cell L to the left of cell 1 and a terminal cell R to the right of cell 3. The policy moves left or right with probability each. Moving into R gives reward , and every other move gives reward . With and , compute (synchronous sweeps) for cells 1, 2, 3. What do the values converge to? |
Reinforcement learning | L2 | Medium | Mat | |
| 562 | After total pulls, a three-armed bandit with rewards in has pull counts and sample means . Which arm does UCB1 pull next, using the index ? What would a greedy agent do? |
Reinforcement learning | L2 | Short | Mat | |
| 563 | A deterministic world has a terminal goal G and two states A and B, each with one action, "right". Right from B gives reward and ends at G. Right from A gives reward and moves to B. Start with everywhere, , . The agent experiences and then , each with one Q-learning update, and stores them in a model. Then Dyna-Q does two planning updates, replaying first and second. What are and after each stage, and what did planning achieve? |
Reinforcement learning | L2 | Medium | Mat | |
| 564 | One episode with visits states A, B, A, C in that order and then ends. The rewards received after leaving each state are respectively. What are the returns from each time step and the first-visit and every-visit Monte Carlo estimates of , and from this single episode? |
Reinforcement learning | L2 | Medium | Mat | |
| 565 | In state there are three actions with and the policy is -greedy with (random choice uniform over all three actions). The agent took action in with , got , and moved to . With and , compute the Expected SARSA update. How does it compare to SARSA and Q-learning, and why does it have lower variance than SARSA? |
Reinforcement learning | L2 | Medium | Th+Mat | |
| 566 | An episode has rewards , , , and then ends, with . The current estimates are , and . What are the -step returns for , and how does trade off bias and variance? |
Reinforcement learning | L2 | Medium | Th+Mat | |
| 567 | For a sampled transition, , , and the next state has online-network values and target-network values . Compute the target used by DQN and by double DQN. Why does the max in DQN cause over-estimation, and how does double DQN reduce it? |
Reinforcement learning | L2 | Medium | Th+Mat | |
| 568 | How do you derive the REINFORCE policy-gradient estimator, and why does subtracting a baseline not introduce bias? |
Reinforcement learning | L3 | Long | Mat | |
| 569 | Derive the Bellman expectation equation for . How does the Bellman optimality equation for differ, and why can the first be solved as a linear system but not the second? |
Reinforcement learning | L3 | Medium | Mat | |
| 570 | Compare Monte Carlo and TD(0) value estimation in terms of bias and variance. Given eight episodes, one (A, 0, B, 0), six (B, 1) and one (B, 0), with , what do batch Monte Carlo and batch TD(0) give for and ? |
Reinforcement learning | L3 | Medium | Th+Mat | |
| 571 | In the cliff-walking gridworld (reward per step, for stepping off the cliff), an -greedy SARSA agent learns a safe path away from the edge, while Q-learning learns the path along the edge yet earns less reward per episode during training. Why? |
Reinforcement learning | L3 | Medium | Th+Mat | |
| 572 | Write PPO's clipped surrogate objective. With , evaluate the per-sample objective, and say whether it has a non-zero gradient, when (a) , ; (b) , ; (c) , . What is the clipping for? |
Reinforcement learning | L3 | Medium | Th+Mat | |
| 573 | An MDP has two states X and Y and . In X, action gives reward and moves to Y, while action gives reward and stays in X. In Y, action gives reward and moves to X, while action gives reward and stays in Y. Run policy iteration from the policy " in X, in Y". What are the evaluation and improvement steps, and what are the optimal policy and values? |
Reinforcement learning | L3 | Long | Mat | |
| 574 | An MDP has non-terminal states A and B, and . In A, action gives reward and ends the episode. Action gives reward , and moves to B with probability or stays in A with probability . In B, action gives reward and ends the episode. Action gives reward and moves to A. Starting from , what are the results of three sweeps of value iteration, and then what are exactly and the optimal policy? |
Reinforcement learning | L3 | Long | Mat | |
| 575 | A Markov reward process has two states with transition matrix , expected rewards and . What is the Bellman equation in matrix form, what is its solution for , and why does a unique solution exist for any ? |
Reinforcement learning | L3 | Medium | Mat | |
| 576 | Four episodes are generated by a behaviour policy . For a target policy , the importance ratios and the returns are , , and . Compute the ordinary and weighted importance-sampling estimates of at the start state. Which is biased, and which has higher variance? |
Reinforcement learning | L3 | Medium | Mat | |
| 577 | A tabular value function is for states A, B, C. One episode goes A B C end with rewards . Use TD() with accumulating traces, , and , and update every state at every step. What is after the episode? How does this differ from TD(0)? |
Reinforcement learning | L3 | Medium | Mat | |
| 578 | A two-armed bandit policy is with . The agent samples arm 1 and receives reward . Using the REINFORCE update with , what is the update (a) with baseline and (b) with ? What is the gradient of , and how do you show that the score function has zero mean? |
Reinforcement learning | L3 | Medium | Mat | |
| 579 | A trajectory of three steps has rewards and critic values . The episode ends after step 3, so the next value is . With and , what are the TD errors and the generalised advantage estimates ? |
Reinforcement learning | L3 | Medium | Mat | |
| 580 | Two Bernoulli arms start with uniform priors. Arm A has been pulled times with successes and failure. Arm B has been pulled once with success. Give each arm's posterior, mean and variance. What is the probability that Thompson sampling picks B next? Why is this different from a greedy choice? |
Reinforcement learning | L3 | Medium | Mat | |
| 581 | A linear value function is with . The agent moves from to with , where and . With and , compute the semi-gradient TD(0) update, and compare with the residual-gradient update. Why is TD(0) called a "semi-gradient" method? |
Reinforcement learning | L3 | Medium | Mat | |
| 582 | Show that generalised advantage estimation , with , equals when and the Monte Carlo advantage when . How do these limits explain the bias–variance role of ? How do you check your claim on rewards and values with ? |
Reinforcement learning | L3 | Long | Mat | |
| 583 | In RLHF, a reward model gives scores to the human-preferred answer and to the rejected one. Under the Bradley–Terry model, . Compute this probability, the loss , and the gradients with respect to and . What happens when the scores are the other way round, and why does the loss depend only on the difference? |
Reinforcement learning | L3 | Medium | Th+Mat | |
| 584 | State and prove the policy improvement theorem. If for every state , why does it follow that for every ? How does this justify greedy policy improvement in policy iteration? |
Reinforcement learning | L3 | Long | Mat | |
| 585 | What is the "deadly triad" in reinforcement learning? How do you show with a two-state example, with and , a single weight , and reward everywhere, that off-policy semi-gradient TD(0) can diverge when only the transition is updated? |
Reinforcement learning | L4 | Medium | Th+Mat | |
| 586 | Starting from , prove that rewards received before time can be dropped from the factor multiplying . What does this give you, and what is a subtle mistake with the discount factor? |
Reinforcement learning | L4 | Long | Mat | |
| 587 | TRPO maximises a surrogate improvement subject to a KL bound. Linearise the objective as and the constraint as , where is the policy gradient and is the Fisher information matrix. Derive the step . For , and , what is , and how does its improvement compare with a plain gradient step that uses the same KL? |
Reinforcement learning | L4 | Long | Mat | |
| 588 | Sketch why UCB1 has regret growing only like . For a suboptimal arm with gap , how do you show that it is pulled about times at most, and what does this give for and ? |
Reinforcement learning | L4 | Long | Mat | |
| 589 | A replay buffer holds transitions with absolute TD errors . Prioritised experience replay samples transition with probability with and . Compute the sampling probabilities and the importance-sampling weights (normalised by their maximum) for and . Why are the weights needed? |
Reinforcement learning | L4 | Medium | Th+Mat | |
| 590 | A duelling DQN has a value stream and an advantage stream. For one state, and for three actions. Compute using (a) , (b) and (c) . Why is (a) not identifiable, and what do (b) and (c) fix? |
Reinforcement learning | L4 | Medium | Th+Mat | |
| 591 | For the policy-gradient estimate , derive the constant baseline that minimises variance. Then take a one-state problem with , , rewards and . Compute and the variance for , and . Is the average reward the best baseline? |
Reinforcement learning | L4 | Long | Mat | |
| 592 | A shaped reward is for some potential function . Prove that the optimal policy does not change. If , and , what bonus does the agent get on the move , and what does the bonus sum to along a whole episode? |
Reinforcement learning | L4 | Medium | Th+Mat | |
| 593 | How do you prove that the Bellman optimality operator is a -contraction in the max-norm, and what does this tell you about value iteration converging to a unique and when to stop it? |
Reinforcement learning | L5 | Long | Mat | |
| 594 | Show that the policy maximising is with . For , , find and the optimal objective value for , and for . What happens as and , and how does this lead to direct preference optimisation (DPO)? |
Reinforcement learning | L5 | Long | Mat | |
| 595 | Prove the performance difference lemma: for two policies and with , , where . What does it imply for policy improvement and for TRPO? |
Reinforcement learning | L5 | Long | Mat | |
| 596 | For on-policy linear TD(0) with features , show that the expected update is and that the fixed point is , where and . For the Markov reward process with , , and a single feature , what is , and how does it compare with the best least-squares fit of the true values under the stationary distribution? |
Reinforcement learning | L5 | Long | Mat | |
| 597 | What does the Markov property mean for a sequence such as daily weather? If it is sunny today, the chance that tomorrow is sunny is and the chance it is rainy is . Assume the same rule applies every day, so a sunny day is followed by a sunny one with chance . Given that today is sunny, what is the probability that tomorrow and the day after are both sunny? |
Probabilistic models | L1 | Short | Th+Mat | |
| 599 | What is a conjugate prior, and why is the Beta prior for a coin's heads probability easy to interpret as 'imaginary extra tosses'? What is the posterior for a Beta(1, 1) prior after 3 heads and 1 tail? |
Probabilistic models | L1 | Short | Th+Mat | |
| 600 | What is a Bayesian network, and why does it need far fewer parameters than the full joint distribution? |
Probabilistic models | L1 | Short | Th | |
| 602 | Why do we discard the first few samples (the burn-in) of an MCMC run, and why are the remaining samples not independent draws? |
Probabilistic models | L1 | Short | Th | |
| 603 | Two weather forecasters both predict tomorrow's temperature correctly, but one made a vague forecast and the other a specific one. Why does the specific one deserve more credit, and how does this explain why Bayesians say a model that can explain almost anything is penalised without any extra penalty? |
Probabilistic models | L1 | Short | Th | |
| 604 | If we believe a quantity changes smoothly, so that inputs close together have similar outputs, how can we turn the distance between two inputs into a similarity score between 0 and 1, and what does the length-scale control? |
Probabilistic models | L1 | Short | Th+Mat | |
| 605 | In a topic model, why do we describe each document as a mixture of topics, and each topic as a list of favourite words, and what is a tiny example? |
Probabilistic models | L1 | Short | Th | |
| 606 | Two neighbouring pixels in a photo are usually the same colour, but neither one causes the other. How can a plain undirected link with agreement scores describe this, and how are the scores turned into probabilities? |
Probabilistic models | L1 | Short | Th+Mat | |
| 607 | How is naive Bayes drawn as a graphical model, and what is its independence assumption? A spam filter has . The word "offer" appears in 60% of spam and 10% of ham (non-spam) emails; the word "meeting" appears in 30% of spam and 50% of ham. Using only these two words, what is for an email that contains both? |
Probabilistic models | L2 | Medium | Th+Mat | |
| 608 | An HMM has hidden states Rainy (R) and Sunny (S), initial probabilities , transitions , , , , and emissions , , , . Using the Viterbi algorithm, what is the most likely hidden sequence for the observations (walk, shop)? |
Probabilistic models | L2 | Medium | Mat | |
| 609 | What is the conditional distribution of a partitioned multivariate Gaussian? If is jointly Gaussian with means , , variances , and covariance , what is ? |
Probabilistic models | L2 | Medium | Mat | |
| 610 | Explain the three basic connections in a Bayesian network (chain, fork, collider) and when each one blocks a path. In the graph , , is ? Is ? |
Probabilistic models | L2 | Medium | Th | |
| 611 | How does a Markov random field (an undirected graphical model) differ from a Bayesian network, and what is the partition function? |
Probabilistic models | L2 | Short | Th | |
| 612 | What is a factor graph, and why is it the natural structure on which to run message passing? |
Probabilistic models | L2 | Short | Th | |
| 613 | A Bayesian network has five discrete variables: (2 states), (3 states), (2 states), (2 states) and (4 states). The arrows are , , , and . How many free parameters does it need, and how does this compare with the full joint table? |
Probabilistic models | L2 | Medium | Mat | |
| 614 | In the DAG with edges , , and , decide whether each statement is true, using d-separation: (i) ; (ii) ; (iii) ; (iv) ; (v) ; (vi) ? |
Probabilistic models | L2 | Medium | Th+Mat | |
| 615 | In the chain of binary variables, , , , and . Use variable elimination to find . Why is this cheaper than summing the full joint? |
Probabilistic models | L2 | Medium | Mat | |
| 616 | You use a Metropolis random-walk sampler for the unnormalised target . The current state is . Find the acceptance probability for the proposals and . If the uniform random number is for , is it accepted? Why is the normalising constant not needed? |
Probabilistic models | L2 | Short | Mat | |
| 617 | Three binary variables form a chain MRF with , where if and if . What are , , and ? |
Probabilistic models | L2 | Medium | Mat | |
| 618 | A scalar state follows with , and we observe with . After step the belief is . The new observation is . What are the predicted and the updated beliefs? |
Probabilistic models | L2 | Short | Mat | |
| 619 | A 1D Gaussian mixture has two components with unit variance, means and , and weights and . For the data points and , what are the responsibilities of component 1? What are the M-step updates of and using only these two points (keeping the other parameters fixed)? |
Probabilistic models | L2 | Medium | Mat | |
| 620 | In the model with prior and noise , you observe and . Find the posterior mean and variance of . How is the posterior mean related to ridge regression? |
Probabilistic models | L2 | Short | Mat | |
| 621 | A coin has unknown heads probability with prior . After 10 tosses you see 7 heads and 3 tails. Find the posterior, the MLE, the MAP estimate and the posterior mean. What is the probability that the next toss is heads, and the probability that the next two tosses are both heads? |
Probabilistic models | L2 | Medium | Mat | |
| 622 | You want samples from on (the Beta(2,2) density) using a Uniform(0,1) proposal. Find the smallest valid envelope constant , the acceptance rule and the acceptance probability. What changes if you only know the unnormalised density ? |
Probabilistic models | L2 | Medium | Mat | |
| 623 | How do you derive the evidence lower bound (ELBO), and what is the gap? |
Probabilistic models | L3 | Long | Th+Mat | |
| 624 | How is the forward recursion for a hidden Markov model derived? For the HMM with states Rainy (R) and Sunny (S), , transitions , , , , and emissions , , , , what is ? |
Probabilistic models | L3 | Medium | Mat | |
| 625 | How do you derive the E-step and M-step of the EM algorithm for a Gaussian mixture model with components? |
Probabilistic models | L3 | Long | Mat | |
| 626 | Why does an iteration of the EM algorithm never decrease the observed-data log-likelihood? |
Probabilistic models | L3 | Medium | Mat | |
| 627 | What are the posterior predictive mean and variance of Gaussian process regression, and how are they derived? With one training point , , noise variance and kernel , what are they at ? |
Probabilistic models | L3 | Long | Mat | |
| 628 | How does the Bayesian model evidence penalise an over-complex model, without any explicit penalty term? |
Probabilistic models | L3 | Short | Th | |
| 629 | What does a Gaussian process define, and how does the length-scale of the RBF kernel change the functions it prefers? |
Probabilistic models | L3 | Short | Th | |
| 630 | What is the generative story of latent Dirichlet allocation (LDA), and what do and represent? |
Probabilistic models | L3 | Short | Th | |
| 631 | An HMM has two states, initial probabilities , transition matrix , and emissions , , , . For the observations , what are the backward variables, and the posterior ? |
Probabilistic models | L3 | Medium | Mat | |
| 632 | The unnormalised density on is a density. What is its Laplace approximation, and how does its variance compare with the exact one? |
Probabilistic models | L3 | Medium | Mat | |
| 633 | In a network (burglary, alarm, earthquake), and . The alarm probabilities are , , and . What are and , and why do they differ? |
Probabilistic models | L3 | Long | Mat | |
| 634 | A Bayesian network has a root and children , with arrows , all variables binary. To compute with no evidence, compare the cost of eliminating first against eliminating first. What is the induced width in each case? |
Probabilistic models | L3 | Medium | Th+Mat | |
| 635 | Three binary variables form a chain with unary factors , , (for values 0 and 1), and the same pairwise factor on both edges, if and otherwise. Using sum-product messages, what are and ? |
Probabilistic models | L3 | Medium | Mat | |
| 636 | A binary chain has unary factors , , , and both pairwise factors are if and otherwise. Use max-product to find the MAP assignment and its unnormalised value. How does this relate to the Viterbi algorithm? |
Probabilistic models | L3 | Medium | Mat | |
| 637 | How does the Baum–Welch algorithm (EM for an HMM) derive its updates for the transition probabilities and emission probabilities ? |
Probabilistic models | L3 | Long | Mat | |
| 638 | For the linear-Gaussian model with , and with , how do you derive the Kalman filter predict and update equations from the conditioning rule for Gaussians? |
Probabilistic models | L3 | Long | Mat | |
| 639 | For a mixture of Bernoulli distributions on binary vectors , with , how do you derive the E-step and M-step updates of EM? |
Probabilistic models | L3 | Long | Mat | |
| 640 | For Bayesian linear regression with prior and likelihood , how do you derive the posterior by completing the square, and how does its mean relate to ridge regression? |
Probabilistic models | L3 | Long | Mat | |
| 641 | Show that the predictive distribution of Bayesian linear regression at a new input has variance , where is the feature vector. How do you show that the second term can only shrink when a new data point is added? |
Probabilistic models | L3 | Medium | Mat | |
| 642 | A GP with kernel and noise variance is trained on and . What are the predictive mean and variance at ? |
Probabilistic models | L3 | Long | Mat | |
| 643 | A target distribution on three states is . A Metropolis sampler proposes one of the two other states with probability each, and accepts with probability . What is the transition matrix, and how do you check that is stationary and that detailed balance holds? |
Probabilistic models | L3 | Medium | Mat | |
| 644 | For a bivariate Gaussian with zero means, unit variances and correlation , derive the Gibbs conditionals. Show that the sequence of values from a Gibbs sampler is an AR(1) process with coefficient . How many Gibbs steps per effectively independent sample are needed for ? |
Probabilistic models | L3 | Long | Mat | |
| 645 | In collapsed Gibbs sampling for LDA, the topic of a word is resampled from . Where does each factor come from? What is its value for , , , , with , and ? |
Probabilistic models | L3 | Long | Th+Mat | |
| 646 | The data are with known , and the prior is . For and sample mean , what is the posterior of and what is the predictive distribution of a new observation? How do you show that the posterior mean is a precision-weighted average? |
Probabilistic models | L3 | Medium | Mat | |
| 647 | In the Bayesian network with edges , , , and , what is the Markov blanket of ? Prove from the factorisation that is independent of all other variables given its blanket. Why is the co-parent included? |
Probabilistic models | L3 | Medium | Th+Mat | |
| 648 | You want for but you sample from and get . What are the importance weights, the self-normalised estimate and the effective sample size, and what does a small effective sample size tell you? |
Probabilistic models | L3 | Medium | Mat | |
| 649 | An MCMC chain has post-burn-in draws of a quantity with variance and autocorrelations . What is the effective sample size , how does the Monte Carlo standard error compare with the naive , and what happens to the information if you thin the chain by keeping every 20th draw? |
Probabilistic models | L3 | Medium | Mat | |
| 650 | How does the Metropolis–Hastings acceptance probability follow from detailed balance, and why is Gibbs sampling a special case whose proposals are always accepted? |
Probabilistic models | L4 | Long | Mat | |
| 651 | In mean-field variational inference, with , show that the optimal factor satisfies . How is this used as an algorithm? |
Probabilistic models | L4 | Long | Mat | |
| 652 | For Bayesian linear regression with prior and noise precision , derive the log evidence . Which terms reward fit, and which penalise complexity? |
Probabilistic models | L4 | Long | Mat | |
| 653 | Derive the log marginal likelihood of a GP regression model with , , and its gradient with respect to a kernel hyperparameter . How do the data-fit and complexity terms trade off as the length-scale grows? |
Probabilistic models | L4 | Long | Mat | |
| 654 | The target is a bivariate Gaussian with zero mean, unit variances and correlation . A mean-field approximation is fitted by minimising . What are the factor variances, and why are they much smaller than the true marginal variances? |
Probabilistic models | L4 | Medium | Th+Mat | |
| 655 | Two chains, each with post-burn-in draws of a scalar, give and . Compute the Gelman–Rubin and say what it indicates. Why is still not a proof of convergence? |
Probabilistic models | L4 | Medium | Th+Mat | |
| 656 | Use the Laplace approximation to the posterior to approximate the log evidence for i.i.d. data points and parameters. How does this lead to the BIC, and when does it break down? |
Probabilistic models | L4 | Long | Mat | |
| 657 | Why does the plain HMM forward algorithm underflow for long sequences, and how does the scaled forward algorithm fix it? How can you illustrate this using the HMM with , , , , , and observations ? |
Probabilistic models | L4 | Medium | Th+Mat | |
| 658 | Show that a single-site Gibbs update is a Metropolis–Hastings move that is always accepted, and that it leaves the target invariant. Why does a fixed-order sweep not give a reversible chain, and can you give an example where Gibbs sampling fails to converge? |
Probabilistic models | L4 | Long | Mat | |
| 659 | Show that Bayesian linear regression with features and weight prior is a Gaussian process, and that its predictive mean and variance equal the GP formulas with . What does this imply for the RBF kernel? |
Probabilistic models | L5 | Long | Mat | |
| 660 | Let factorise over the cliques of an undirected graph . Prove that if a set separates from in (every path from to passes through ), then . Where does the converse need extra assumptions? |
Probabilistic models | L5 | Long | Mat | |
| 661 | What is the difference between a model's training error and its true (population) error, and what does a generalisation guarantee promise about the gap between them? |
Learning theory | L1 | Short | Th+Mat | |
| 662 | What does the no free lunch theorem say, and why does it not mean that learning is impossible? |
Learning theory | L1 | Short | Th | |
| 663 | What is the mistake-bound (online learning) model, and how is it different from PAC learning? If a secret rule is one of 8 candidate rules and each mistake lets you throw away at least half of the candidates, how many mistakes can you make at most? |
Learning theory | L1 | Short | Th+Mat | |
| 664 | What does it mean for a hypothesis class to be PAC (probably approximately correct) learnable, and what roles do and play? |
Learning theory | L1 | Short | Th | |
| 665 | For a class of classifiers, what is the growth function, i.e. how many different ways can the class label points? For the one-dimensional thresholds , how many labellings can they make on 3 points? |
Learning theory | L1 | Short | Th+Mat | |
| 666 | What does it mean for a set of classifiers to shatter a set of points, and how do one-dimensional threshold rules (which predict if and otherwise) shatter a single point? |
Learning theory | L1 | Short | Th+Mat | |
| 667 | What is the difference between the realisable and the agnostic settings in PAC (probably approximately correct) learning? |
Learning theory | L1 | Short | Th | |
| 668 | In the bias–complexity trade-off, what are the approximation error and the estimation error, and how does each change as the hypothesis class gets richer? |
Learning theory | L1 | Short | Th | |
| 669 | In online prediction with expert advice, what is regret, and what does it mean for an algorithm to have sublinear regret? |
Learning theory | L1 | Short | Th | |
| 670 | Using Hoeffding's inequality, how large must a test set be so that the measured error of a fixed classifier is within of its true error with probability at least 95%? |
Learning theory | L2 | Short | Mat | |
| 671 | What is the VC dimension of the class of closed intervals on the real line, and why? |
Learning theory | L2 | Medium | Th+Mat | |
| 672 | The halving algorithm is run on a finite class of hypotheses and the labels are realisable (some hypothesis in the class is always correct). What is the largest number of mistakes it can make, and why? |
Learning theory | L2 | Short | Mat | |
| 673 | A learner must find a conjunction of literals over Boolean variables (each variable may appear positively, negated, or not at all) in the realisable setting. Treat the class as having hypotheses (the extra one is the always-false conjunction). How many examples guarantee error at most with probability at least ? |
Learning theory | L2 | Short | Mat | |
| 674 | A perceptron is run on linearly separable data with for all . Some unit vector separates it with margin . What upper bound does Novikoff's theorem give on the number of mistakes? What changes if all inputs are multiplied by ? |
Learning theory | L2 | Short | Mat | |
| 675 | Run the weighted majority algorithm by hand with experts, all starting with weight , and penalty factor (the weight of a wrong expert is multiplied by ). In round 1, experts predict and experts predict , and the true label is . In round 2, experts predict and experts predict , and the true label is . What does the algorithm predict, and what are the weights, after each round? |
Learning theory | L2 | Medium | Mat | |
| 676 | A class has VC dimension . By Sauer's lemma, at most how many different labellings can it produce on points? What fraction of all labellings is that, and what does the bound say for ? |
Learning theory | L2 | Short | Mat | |
| 677 | In kernel ridge regression, predictions take the form with weights , where is the kernel matrix, is the vector of targets, is the regularisation parameter and is the identity matrix. For two training points with , and , what are and the prediction at a new point with and ? |
Learning theory | L2 | Medium | Mat | |
| 678 | Why is for a finite class , and is the bound tight? |
Learning theory | L2 | Short | Th+Mat | |
| 679 | Linear classifiers with are trained on points with . A classifier has margin at least on of the training points. Using with , what true-error bound do you get? What if were four times larger? |
Learning theory | L2 | Medium | Mat | |
| 680 | A coin is tossed times and is the fraction of heads. Using Chebyshev with variance at most , and Hoeffding, bound for and . Which bound is tighter in each case? Also, for a non-negative with mean 50, what does Markov say about ? |
Learning theory | L2 | Medium | Mat | |
| 681 | Show that for a finite hypothesis class in the realisable setting, any learner that outputs a hypothesis consistent with the training data is PAC with samples. How many samples are needed when , and ? |
Learning theory | L3 | Medium | Mat | |
| 682 | In the agnostic setting, why does empirical risk minimisation (ERM) return a hypothesis within of the best in when every satisfies ? What sample complexity does this give for finite , and how does the excess risk split into approximation and estimation error? |
Learning theory | L3 | Medium | Mat | |
| 683 | In AdaBoost each weak learner has weighted error . Using the bound on training error, how many rounds guarantee training error below ? How does the exact product of the compare with the bound? |
Learning theory | L3 | Medium | Mat | |
| 684 | What is the VC dimension of axis-aligned rectangles in , and how do you prove it? |
Learning theory | L3 | Medium | Th+Mat | |
| 685 | How do you prove the perceptron convergence theorem (Novikoff): if and some unit vector has for all , then the perceptron makes at most mistakes? |
Learning theory | L3 | Long | Mat | |
| 686 | How do you show that if has VC dimension , then every deterministic online learner can be forced to make at least mistakes even in the realisable setting? |
Learning theory | L3 | Medium | Th+Mat | |
| 687 | How do you derive the mistake bound of the weighted majority algorithm, with experts, penalty factor , and an expert that makes mistakes, so that the algorithm makes at most mistakes? |
Learning theory | L3 | Medium | Mat | |
| 688 | Show that for , . Why does this bound matter for generalisation? |
Learning theory | L3 | Medium | Mat | |
| 689 | How do you show that the empirical Rademacher complexity of on a sample with is at most ? |
Learning theory | L3 | Medium | Mat | |
| 690 | For a learning algorithm and a training set of i.i.d. examples, let the leave-one-out error be . Prove that its expectation equals the expected true risk of trained on examples. Why is it not an unbiased estimate of the risk for examples, and why can its variance still be large? |
Learning theory | L3 | Medium | Th+Mat | |
| 691 | Three nested hypothesis classes have VC dimensions and the best training errors on examples are . Using the penalised bound with , which class does structural risk minimisation pick? Why is picking the lowest training error wrong? |
Learning theory | L3 | Medium | Mat | |
| 692 | A PAC-Bayes bound says that, with probability at least over examples, every posterior satisfies . Take and with . Compute the KL, and the bound for , and . Why does the bound beat a naive one for a large network? |
Learning theory | L3 | Medium | Th+Mat | |
| 693 | What is the empirical Rademacher complexity of a function class, and why does it measure capacity? What is it for (a) a class containing one function and (b) the class of all labellings of distinct points, and what generalisation bound does it give? |
Learning theory | L4 | Medium | Th+Mat | |
| 694 | What is double descent? Why can test error fall again once a model has more parameters than training points, and how does this fit with the classical bias–variance picture? |
Learning theory | L4 | Medium | Th+Mat | |
| 695 | What is the VC dimension of the class of disks (interior and boundary) in , with points inside labelled , and how do you prove it? |
Learning theory | L4 | Long | Th+Mat | |
| 696 | How do you derive the regret bound for the Hedge (exponential weights) algorithm, with experts, losses in and learning rate , so that , and what is the best ? |
Learning theory | L4 | Long | Mat | |
| 697 | What is uniform stability of a learning algorithm , and how do you prove that a -uniformly stable algorithm has expected generalisation gap at most ? What is an example of a stable algorithm with its ? |
Learning theory | L4 | Long | Th+Mat | |
| 698 | How do you state and prove the representer theorem: for a kernel with RKHS , every minimiser of with strictly increasing has the form ? |
Learning theory | L4 | Long | Mat | |
| 699 | The class of thresholds on has VC dimension . Show that no online learner can guarantee a finite number of mistakes on it in the realisable setting. What does this say about the relation between VC dimension and online learnability? |
Learning theory | L4 | Medium | Th+Mat | |
| 700 | Let be a ball in an RKHS, with . Show that , where is the kernel matrix of the sample. Why is this significant for the Gaussian kernel? |
Learning theory | L4 | Medium | Mat | |
| 701 | For convex losses with gradients satisfying , online gradient descent plays , where projects onto the ball . Prove that regret against any in the ball is at most . What are the best and the resulting bound for , , ? |
Learning theory | L4 | Long | Mat | |
| 702 | Cover's counting function says that points in general position in have dichotomies realisable by a hyperplane through the origin. Derive it from the recurrence , and compute the fraction of the labellings that are separable for and . What does this say about capacity? |
Learning theory | L4 | Long | Mat | |
| 703 | State McDiarmid's bounded-differences inequality. For a loss in and a hypothesis class , show that satisfies bounded differences with constant . Hence, how do you show that, with probability at least , , and what is the deviation term for and ? |
Learning theory | L4 | Long | Mat | |
| 704 | What is the VC dimension of linear classifiers (with a bias term) in -dimensional space , and how do you prove it? |
Learning theory | L5 | Long | Mat | |
| 705 | Define the growth function . State and prove Sauer's lemma: if , then . Why does this matter for generalisation? |
Learning theory | L5 | Long | Mat | |
| 706 | How do you prove the no free lunch theorem: for any learning algorithm for binary classification with the - loss over a domain , and any training size , there is a distribution and a labelling function with such that with probability at least over , ? |
Learning theory | L5 | Long | Mat | |
| 707 | How do you prove that for a class of functions with values in , with probability at least over a sample of size , every satisfies , where is the expected Rademacher complexity? |
Learning theory | L5 | Long | Mat | |
| 708 | How do you prove Massart's finite class lemma: for a finite set with for all , . How do you use it with Sauer's lemma to bound the Rademacher complexity of a class of VC dimension ? |
Learning theory | L5 | Long | Mat | |
| 709 | How do you show that no online algorithm can guarantee regret against even experts, by constructing a loss sequence for which every algorithm has expected regret at least ? |
Learning theory | L5 | Long | Mat | |
| 710 | In plain words, what are precision and recall for a binary classifier? A spam filter flags 10 emails and 8 of them are truly spam, while the inbox holds 16 spam emails in all. What are its precision and recall? |
ML systems and evaluation | L1 | Short | Th+Mat | |
| 711 | What is a confusion matrix for a binary classifier, and what do its four cells mean? A spam filter checks 100 emails, 20 of which are spam. It flags 18 emails as spam, and 15 of those really are spam. What goes in each cell? |
ML systems and evaluation | L1 | Short | Th+Mat | |
| 712 | What is an online A/B test, why are users split at random between the two versions, and what does 'statistically significant' roughly mean? If version A gets 50 clicks from 1000 users and B gets 60 from 1000, can you already say B is better? |
ML systems and evaluation | L1 | Short | Th+Mat | |
| 713 | What is training–serving skew? |
ML systems and evaluation | L1 | One-liner | Th | |
| 714 | What is stratified -fold cross-validation, and why is it preferred over ordinary -fold on imbalanced classification datasets? |
ML systems and evaluation | L1 | One-liner | Th | |
| 715 | What is the difference between demographic parity and equalised odds, and why can a perfect classifier violate demographic parity? |
ML systems and evaluation | L1 | Short | Th | |
| 716 | What is a confounding variable, and how does randomising treatment assignment in an experiment remove confounding bias? |
ML systems and evaluation | L1 | Short | Th | |
| 717 | What is the difference between a shadow deployment and a canary rollout when releasing a new ML model? |
ML systems and evaluation | L1 | Short | Th | |
| 718 | What is the difference between interpretability and explainability in machine learning, and what risks arise when relying on post-hoc explanations? |
ML systems and evaluation | L1 | Short | Th | |
| 719 | When would you prefer PR-AUC over ROC-AUC? |
ML systems and evaluation | L2 | Medium | Th | |
| 720 | What is the difference between covariate (data) drift and concept drift, what is an example of each, and how would you detect each in production? |
ML systems and evaluation | L2 | Short | Th | |
| 721 | A search system returns four documents whose graded relevance, in rank order, is (higher is more relevant; 0 is irrelevant). What are precision@3 and NDCG@4, using ? |
ML systems and evaluation | L2 | Medium | Mat | |
| 722 | Why is ordinary shuffled k-fold cross-validation wrong for time-series data, and what should you do instead? |
ML systems and evaluation | L2 | Short | Th | |
| 723 | What does it mean for a classifier to be calibrated? Compute the expected calibration error (ECE) for two confidence bins: 60 predictions with mean confidence 0.9 and accuracy 0.75, and 40 predictions with mean confidence 0.6 and accuracy 0.55. How does temperature scaling fix miscalibration? |
ML systems and evaluation | L2 | Medium | Th+Mat | |
| 724 | A binary classifier outputs predicted probabilities for six test examples with true labels . What are the points on the ROC curve, and what is the exact ROC-AUC? |
ML systems and evaluation | L2 | Medium | Mat | |
| 725 | A disease screening model tested on 200 patients produces , , and . What are precision, recall, and , and why does a screening task favour ? |
ML systems and evaluation | L2 | Medium | Mat | |
| 726 | On four test examples with true labels , Model A predicts probabilities and Model B predicts . Both achieve 75% accuracy at threshold 0.5; what is the binary log loss of each model, and why do they differ so sharply? |
ML systems and evaluation | L2 | Medium | Mat | |
| 727 | A regression model predicts for true targets . What are the MAE and RMSE, why is RMSE strictly larger here, and when is each metric preferred? |
ML systems and evaluation | L2 | Short | Th+Mat | |
| 728 | A search engine returns 4 results for three queries with binary relevance , and , where 1 means relevant and each query has exactly 2 relevant documents in the corpus. What are MRR and MAP, and when would you prefer each? |
ML systems and evaluation | L2 | Medium | Mat | |
| 729 | You are training a pneumonia detector on 5,000 chest X-rays collected from 500 patients (10 scans per patient). Why does standard or stratified -fold cross-validation overestimate test accuracy, and how does group -fold fix it? |
ML systems and evaluation | L2 | Short | Th | |
| 730 | An online A/B test configured for a 50/50 split logs 50,800 users in control and 49,200 in treatment out of 100,000 total. What does a goodness-of-fit test at (critical value ) show about sample ratio mismatch (SRM), and why must metric analysis stop if SRM fails? |
ML systems and evaluation | L2 | Medium | Mat | |
| 731 | What is the difference between unstructured magnitude pruning and structured pruning, and why does 80% unstructured sparsity often give little wall-clock speedup on standard GPUs? |
ML systems and evaluation | L2 | Short | Th+Mat | |
| 732 | A three-class classifier produces confusion matrix rows (true classes A, B, C; predicted columns A, B, C) of , and . What are macro-F1 and micro-F1, why does micro-F1 equal overall accuracy here, and when is macro-F1 preferred? |
ML systems and evaluation | L2 | Medium | Mat | |
| 733 | An A/B test evaluates 20 independent metrics at significance level when the treatment actually has zero effect on all of them. What is the probability of getting at least one false positive, how does Bonferroni correction adjust the threshold, and why does sequential peeking cause a similar problem? |
ML systems and evaluation | L2 | Medium | Mat | |
| 734 | A loan classifier is evaluated on two demographic groups of 100 applicants each: Group A has and Group B has . What are the positive prediction rate, , and for each group, and which fairness criteria are satisfied or violated? |
ML systems and evaluation | L2 | Medium | Mat | |
| 735 | A credit score model’s training score distribution across four equal-frequency bins is , while live production traffic shifts to . What is the population stability index (PSI), how severe is the drift under standard thresholds, and why should rising PSI trigger investigation rather than automatic blind retraining? |
ML systems and evaluation | L2 | Medium | Th+Mat | |
| 736 | A classifier gets 340 of 400 test examples right. Give an approximate 95% confidence interval for its true accuracy. How large must the test set be to estimate accuracy to within percentage points at 95% confidence, if you have no prior idea of the accuracy? |
ML systems and evaluation | L2 | Medium | Mat | |
| 737 | Two classifiers A and B are evaluated on the same 200 test examples. Both are right on 150, both are wrong on 15, only A is right on 25 and only B is right on 10. Test at the 5% level, using McNemar's statistic (where and count the examples on which only one of the two classifiers is right) and the 5% critical value , whether the difference in accuracy is real. Why not simply compare the two accuracies? |
ML systems and evaluation | L2 | Medium | Th+Mat | |
| 738 | A classifier on 1,000 test examples has TP = 10, FN = 10, FP = 5 and TN = 975. Compute the accuracy, the F1 score and the Matthews correlation coefficient, . What do these give for a model that always predicts negative? |
ML systems and evaluation | L2 | Medium | Mat | |
| 739 | How do you evaluate the retriever in a RAG (retrieval-augmented generation) system separately from the generator? Suppose three queries have relevant chunk IDs , and , and the retriever returns top-5 lists , and . What are the recall@5, precision@5, hit rate@5 and MRR (mean reciprocal rank), and how does scoring both retrieval and generation let you separate a retrieval miss from a generation error? |
ML systems and evaluation | L2 | Medium | Mat | |
| 740 | How do you monitor a deployed ML (machine learning) model when ground-truth labels arrive weeks late or never arrive at all? |
ML systems and evaluation | L2 | Medium | Th | |
| 741 | A weight matrix is stored densely in fp16 (2 bytes per number). To store an unstructured-pruned copy in CSR (compressed sparse row) format you keep, for each non-zero, its fp16 value (2 bytes) and its column index (int32, 4 bytes), plus one int32 row pointer per row plus one. How many bytes does the sparse copy use at 80% and 95% sparsity, and at what sparsity does it break even with the dense copy? |
ML systems and evaluation | L2 | Medium | Mat | |
| 742 | How do accuracy, F1 score and ROC-AUC compare as evaluation metrics for a binary classifier, and when is each appropriate, considering threshold dependence, class imbalance and whether each measures ranking quality or decision quality (use a small confusion-matrix example)? |
ML systems and evaluation | L3 | Long | Th+Mat | |
| 743 | Your current click-through rate is 10%. How many users per arm does an A/B test need to detect an absolute increase to 11%, with a two-sided significance level of 5% and 80% power? |
ML systems and evaluation | L3 | Medium | Mat | |
| 744 | A calibrated fraud model outputs . Missing a fraud costs ₹10,000 and flagging a legitimate transaction costs ₹1,000 in review effort. Derive the cost-minimising threshold. What would you do if the model were not calibrated? |
ML systems and evaluation | L3 | Medium | Mat | |
| 745 | For true values and linear-regression predictions (fitted with feature), what are and adjusted , how can test-set become negative, and why does adding a pure-noise feature never reduce training whereas adjusted penalises it? |
ML systems and evaluation | L3 | Medium | Th+Mat | |
| 746 | A student standardises features and applies PCA on the full dataset before running 5-fold cross-validation, obtaining 92% accuracy, whereas fitting both inside each fold yields 81%. Why does the first setup leak information, how does a pipeline fix it, and why is supervised feature selection before CV even more damaging? |
ML systems and evaluation | L3 | Short | Th+Mat | |
| 747 | Why does reporting the best validation score from -fold hyperparameter tuning give an optimistically biased error estimate, how does nested cross-validation fix this, and how many total model fits are required for 5 outer folds, 4 inner folds and 6 hyperparameter candidates? |
ML systems and evaluation | L3 | Medium | Th+Mat | |
| 748 | On four binary outcomes , Forecaster A predicts and Forecaster B predicts . What are their Brier scores, and how do you prove that the Brier score is a strictly proper scoring rule? |
ML systems and evaluation | L3 | Medium | Mat | |
| 749 | How does permutation feature importance measure a feature’s contribution, why must it be computed on held-out validation data rather than training data, and what happens when two strongly correlated features () are evaluated with it? |
ML systems and evaluation | L3 | Medium | Th+Mat | |
| 750 | A weight tensor of 100 million parameters stored in FP32 (4 bytes each) spans the range . What are the unsigned INT8 () affine scale and zero-point , what are the quantised and dequantised values and error for , and how much parameter memory is saved? |
ML systems and evaluation | L3 | Medium | Mat | |
| 751 | What are the Shapley value formula and its four uniqueness axioms, and for a 3-feature model with coalition values , , , , , , and , what are the exact Shapley attributions (verifying efficiency)? |
ML systems and evaluation | L3 | Long | Mat | |
| 752 | In online A/B testing, CUPED reduces metric variance by replacing the outcome with , where is a pre-experiment covariate unaffected by treatment. How do you show that (unbiasedness), derive the variance-minimising , and prove that the minimum variance is where ? |
ML systems and evaluation | L3 | Long | Mat | |
| 753 | Under covariate shift, how do you derive the importance-weighted loss and estimate using a domain classifier? Given training points and unlabelled test points, four training examples receive calibrated domain probabilities and per-example losses : what are their importance weights, the weighted loss, and the ESS (effective sample size), and why does this fail under concept drift? |
ML systems and evaluation | L3 | Medium | Mat | |
| 754 | How do you use the two-sample KS (Kolmogorov–Smirnov) test to detect drift in a model's prediction scores? Suppose 6 reference scores are and 6 live scores are : what are the empirical CDFs (cumulative distribution functions), the KS statistic , and the comparison against the large-sample critical value, and why do production teams alert on effect size rather than p-values? |
ML systems and evaluation | L3 | Medium | Mat | |
| 755 | How does FedAvg (federated averaging) train a shared model without centralising raw data, and what privacy risks remain? In one round, three clients with , and examples return scalar weights , and : what is the aggregated weight, and how do secure aggregation, differential privacy and non-IID (non-independent and identically distributed) data affect the protocol? |
ML systems and evaluation | L3 | Medium | Th+Mat | |
| 756 | A new recommender model improves offline AUC on logged data, but an online A/B test shows no gain. What are the likely reasons, and how can you make offline evaluation more predictive of online results? |
ML systems and evaluation | L4 | Medium | Th+Mat | |
| 757 | How do partial dependence plots (PDP) and LIME explain a black-box model, why do correlated features mislead both via out-of-distribution extrapolation, and how do individual conditional expectation (ICE) plots fix a separate weakness of PDPs? |
ML systems and evaluation | L4 | Medium | Th | |
| 758 | In knowledge distillation, the student minimises , where uses temperature . How do you derive the gradient of with respect to student logit in the high-temperature limit to show why the multiplier is needed? |
ML systems and evaluation | L4 | Medium | Mat | |
| 759 | In a hospital study of 1,000 patients split evenly between mild () and severe () cases, recovery rates for treated () vs untreated () patients are vs among mild cases and vs among severe cases. How do these numbers exhibit Simpson’s paradox, what is the causal DAG and backdoor-adjusted effect , and why does adjusting for a collider instead of a confounder introduce bias? |
ML systems and evaluation | L4 | Long | Th+Mat | |
| 760 | What is -differential privacy, and why does the Laplace mechanism satisfy it? For a counting query (sensitivity ) released with the Laplace mechanism at , what are the noise scale , variance, standard deviation, and tail probability , and how do privacy and accuracy change across repeated queries? |
ML systems and evaluation | L4 | Medium | Mat | |
| 761 | How does DP-SGD (differentially private stochastic gradient descent) bound per-example influence and add noise during training? In a batch of size with clipping threshold and noise multiplier , two per-example gradients have norms and : what are their clipping scale factors, what is the per-coordinate noise standard deviation on the averaged gradient, and why do per-example clipping, subsampling, and larger batches matter? |
ML systems and evaluation | L4 | Medium | Th+Mat | |
| 762 | For a probabilistic binary classifier issuing discrete forecast values with bin sizes (summing to ), bin observed frequencies and overall base rate , how do you derive Murphy’s three-term decomposition of the Brier score into reliability, resolution and uncertainty, and what does each term measure? |
ML systems and evaluation | L5 | Long | Mat | |
| 763 | For a binary classifier evaluated on a demographic group with base rate , how do you derive Chouldechova’s identity relating false positive rate (), false negative rate (), positive predictive value () and , and why does it prove that an imperfect classifier cannot satisfy both predictive parity and equalised odds when two groups have unequal base rates? |
ML systems and evaluation | L5 | Long | Mat | |
| 764 | In off-policy evaluation with context , action , reward , logging policy and target policy , the inverse propensity scoring (IPS) estimator is and the doubly robust (DR) estimator is , where . How do you prove that IPS is unbiased, and why is DR unbiased whenever either the propensity model or the reward model is exact? |
ML systems and evaluation | L5 | Long | Mat | |
| 765 | What are the main parts of a machine learning system in production, and how do they connect in a loop? |
ML system design | L1 | Short | Th | |
| 766 | How should you structure an answer to a machine learning system design question, and how should you pace it in a 45-minute interview? |
ML system design | L1 | Short | Th | |
| 767 | Why should you start an ML (machine learning) system design with a simple baseline, such as rules, popularity or logistic regression, before building a deep neural network? |
ML system design | L1 | Short | Th | |
| 768 | How do you turn a vague business goal such as 'increase engagement on a video app' into an ML objective, offline metrics, online metrics and guardrail metrics? |
ML system design | L1 | Short | Th | |
| 769 | What do latency, throughput, p50 and p90 mean? Given 10 request latencies of milliseconds, what are the p50 and p90, and why do production systems promise p99 rather than the average? |
ML system design | L1 | Short | Th+Mat | |
| 770 | When can you cache a machine learning model's predictions to save compute, and when is caching a bad idea? |
ML system design | L1 | Short | Th | |
| 771 | Why do we sometimes train one model on several GPUs at once, and what is the simplest way to share the work between them? |
ML system design | L1 | Short | Th | |
| 772 | An ML service has 100 million daily active users, and each user triggers 20 model requests per day. Peak traffic is the daily average, and one server handles 500 QPS (queries per second) within the latency target. What are the average QPS, peak QPS, minimum servers needed, and servers needed with 30% headroom? Why do you size for peak rather than average? |
ML system design | L2 | Short | Mat | |
| 773 | When should you choose batch (offline, precomputed) inference over online (real-time) inference, and how do hybrid designs combine the two? |
ML system design | L2 | Short | Th | |
| 774 | What is a feature store, what problems does it solve in production ML, and when is it unnecessary? |
ML system design | L2 | Short | Th | |
| 775 | Why does pure collaborative filtering fail on cold start, and how do you handle cold start for both new users and new items in a recommender system? |
ML system design | L2 | Short | Th | |
| 776 | A model serves requests per second, and you log (kilobyte, bytes) per prediction (inputs, output and model version). How much storage does this take per day, per days and per year ( days), why do we log predictions at all, and how can you cut the cost? |
ML system design | L2 | Short | Mat | |
| 777 | How would you design a spam filter for a small college email server that receives emails a day, of which about are spam? If your model achieves recall and a false-positive rate, how many spam emails are missed and how many legitimate emails are wrongly flagged per day? |
ML system design | L2 | Medium | Th+Mat | |
| 778 | How would you design a movie recommendation system for a small app with users and movies? Using a rating table where Movie A has ratings , Movie B has and Movie C has from three users, what is the cosine similarity between Movie A and Movie B, and how much storage is needed to precompute recommendations per user nightly? |
ML system design | L2 | Medium | Th+Mat | |
| 779 | What are data, tensor and pipeline parallelism in distributed training, and when should you use each? |
ML system design | L3 | Medium | Th | |
| 780 | You run data-parallel training on GPUs for a model with billion parameters and fp16 gradients ( bytes each). Using ring all-reduce, how many bytes does each GPU send per step, and how long does communication take at per link? |
ML system design | L3 | Medium | Mat | |
| 781 | Mixed-precision Adam requires bytes per parameter ( B fp16 weights, B fp16 gradients, B fp32 master weights, and B each for Adam moments and ). For a -billion-parameter model across GPUs, how much per-GPU memory do model states take under plain data parallelism and ZeRO stages 1, 2 and 3? |
ML system design | L3 | Medium | Mat | |
| 782 | What do p50 and p99 latency mean? Suppose a request fans out to 50 shards in parallel and waits for all of them, and each shard is slow () independently on of calls. What fraction of requests is slow, how would you split a p99 latency budget across ML serving stages, and how can you reduce tail latency? |
ML system design | L3 | Medium | Mat | |
| 783 | Why must training features be joined “as of” each label’s timestamp, and how does a point-in-time join work? Using a small user timeline, why do naive joins inflate offline metrics and then fail online, and what is one serving-time alternative? |
ML system design | L3 | Medium | Th+Mat | |
| 784 | Why do large recommenders and search engines split prediction into candidate generation (retrieval) followed by ranking? Suppose a catalogue has 10 million items and a heavy ranking model takes 50 µs per item; how does scoring the whole catalogue compare with using a two-tower model and approximate nearest neighbour (ANN) search to retrieve 1,000 candidates first? |
ML system design | L3 | Medium | Mat | |
| 785 | How much memory does an approximate nearest neighbour (ANN) index of 100 million 256-dimensional item embeddings require in fp32 (32-bit floating point), in fp16 (16-bit floating point), and with product quantisation (PQ) using 32 sub-quantisers of 1 byte each? How does PQ achieve this compression, and what are the trade-offs? |
ML system design | L3 | Short | Mat | |
| 786 | What artefacts and metadata must you version so that a trained ML model can be reproduced and safely rolled back in production, and why can bit-exact reproduction still fail? |
ML system design | L3 | Medium | Th | |
| 787 | How do you design a CI/CD (continuous integration and continuous delivery) pipeline for a production ML system, and how does it differ from ordinary software CI/CD? |
ML system design | L3 | Medium | Th | |
| 788 | How do you decide how often to retrain a production ML model, and what are degenerate feedback loops and how can you mitigate them? |
ML system design | L3 | Medium | Th | |
| 789 | Clicks from a ranked list are biased by display position. Under the examination hypothesis , with position propensities for positions 1–3, how do you show that inverse propensity weighting (IPW) gives an unbiased estimate of relevance, and what are the naive click-through rate (CTR) and the IPW estimate for an item shown 100 times at position 1 (30 clicks), 100 times at position 2 (18 clicks), and 200 times at position 3 (18 clicks)? |
ML system design | L4 | Medium | Mat | |
| 790 | A production model's request error rate is 2%. A canary deployment receives 5% of 1,000 queries per second (QPS). Using a one-sided test at significance level and power (with and ), how many canary requests are needed to detect a rise in error rate to 2.5% against the baseline fleet, and how long does that take? Why does peeking repeatedly at canary metrics inflate false alarms? |
ML system design | L4 | Medium | Mat | |
| 791 | How would you design a spam detection system for a large messaging or email platform? |
ML system design | L4 | Long | Th+Mat | |
| 792 | How would you design a video recommendation system for a large video platform? |
ML system design | L4 | Long | Th+Mat | |
| 793 | How would you design an ad click-through rate (CTR) prediction system? |
ML system design | L4 | Long | Th+Mat | |
| 794 | How would you design a search ranking system for a large e-commerce site? |
ML system design | L4 | Long | Th+Mat | |
| 795 | How would you design a real-time payment fraud detection system? |
ML system design | L4 | Long | Th+Mat | |
| 796 | How would you design a retrieval-augmented question answering system over a company's internal documents? As part of the prompt budget, if the model has an 8,000-token context window, 1,000 tokens are reserved for system instructions and the user question, and 500 tokens are reserved for the answer, how many 400-token chunks fit? |
ML system design | L4 | Long | Th+Mat | |
| 797 | How would you design a visual search system that finds products looking like an uploaded photo? Assuming 500 images/s per GPU (graphics processing unit) and USD 2 per GPU-hour, how much GPU time and cost does it take to re-embed a 500-million-image catalogue when upgrading the embedding model? |
ML system design | L4 | Long | Th+Mat | |
| 798 | How would you design a system to serve a 7B-parameter large language model (LLM) chat service at scale? For a 32-layer model with hidden size 4,096 in 16-bit floating point (fp16, 14 GB of weights), what are the key–value (KV) cache memory per token, the memory for a 4,096-token sequence, roughly how many full-length sequences fit on an 80 GB GPU (graphics processing unit), and what is the serving cost per million output tokens if a GPU costs USD 2 per hour and sustains 2,500 output tokens/s? |
ML system design | L5 | Long | Th+Mat | |
| 799 | How would you plan the infrastructure for training a 70B-parameter language model on 1.4 trillion tokens? Using FLOPs (floating-point operations, for parameters and tokens) and 16 bytes per parameter for mixed-precision AdamW model states, how much model-state memory does it need, how long does it take on 1,024 GPUs (graphics processing units, 312 TFLOP/s peak each at 40% model FLOPs utilisation, MFU), what data-pipeline throughput is required, and how do you handle parallelism, checkpointing and failure recovery? |
ML system design | L5 | Long | Th+Mat |
|
Core Machine Learning Questions, by Shreyan Basu Ray (@shreyanbr on X)
Last modified: December 4, 2026 |