What is the dot product of the vectors [1, 2, 3] and [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).