Linear Algebra interview question

Probability & MathLinear AlgebraComputer Visionmedium

An image-augmentation step applies a 2 × 2 linear map M to pixel coordinates. The plot shows the unit square (dashed) and its image under M (solid), with the images of (1, 0) and (0, 1) labelled. What is det(M), and what does it say about the transformation?

0123-0.500.511.522.533.5x₁x₂M·(1, 0)M·(0, 1)Unit squareImage under M
  1. Adet(M) = 3: the image parallelogram has area 3, and a determinant measures area, so it is positive for any map that does not collapse the square
  2. Bdet(M) = 0: the images (1, 2) and (2, 1) mirror each other, so the columns of M are linearly dependent and the map collapses the plane onto a line
  3. Cdet(M) = −3: areas are scaled by 3 and orientation flips (the images of the two axes swap their order), and the map is invertible because det ≠ 0
  4. Ddet(M) = −3: areas are scaled by 3 and orientation flips, so the map is not invertible, because a negative determinant sends some directions to zero
Show the answer and explanation

Correct answer: C, det(M) = −3: areas are scaled by 3 and orientation flips (the images of the two axes swap their order), and the map is invertible because det ≠ 0

Explanation Linear Algebra

The columns of a matrix are the images of the basis vectors. Reading the plot, M·(1, 0) = (1, 2) and M·(0, 1) = (2, 1), so M = [[1, 2], [2, 1]] and det(M) = 1·1 − 2·2 = −3.

What the determinant says about a linear map:

  • |det| is the area scale factor: the unit square (area 1) becomes a parallelogram of area 3.
  • The sign is orientation. Walking the square anticlockwise, (0, 0) → (1, 0) → (1, 1) → (0, 1), the image is walked clockwise, (0, 0) → (1, 2) → (3, 3) → (2, 1). A negative determinant means a reflection is involved, so the augmented image is mirrored.
  • det = 0 means the columns are dependent and the plane collapses onto a line or a point, so the map cannot be undone.

Here det ≠ 0, so M is invertible; its eigenvalues are 3 and −1, whose product is −3.

Why the others are wrong: the parallelogram's area is |det|, but the determinant itself is signed, so 3 drops the orientation flip. The vectors (1, 2) and (2, 1) mirror each other but are not multiples of each other, so they are independent; a dependent pair would be (1, 2) and (2, 4). Invertibility depends only on det ≠ 0, not on the sign: a horizontal flip diag(−1, 1) has det −1 and is its own inverse.

Interview tip: link this to ML: the change-of-variables formula in normalizing flows rescales densities by 1/|det J| of the Jacobian, exactly this area-scaling idea.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Probability & Math questions

  1. The table shows a telecom operator's customer mix and the average monthly revenue per user (ARPU) in each segment. What is the expected monthly revenue of a…
  2. How many times is an SVC model fitted in total when this grid search runs?
  3. An LLM routing service samples one of three candidate reply types from logits with the snippet below, at temperature T = 0.5. Up to simulation noise, what…
  4. A labelling vendor's error rate is either 2% (prior 0.7) or 10% (prior 0.3). You audit two batches of 10 independent labels: the first has 1 error, the second…
  5. A bank fine-tunes a multilingual support assistant on a corpus that is 90% English and 10% Turkish by tokens. Following common multilingual practice, it…