Linear Algebra interview question

Probability & MathLinear Algebrabasic

What is the dot product of the vectors [1, 2, 3] and [4, 5, 6]?

  1. A[4, 10, 18], because the dot product multiplies matching entries and returns them as a new vector.
  2. B21, because the dot product adds up every entry of both vectors: 1 + 2 + 3 + 4 + 5 + 6.
  3. C32, because the dot product multiplies matching entries and then sums them: 4 + 10 + 18.
  4. D90, because the dot product multiplies the two entry sums together: (1 + 2 + 3)·(4 + 5 + 6).
Show the answer and explanation

Correct answer: C, 32, because the dot product multiplies matching entries and then sums them: 4 + 10 + 18.

Explanation Linear Algebra

The dot product of two vectors of equal length is the sum of the products of matching entries: a·b = Σ aᵢbᵢ. Here 1·4 + 2·5 + 3·6 = 4 + 10 + 18 = 32. The result is a single number (a scalar), not a vector.

Why the other answers are wrong:

  • [4, 10, 18] is the element-wise (Hadamard) product; the dot product goes one step further and sums those terms.
  • Adding all six entries (21) or multiplying the two entry sums (90) ignores the pairing of entries by position, which is the whole point of the operation.

Geometrically, a·b = ‖a‖‖b‖cos θ, so the sign tells you whether the angle between the vectors is acute (positive), a right angle (zero) or obtuse (negative).

Interview tip: mention that the dot product is the building block of matrix multiplication, of linear models (wᵀx) and of attention scores (q·k).

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. In the gradient descent update θ ← θ − η∇L(θ), what is the role of the learning rate η?
  2. 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…
  3. 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…
  4. How many times is an SVC model fitted in total when this grid search runs?
  5. 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…