What is the difference between a row vector and a column vector, and why does the distinction matter?

Quick Overview

Asks how a row vector differs from a column vector and why the orientation matters. Tests understanding of matrix dimensions, inner and outer products, the column-vector convention in machine learning and shape bugs in NumPy.

What is the difference between a row vector and a column vector, and why does the distinction matter?

Role: Data Scientist

Category: Statistics & Math

Difficulty: easy

Interview Round: Other

What is the difference between a row vector and a column vector, and why does the distinction matter? ```hint Track the shapes Write down the shapes of both operands for a product in each order, then check which dimensions must agree and what shape comes out. ``` ### What a Strong Answer Covers - The shapes of row and column vectors and how transposition relates them - How orientation decides whether a product is defined and what shape it produces - The usual convention in math and ML, and expressions that depend on it - How array libraries represent vectors and the bugs that come from mismatched shapes ### Follow-up Questions - In NumPy, what do `A @ v` and `v @ A` return when `v` is a 1D array, and why? - What is the rank of the outer product of two nonzero vectors? - Your data matrix stores one sample per row. How do you write a linear model's predictions, and what shape is the weight vector? - Why does `y - y_pred` sometimes return an n-by-n array, and how would you guard against it?

Overview: Asks how a row vector differs from a column vector and why the orientation matters. Tests understanding of matrix dimensions, inner and outer products, the column-vector convention in machine learning and shape bugs in NumPy.

General logo
General
Nov 24, 2026
easyData ScientistOtherStatistics & Math
0
0

What is the difference between a row vector and a column vector, and why does the distinction matter?

What a Strong Answer Covers Guidance

  • The shapes of row and column vectors and how transposition relates them
  • How orientation decides whether a product is defined and what shape it produces
  • The usual convention in math and ML, and expressions that depend on it
  • How array libraries represent vectors and the bugs that come from mismatched shapes

Follow-up Questions Guidance

  • In NumPy, what do A @ v and v @ A return when v is a 1D array, and why?
  • What is the rank of the outer product of two nonzero vectors?
  • Your data matrix stores one sample per row. How do you write a linear model's predictions, and what shape is the weight vector?
  • Why does y - y_pred sometimes return an n-by-n array, and how would you guard against it?