ICML study materials
ICML study resources

ICML practice questions

One question at a time. Build your ICML understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Mathematics and Statistics Foundations

What is the derivative of f(x) = x^3 with respect to x?

  1. 3x^2 Correct answer.
  2. x^4/4
  3. 3x
  4. x^2

Explanation

The power rule states that the derivative of x^n is n·x^(n-1). Applying it with n = 3 gives 3x^2.

Question 2Mathematics and Statistics Foundations

A fair six-sided die is rolled once. What is the probability of rolling an even number?

  1. 2/3
  2. 1/2 Correct answer.
  3. 1/3
  4. 1/6

Explanation

The even outcomes are 2, 4, and 6, giving 3 favorable outcomes out of 6 equally likely outcomes. Thus the probability is 3/6 = 1/2.

Question 3Mathematics and Statistics Foundations

Which matrix operation requires the number of columns of the first matrix to equal the number of rows of the second?

  1. Transposition
  2. Matrix multiplication Correct answer.
  3. Element-wise addition
  4. Scalar multiplication

Explanation

Matrix multiplication is defined only when the inner dimensions match, i.e., columns of the left factor equal rows of the right factor. The resulting matrix has the outer dimensions.

Question 4Mathematics and Statistics Foundations

If a random variable X has expected value E[X] = 5, what is E[3X + 2]?

  1. 21
  2. 10
  3. 15
  4. 17 Correct answer.

Explanation

Expectation is linear, so E[3X + 2] = 3·E[X] + 2 = 3·5 + 2 = 17.

Question 5Mathematics and Statistics Foundations

What does the central limit theorem state about the sample mean of independent, identically distributed variables with finite variance?

  1. It converges in distribution to a normal distribution as sample size grows Correct answer.
  2. It always equals the population mean
  3. Its variance grows without bound as sample size grows
  4. It is exactly normal for any sample size

Explanation

The central limit theorem says the standardized sample mean approaches a standard normal distribution as the sample size increases, regardless of the underlying distribution's shape (given finite variance).

Question 6Mathematics and Statistics Foundations

What is the value of the integral of f(x) = 1 over the interval [0, 4]?

  1. 4 Correct answer.
  2. 8
  3. 2
  4. 0

Explanation

The definite integral of the constant 1 over [0, 4] equals the length of the interval, 4. Geometrically it is the area of a rectangle with height 1 and width 4.

Question 7Mathematics and Statistics Foundations

In a vector space, which property must every vector v satisfy with respect to the additive identity 0?

  1. v + 0 = v Correct answer.
  2. v · 0 = 0
  3. v + v = 0
  4. 0 - v = v

Explanation

The additive identity axiom requires that adding the zero vector to any vector leaves it unchanged, i.e., v + 0 = v. This is one of the vector space axioms.

Question 8Mathematics and Statistics Foundations

A function f is convex on an interval. What can be said about any local minimum of f in the interior of that interval?

  1. It must occur at a boundary point
  2. It is a local maximum
  3. It cannot exist
  4. It is a global minimum Correct answer.

Explanation

For a convex function, any local minimum in the interior is also a global minimum. Convexity guarantees the function lies below the chord between any two points, ruling out higher separate minima.

Question 9Mathematics and Statistics Foundations

A bag contains 3 red and 2 blue balls. Two balls are drawn without replacement. What is the probability both are red?

  1. 1/2
  2. 2/5
  3. 9/25
  4. 3/10 Correct answer.

Explanation

The probability the first is red is 3/5, and given that, the second is red with probability 2/4. Multiplying gives (3/5)(2/4) = 6/20 = 3/10.

Question 10Mathematics and Statistics Foundations

Consider the matrix A = [[2, 0], [0, 3]]. What are its eigenvalues?

  1. 0 and 6
  2. 1 and 1
  3. 2 and 2
  4. 2 and 3 Correct answer.

Explanation

For a diagonal matrix, the eigenvalues are exactly the diagonal entries. Here those entries are 2 and 3.

Question 11Mathematics and Statistics Foundations

A coin lands heads with probability p. It is flipped until the first head appears. What is the expected number of flips?

  1. 1/(1-p)
  2. p/(1-p)
  3. 1/p Correct answer.
  4. p

Explanation

The number of flips follows a geometric distribution with success probability p. Its expectation is the reciprocal of the success probability, 1/p.

Question 12Mathematics and Statistics Foundations

What is the gradient of f(x, y) = x^2 y at the point (1, 2)?

  1. (2, 1)
  2. (4, 2)
  3. (1, 4)
  4. (4, 1) Correct answer.

Explanation

The partial derivative with respect to x is 2xy, and with respect to y is x^2. Evaluating at (1, 2) gives (4, 1).

Question 13Mathematics and Statistics Foundations

If X and Y are independent random variables, which statement about their covariance is always true?

  1. Cov(X, Y) = 1
  2. Cov(X, Y) = Var(X)Var(Y)
  3. Cov(X, Y) = 0 Correct answer.
  4. Cov(X, Y) = E[X]E[Y]

Explanation

Independence implies E[XY] = E[X]E[Y], so Cov(X, Y) = E[XY] - E[X]E[Y] = 0. Thus independent variables are uncorrelated.

Question 14Mathematics and Statistics Foundations

A sequence a_n is defined by a_n = 1/n for n ≥ 1. What is the limit of a_n as n approaches infinity?

  1. It does not exist
  2. 1
  3. Infinity
  4. 0 Correct answer.

Explanation

As n grows without bound, 1/n approaches 0. For any epsilon > 0, choosing n > 1/epsilon makes |1/n| < epsilon.

Question 15Mathematics and Statistics Foundations

In hypothesis testing, what does the p-value represent?

  1. The probability of observing data at least as extreme as the observed, assuming the null is true Correct answer.
  2. The probability of a type II error
  3. The probability the null hypothesis is true
  4. The significance level chosen in advance

Explanation

The p-value is the probability, computed under the null hypothesis, of obtaining a test statistic at least as extreme as the one observed. It is not the probability that the null is true.

Question 16Mathematics and Statistics Foundations

What is the rank of the 3x3 matrix whose every entry equals 1?

  1. 3
  2. 1 Correct answer.
  3. 0
  4. 2

Explanation

All rows are identical, so they span a one-dimensional space. The rank is therefore 1.

Question 17Mathematics and Statistics Foundations

A random variable X is uniformly distributed on [0, 10]. What is its variance?

  1. 10
  2. 25/3 Correct answer.
  3. 100/3
  4. 5

Explanation

For a uniform distribution on [a, b], the variance is (b - a)^2 / 12. With a = 0 and b = 10, this is 100/12 = 25/3.

Question 18Mathematics and Statistics Foundations

What is the determinant of the 2x2 matrix [[a, b], [c, d]]?

  1. ac - bd
  2. a + d - b - c
  3. ab - cd
  4. ad - bc Correct answer.

Explanation

The determinant of a 2x2 matrix is the product of the main diagonal entries minus the product of the off-diagonal entries, ad - bc.

Question 19Mathematics and Statistics Foundations

A function f is differentiable at a point x0. Which statement must hold?

  1. f is twice differentiable at x0
  2. f is continuous at x0 Correct answer.
  3. f has a local maximum at x0
  4. f'(x0) = 0

Explanation

Differentiability implies continuity, so a differentiable function is necessarily continuous at that point. The converse fails, as with |x| at 0.

Question 20Mathematics and Statistics Foundations

In a linear regression model, what does the coefficient of determination R^2 measure?

  1. The average residual magnitude
  2. The number of predictors in the model
  3. The proportion of variance in the response explained by the model Correct answer.
  4. The slope of the fitted line

Explanation

R^2 is the fraction of the total variance in the response that is accounted for by the regression model, ranging from 0 to 1.

Question 21Mathematics and Statistics Foundations

Let A be an n x n matrix with all eigenvalues strictly less than 1 in absolute value. What happens to A^k as k approaches infinity?

  1. It oscillates without converging
  2. It converges to the identity matrix
  3. It diverges to infinity
  4. It converges to the zero matrix Correct answer.

Explanation

If the spectral radius is less than 1, the powers A^k converge to the zero matrix. This follows from the spectral radius formula and the Jordan form.

Question 22Mathematics and Statistics Foundations

A sequence of random variables X_n converges in probability to a constant c. Which statement is necessarily true?

  1. X_n converges to c almost surely
  2. Var(X_n) converges to 0
  3. X_n converges to c in distribution Correct answer.
  4. E[X_n] converges to c

Explanation

Convergence in probability implies convergence in distribution to the same constant. The reverse implication fails, and almost sure convergence is stronger than convergence in probability.

Question 23Mathematics and Statistics Foundations

Consider minimizing f(x) = x^2 subject to the constraint x ≥ 1. Where does the constrained minimum occur?

  1. x = 0
  2. x = 1 Correct answer.
  3. No minimum exists
  4. x = 2

Explanation

The unconstrained minimum of x^2 is at x = 0, which is infeasible. On the feasible set x ≥ 1, f is increasing, so the minimum is at the boundary x = 1.

Question 24Mathematics and Statistics Foundations

Let f be a twice continuously differentiable function on R with f''(x) > 0 everywhere and f'(x0) = 0 at some point x0. What is the nature of x0?

  1. A saddle point
  2. A strict global maximum
  3. An inflection point
  4. A strict global minimum Correct answer.

Explanation

Strict convexity from f'' > 0 everywhere means any critical point is a strict global minimizer. Since f'(x0) = 0, x0 is that unique global minimum.

Question 25Mathematics and Statistics Foundations

Let X and Y be independent standard normal variables. What is the distribution of X + Y?

  1. Standard normal
  2. Uniform on [-1, 1]
  3. Normal with mean 0 and variance 2 Correct answer.
  4. Chi-squared with 2 degrees of freedom

Explanation

The sum of independent normal variables is normal, with means and variances adding. Each has mean 0 and variance 1, so the sum is normal with mean 0 and variance 2.

Question 26Mathematics and Statistics Foundations

If A and B are independent events with P(A) = 0.3 and P(B) = 0.5, what is P(A ∩ B)?

  1. 0.3
  2. 0.5
  3. 0.8
  4. 0.15 Correct answer.

Explanation

For independent events, the probability of the intersection is the product of their probabilities: P(A ∩ B) = P(A) × P(B). Substituting the given values gives 0.3 × 0.5 = 0.15.

Question 27Mathematics and Statistics Foundations

Consider the matrix A = [[4, 1], [2, 3]]. What is the sum of its eigenvalues?

  1. 5
  2. 12
  3. 7 Correct answer.
  4. 10

Explanation

The sum of the eigenvalues of a matrix equals its trace, which is the sum of the diagonal entries. Here, the trace is 4 + 3 = 7, so the sum of the eigenvalues is 7.

Question 28Mathematics and Statistics Foundations

Let f(x) = 3x^2 + 2x + 1. What is the derivative f'(x)?

  1. 6x^2 + 2x
  2. 6x
  3. 6x + 2 Correct answer.
  4. 3x + 2

Explanation

The derivative of a polynomial is found by applying the power rule term by term. The derivative of 3x^2 is 6x, the derivative of 2x is 2, and the derivative of the constant 1 is 0, giving f'(x) = 6x + 2.

Question 29Mathematics and Statistics Foundations

A random variable X has the probability density function f(x) = 2x for 0 ≤ x ≤ 1, and f(x) = 0 otherwise. What is the expected value E[X]?

  1. 2/3 Correct answer.
  2. 1
  3. 1/3
  4. 1/2

Explanation

The expected value of a continuous random variable is the integral of x times its density over the support. Compute ∫_0^1 x·(2x) dx = ∫_0^1 2x^2 dx = [2x^3/3]_0^1 = 2/3.

Question 30Mathematics and Statistics Foundations

Let A be a 2×2 real matrix with eigenvalues 2 and 3. Which of the following is necessarily true about A?

  1. A has determinant 5.
  2. A is diagonalizable over the reals. Correct answer.
  3. A is singular.
  4. A is orthogonal.

Explanation

A 2×2 matrix with two distinct real eigenvalues has two linearly independent eigenvectors, and therefore is diagonalizable over the reals. The other properties do not follow: orthogonality requires A^T A = I, singularity requires a zero eigenvalue, and the determinant is the product of eigenvalues, not the sum.

Question 31Data Preparation and Feature Engineering

A dataset column records measured body temperature in degrees Celsius. A modeler converts the column to degrees Fahrenheit by applying F = 1.8*C + 32. Which effect does this transformation have on the column?

  1. It normalizes the column to zero mean and unit variance
  2. It converts the variable into a categorical feature
  3. It removes the effect of outliers from the distribution
  4. It changes the scale and offset but preserves the ordering of values Correct answer.

Explanation

Multiplying by a positive constant and adding a constant is an affine transformation, which rescales and shifts values while preserving their relative order. It does not standardize, discretize, or clip outliers.

Question 32Data Preparation and Feature Engineering

A feature has a heavily right-skewed distribution with a few very large values. Which transformation is most directly intended to reduce that skew?

  1. Rounding each value to the nearest integer
  2. Applying a logarithmic transform to the values Correct answer.
  3. Subtracting the median from each value
  4. One-hot encoding the value ranges

Explanation

A log transform compresses large values far more than small ones, pulling in the right tail and reducing positive skew. Centering, rounding, and encoding do not reshape the tail.

Question 33Data Preparation and Feature Engineering

A table has a column 'city' with values such as 'Paris', 'Tokyo', and 'Lima'. Which encoding produces one binary column per distinct city value?

  1. Ordinal encoding
  2. Binary hashing
  3. One-hot encoding Correct answer.
  4. Target encoding

Explanation

One-hot encoding creates a separate indicator column for each category, with a 1 in the column matching the row's category. Ordinal encoding uses a single integer column, and target encoding maps categories to a statistic of the label.

Question 34Data Preparation and Feature Engineering

In a dataset of customer records, 40% of rows have a missing value in the 'income' column. Which statement best describes the main risk of dropping all rows with missing income?

  1. The feature distributions will become exactly uniform
  2. The remaining data may be systematically different from the full population Correct answer.
  3. The remaining features will become perfectly correlated
  4. The target variable will be rescaled

Explanation

Dropping rows with missing values can introduce selection bias if missingness is related to the variable or the outcome. The resulting sample may no longer represent the original population.

Question 35Data Preparation and Feature Engineering

A numeric feature ranges from 10 to 1000, while another ranges from 0 to 1. A distance-based algorithm such as k-nearest neighbors is used. What is the main reason to scale the features first?

  1. Scaling guarantees that the model will not overfit
  2. Scaling removes the need to handle missing values
  3. Features with larger numeric ranges would otherwise dominate the distance computation Correct answer.
  4. Scaling converts the features into categorical variables

Explanation

Distance metrics sum squared differences across features, so a feature with a large range contributes disproportionately. Rescaling puts features on comparable footing before computing distances.

Question 36Data Preparation and Feature Engineering

A modeler wants to encode a categorical feature with categories 'low', 'medium', and 'high' that have a natural order. Which encoding best preserves that ordering?

  1. One-hot encoding with three indicator columns
  2. Hashing the category strings into 8 buckets
  3. Ordinal encoding with low=1, medium=2, high=3 Correct answer.
  4. Replacing each category with its string length

Explanation

Ordinal encoding assigns integers that reflect the natural order, allowing the model to use the ranking information. One-hot encoding discards order, and hashing or string length produces arbitrary values.

Question 37Data Preparation and Feature Engineering

A column contains the number of children per household, with values 0, 1, 2, 3, and 4. Which data type best describes this feature?

  1. Ordinal categorical
  2. Discrete numeric Correct answer.
  3. Nominal categorical
  4. Continuous numeric

Explanation

Counts take distinct whole-number values and are numeric, so they are discrete numeric features. They are not continuous, and they are not nominal or ordinal categories.

Question 38Data Preparation and Feature Engineering

A feature has values with mean 50 and standard deviation 10. A modeler applies z-score standardization. What are the mean and standard deviation of the transformed feature?

  1. Mean 50 and standard deviation 1
  2. Mean 0 and standard deviation 1 Correct answer.
  3. Mean 1 and standard deviation 0
  4. Mean 0 and standard deviation 10

Explanation

Z-score standardization subtracts the mean and divides by the standard deviation, producing a distribution with mean zero and unit standard deviation.

Question 39Data Preparation and Feature Engineering

A modeler fits a standardization transform using the mean and standard deviation of the entire dataset, then splits into train and test. Why is this a problem?

  1. Standardization cannot be applied to datasets above a certain size
  2. The transform will produce negative values in the training set
  3. Information from the test set leaks into the transform applied to the training data Correct answer.
  4. The test set will have a larger mean than the training set

Explanation

Computing statistics on the full dataset lets test-set information influence the transformation, which is a form of data leakage and inflates optimistic performance estimates. The statistics should be learned on the training set and applied to the test set.

Question 40Data Preparation and Feature Engineering

A categorical feature has 500 distinct values in a dataset of 2,000 rows. Which approach most directly avoids the high dimensionality of full one-hot encoding?

  1. Grouping rare categories into an 'other' bucket before encoding Correct answer.
  2. Replacing each category with a random integer
  3. Applying a log transform to the category labels
  4. Dropping the feature entirely

Explanation

Collapsing infrequent categories into a single bucket reduces the number of indicator columns while retaining the frequent categories. Dropping the feature or assigning arbitrary integers discards or distorts information.

Question 41Data Preparation and Feature Engineering

A dataset has a numeric feature with missing values. Which imputation strategy replaces missing entries with the most frequent observed value?

  1. Mode imputation Correct answer.
  2. Mean imputation
  3. Linear interpolation
  4. Median imputation

Explanation

Mode imputation fills missing entries with the most frequently occurring value, which is appropriate for categorical or discrete data. Mean and median imputation use averages or middle values, and interpolation uses neighboring points.

Question 42Data Preparation and Feature Engineering

A modeler creates a new feature equal to the ratio of 'debt' to 'income'. Which term best describes this type of feature construction?

  1. Derived feature creation Correct answer.
  2. Imputation
  3. Discretization
  4. One-hot encoding

Explanation

Combining existing columns arithmetically to form a new column is derived feature creation. It differs from encoding, imputation, and binning, which transform rather than combine variables.

Question 43Data Preparation and Feature Engineering

A continuous feature is binned into quartiles, and each bin is replaced by its bin index. Which effect does this have?

  1. It reduces resolution and can lose information within bins Correct answer.
  2. It converts the feature into a unique identifier
  3. It removes the need for any scaling of other features
  4. It guarantees a linear relationship with the target

Explanation

Discretization collapses ranges of values into a few bins, which discards variation within each bin. It can capture nonlinearity but does not guarantee linearity or replace scaling.

Question 44Data Preparation and Feature Engineering

A modeler wants to detect duplicate records that may differ slightly in spelling of names and formatting of addresses. Which technique is most appropriate?

  1. Fuzzy string matching on normalized fields Correct answer.
  2. Exact hash comparison of raw rows
  3. One-hot encoding the address column
  4. Dropping all rows with any text field

Explanation

Fuzzy matching compares strings by similarity so that near-duplicates with minor spelling or formatting differences can be identified. Exact hashing only catches identical rows, and encoding does not detect duplicates.

Question 45Data Preparation and Feature Engineering

A feature's values are compressed using the transform x' = log(1 + x) for non-negative x. Why is the '+1' included?

  1. To reverse the effect of standardization
  2. To ensure the output is always an integer
  3. To make the output distribution normal
  4. To keep the transform defined when x equals zero Correct answer.

Explanation

The logarithm of zero is undefined, so adding one shifts the input so that zero maps to zero. The transform reduces skew but does not guarantee normality or integer outputs.

Question 46Data Preparation and Feature Engineering

A dataset contains timestamps of customer transactions. Which derived feature is most useful for capturing weekly purchasing patterns?

  1. Day of week extracted from the timestamp Correct answer.
  2. Number of characters in the timestamp string
  3. The transaction amount divided by the timestamp
  4. Raw Unix timestamp in seconds

Explanation

Extracting the day of week exposes the cyclical weekly pattern directly to the model. The raw timestamp encodes absolute time, and string length or dividing by time yields meaningless values.

Question 47Data Preparation and Feature Engineering

A modeler trains on data from January to June and tests on July. A feature 'days since account opened' is computed relative to the date the dataset was assembled. What is the main concern?

  1. The feature violates the assumption of independent features
  2. The feature will have too many missing values
  3. The feature encodes information from after the test period, causing temporal leakage Correct answer.
  4. The feature will be perfectly correlated with the target

Explanation

Computing elapsed time relative to a later assembly date uses future information, so test-period rows carry knowledge unavailable at prediction time. Features should be computed using only information available at each prediction point.

Question 48Data Preparation and Feature Engineering

A categorical feature has categories that appear only in the test set and never in the training set. A one-hot encoder fit on training data is applied to the test set. What should the encoder do with unseen categories?

  1. Raise an error and halt prediction
  2. Assign them the index of the most frequent training category
  3. Silently drop those test rows
  4. Map them to an all-zero indicator vector or a dedicated unknown bucket Correct answer.

Explanation

An encoder fit on training data has no column for unseen categories, so they must be mapped to a defined fallback such as all zeros or an unknown bucket. Reusing a frequent category's index would misrepresent the record.

Question 49Data Preparation and Feature Engineering

A feature has a small number of extreme outliers. A modeler compares min-max scaling and robust scaling using the median and interquartile range. Which statement is accurate?

  1. Min-max scaling is less distorted because it uses the full range
  2. Robust scaling is less distorted by the outliers than min-max scaling Correct answer.
  3. Neither method can be applied to data containing outliers
  4. Both methods produce identical outputs regardless of outliers

Explanation

Min-max scaling depends on the minimum and maximum, which outliers shift dramatically. Robust scaling uses the median and interquartile range, which are resistant to extreme values.

Question 50Data Preparation and Feature Engineering

Two numeric features are highly collinear. A modeler replaces them with a single new feature that is their sum. Which term best describes this dimensionality reduction approach?

  1. Imputation
  2. Discretization
  3. One-hot encoding
  4. Feature aggregation Correct answer.

Explanation

Combining correlated features into a summary variable is a form of feature aggregation that reduces dimensionality. Imputation handles missing values, encoding handles categories, and discretization bins values.