What is the computational cost or complexity of core matrix operations like multiplication?

Quick Overview

Asks for the time complexity of matrix multiplication and other core matrix operations such as addition, matrix-vector products and inversion. It tests operation counting for general matrix shapes, awareness of sub-cubic algorithms like Strassen's, and why cache-aware libraries beat naive loops.

What is the computational cost or complexity of core matrix operations like multiplication?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

What is the computational cost or complexity of core matrix operations like multiplication? Give the cost of multiplying matrices of general shape, not only square ones, and compare it with other common matrix operations. ```hint Count per output entry Work out how much work one entry of the product needs, then multiply by the number of entries in the result. ``` ### What a Strong Answer Covers - The cost of multiplying an m×n matrix by an n×p matrix and where it comes from - The cost of cheaper operations such as addition and matrix-vector products - The cost of other common dense operations, such as inversion and solving a linear system - Sub-cubic multiplication algorithms and why they see limited use - Why measured speed depends on memory access and optimized libraries ### Follow-up Questions - You need $ABx$ for two n×n matrices and a vector. In which order would you evaluate it, and why? - How does the cost of a matrix-vector product change when the matrix is sparse? - Why is computing an explicit inverse to solve $Ax = b$ usually a mistake? - Why can a naive triple loop be far slower than a BLAS call that does the same number of operations?

Overview: Asks for the time complexity of matrix multiplication and other core matrix operations such as addition, matrix-vector products and inversion. It tests operation counting for general matrix shapes, awareness of sub-cubic algorithms like Strassen's, and why cache-aware libraries beat naive loops.

Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

What is the computational cost or complexity of core matrix operations like multiplication?

Give the cost of multiplying matrices of general shape, not only square ones, and compare it with other common matrix operations.

What a Strong Answer Covers Guidance

  • The cost of multiplying an m×n matrix by an n×p matrix and where it comes from
  • The cost of cheaper operations such as addition and matrix-vector products
  • The cost of other common dense operations, such as inversion and solving a linear system
  • Sub-cubic multiplication algorithms and why they see limited use
  • Why measured speed depends on memory access and optimized libraries

Follow-up Questions Guidance

  • You need ABxABx for two n×n matrices and a vector. In which order would you evaluate it, and why?
  • How does the cost of a matrix-vector product change when the matrix is sparse?
  • Why is computing an explicit inverse to solve Ax=bAx = b usually a mistake?
  • Why can a naive triple loop be far slower than a BLAS call that does the same number of operations?