SchoolWhool
Quizzes and saved progress, freeSign in freeSign in
Maths · Module 3Module material

Matrices and linear algebra interview questions

15 questions interviewers ask on matrices, from first principles to the follow-ups. The first 3 model answers are free to read; Pro opens the rest.

  1. Give two ways to read a matrix–vector product.

    Row by row, each row dotted with the vector, one output per row; and column by column, a linear combination of the columns with the vector's entries as the amounts. For [[2, 1], [0, 3], [4, 2]] and (3, −1), both give (5, −3, 10). The column view is what makes "the columns are where the basis vectors land" work.

  2. What is the shape rule for A @ B?

    (m, k) @ (k, n) → (m, n): the inner sizes must match and the outer ones remain. A weight vector needs one entry per column, per feature, not per row.

  3. What does a 2 × 2 matrix do to the plane, and how do you read it?

    It is a linear transformation: grid lines stay straight, parallel and evenly spaced, and the origin stays put. Its first column is where e₁ lands and its second where e₂ lands, so rotations, stretches, shears and projections can be read straight off the columns.

  4. What does the determinant measure?
  5. Why is AB not BA, and which acts first?
  6. What is (AB)⁻¹?
  7. How do you tell whether a matrix is close to singular?
  8. You add a temperature column in Fahrenheit to data that already has Celsius. What happens to linear regression?
  9. Derive the normal equations.
  10. Why do libraries not solve linear regression with inv(X.T @ X)?
  11. What is an eigenvector, and when are a matrix's eigenvectors perpendicular?
  12. Why is gradient descent slow on unscaled features?
  13. What is the SVD, and how is it related to the eigendecomposition?
  14. How does PCA relate to the SVD and the covariance matrix?
  15. What is the difference between np.cov(X) and np.cov(X, rowvar=False, bias=True)?