Linear algebra interview questions test whether you can reason about data as vectors, matrices, and transformations—not whether you can recite formulas. A strong answer connects four layers: the formal definition, geometric intuition, an edge case, and the computational consequences.
This guide contains 32 questions with detailed solutions covering matrix operations, linear systems, eigenvalues, decompositions, quadratic forms, PCA, regression, and numerical stability. The examples are useful for data science, machine learning, quantitative research, research science, and data engineering interviews.
Linear Algebra Interview Questions
Top Linear Algebra interview questions covering the key areas tested at leading tech companies. Practice with real questions and detailed solutions.
What linear algebra topics are tested in interviews?
Most interviews concentrate on six connected areas: vector spaces and rank; solving linear systems; eigenvalues and eigenvectors; matrix decompositions; linear transformations and quadratic forms; and applications such as least squares, PCA, covariance estimation, and embeddings. Interviewers often begin with a definition and then change an assumption—making a matrix singular, rectangular, noisy, or poorly conditioned—to see whether your reasoning survives the edge case.
Linear algebra topics by role
| Role | Highest-priority topics | Typical follow-up |
|---|---|---|
| Data scientist | Least squares, covariance, PCA, rank, projections | Interpret the result and identify leakage or instability |
| Machine learning engineer | SVD, embeddings, matrix shapes, numerical stability | Discuss complexity, memory, and production trade-offs |
| Quantitative researcher | Eigenvalues, covariance matrices, quadratic forms, conditioning | Reason about risk, estimation error, and degenerate cases |
| Research scientist or PhD | Vector spaces, proofs, spectral theory, optimization | State assumptions and construct a counterexample |
| Data engineer | Sparse matrices, decompositions, dimensionality, computation | Choose an algorithm under scale constraints |
How should you answer a linear algebra interview question?
- Define the object precisely. State dimensions and assumptions such as symmetry, rank, or positive definiteness.
- Give the geometric interpretation. Explain what happens to directions, subspaces, lengths, or variance.
- Test an edge case. Consider zero eigenvalues, repeated eigenvalues, rank deficiency, or nearly collinear columns.
- Choose the computation. Explain why you would use QR, SVD, Cholesky, or an iterative method instead of explicitly forming an inverse.
- Check the result. Verify dimensions, orthogonality, residuals, reconstruction error, and numerical sensitivity.
Vectors, matrices, rank, and null spaces
The central idea is that a matrix maps one vector space into another. Rank measures the dimension of the image, while the null space contains directions the transformation sends to zero. Rank-nullity, orthogonality, projections, and matrix multiplication are the foundations for nearly every later question.
Expect to explain why matrix multiplication is not commutative, construct a rank-deficient example, compute a projection, or infer how the column space of one matrix must relate to the null space of another. Say the dimensions out loud before multiplying: this catches many interview mistakes immediately.
Vectors, Matrices & Core Operations
Before anything else, interviewers will probe whether you truly understand the mechanics of vector spaces, matrix multiplication, rank, and null spaces. You might be surprised how often candidates stumble when asked to explain why matrix multiplication is not commutative or to compute a projection by hand under time pressure.
Given two 3x3 matrices A and B where AB = 0 but neither A nor B is the zero matrix, what can you conclude about the rank and null space of A and B? Construct a concrete example.
Sample Answer
Most candidates default to assuming AB = 0 implies A = 0 or B = 0, but that fails here because matrices are not an integral domain. The key insight is that the columns of $B$ must lie in the null space of $A$, so $\text{rank}(A) < 3$ and $\text{nullity}(A) \geq \text{rank}(B)$. A concrete example: let $A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}$ and $B = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$. Here $\text{rank}(A) = 1$, $\text{nullity}(A) = 2$, and the two nonzero columns of $B$ span a subspace of $\text{null}(A)$, which confirms the relationship $\text{rank}(B) \leq \text{nullity}(A)$.
You have a vector $v = (3, 4)$ and you want to project it onto the vector $u = (1, 2)$. Compute the projection and the residual, and explain what geometric property the residual satisfies.
An interviewer gives you a 4x3 matrix and asks you to determine its rank. You can either row reduce it or compute the determinants of all 3x3 submatrices. Which approach do you choose under time pressure, and why? Suppose the matrix has entries that are small integers.
Suppose $A$ is a 5x5 matrix with rank 3. Without computing anything explicitly, determine the dimension of the null space of $A$, the dimension of the column space of $A^T$, and whether $Ax = b$ is guaranteed to have a solution for every $b \in \mathbb{R}^5$.
You are given two square matrices $A$ and $B$ of the same size. Your interviewer claims that $\text{rank}(AB) \leq \min(\text{rank}(A), \text{rank}(B))$. They then ask: can you construct a case where the inequality is strict, and explain intuitively why rank can be lost through multiplication?
Consider the matrix $M = I - 2uu^T$ where $u$ is a unit vector in $\mathbb{R}^n$. Compute $M^2$, determine whether $M$ is invertible, and describe geometrically what $M$ does to an arbitrary vector.
Systems of linear equations and matrix inverses
A linear system can have one solution, no solution, or infinitely many solutions. The deciding factors are rank and whether the target vector lies in the column space. In practical interviews, numerical conditioning matters as much as mathematical existence.
A small residual does not guarantee an accurate solution when the matrix is ill-conditioned. Avoid saying “compute the inverse” by default: factorization followed by triangular solves is usually faster and more stable. Use a pseudoinverse or regularization when the system is rank-deficient or underdetermined.
Systems of Linear Equations & Matrix Inverses
Firms like Jane Street and Citadel love asking you to solve or reason about linear systems, especially when the system is underdetermined or ill-conditioned. This section tests your ability to connect concepts like invertibility, determinants, and conditioning to practical scenarios where numerical stability matters.
You have a linear system $Ax = b$ where $A$ is a 100x100 matrix with a condition number of $10^{15}$. Your colleague says the solution looks fine because the residual $\|Ax - b\|$ is small. Why should you be skeptical?
Sample Answer
A small residual does not guarantee an accurate solution when the matrix is ill-conditioned. The relative error in $x$ can be amplified by the condition number: $\frac{\|\delta x\|}{\|x\|} \leq \kappa(A) \frac{\|\delta b\|}{\|b\|}$, so with $\kappa(A) \approx 10^{15}$, even rounding errors at machine epsilon ($\approx 10^{-16}$) can produce a solution with no correct digits. You should check the forward error directly or use a more stable formulation, such as regularization or iterative refinement, rather than trusting the residual alone.
You are calibrating a factor model and need to solve $Ax = b$ where $A$ is $n \times n$. Under what circumstances would you prefer computing $A^{-1}$ explicitly versus using LU decomposition to solve the system, and why?
Suppose you are fitting a linear regression with 500 features but only 200 observations, giving you the system $X\beta = y$ where $X$ is $200 \times 500$. An interviewer asks: does this system have a unique solution, and how would you pick one?
You are debugging a pricing engine and discover that a matrix $A$ used in a linear solve has a determinant very close to zero but not exactly zero. The system still returns an answer. How do you explain to a junior quant why this answer might be unreliable, and what metric would you use to quantify the risk?
A portfolio optimization routine requires solving $Ax = b$ where $A$ is a covariance matrix estimated from market data. You notice that after a market regime change, the smallest eigenvalue of $A$ drops by a factor of $10^6$. Walk the interviewer through what happens to the solution and what you would do about it.
Eigenvalues and eigenvectors
An eigenvector is a direction a linear transformation does not rotate away from itself, and its eigenvalue gives the scaling along that direction. For symmetric matrices, the eigenvectors can be chosen orthonormally and the eigenvalues are real. That fact powers PCA, covariance analysis, quadratic optimization, and stability tests.
Be ready to interpret zero, negative, repeated, or complex eigenvalues. A zero eigenvalue implies singularity; negative eigenvalues make a symmetric quadratic form indefinite; and eigenvalues near zero often signal sensitivity to noise. For iterative systems, the spectral radius determines whether repeated application grows, decays, or oscillates.
Eigenvalues & Eigenvectors
Understanding eigenvalues and eigenvectors is non-negotiable for quant roles, yet many candidates can only recite definitions without applying them. You will face questions that require you to interpret eigenvalues in the context of covariance matrices, stability analysis, or Markov chains, so be ready to go well beyond textbook computation.
You have a 2x2 covariance matrix of daily returns for two correlated assets. Without computing anything, what do the eigenvalues tell you about the portfolio, and what happens to the smaller eigenvalue as the correlation approaches 1?
Sample Answer
You could interpret the eigenvalues as variances along the principal axes or think of them as scaling factors of the matrix. The first interpretation wins here because it directly maps to portfolio risk: the eigenvalues of a covariance matrix give you the variance of returns along each eigenvector (principal component) direction. The larger eigenvalue captures the dominant risk factor, while the smaller one captures the residual independent risk. As correlation approaches 1, the two assets become linearly dependent, the matrix approaches rank 1, and the smaller eigenvalue approaches 0, meaning nearly all portfolio variance is explained by a single factor.
A Markov chain has transition matrix $P$ with a unique stationary distribution. An analyst claims that because all eigenvalues of $P$ satisfy $|\lambda| \leq 1$, the chain must converge to its stationary distribution from any starting state. Is this claim correct, and if not, what additional condition is needed?
You are performing PCA on a dataset of 500 stock returns over 250 trading days. Your covariance matrix is 500x500 but you only have 250 observations. How does this rank deficiency affect the eigenvalue decomposition, and how would you handle it in practice?
Suppose you are analyzing the stability of a linear dynamical system $x_{t+1} = Ax_t$ that models the evolution of portfolio exposures. The matrix $A$ has eigenvalues $0.95$, $0.8 + 0.3i$, and $0.8 - 0.3i$. Does the system converge, and which eigenvalue governs the rate of convergence?
You are given a real symmetric matrix $A$ and told that its eigenvalues are all non-negative but one of them is very close to zero. A trader asks you to compute $A^{-1}b$ for a specific vector $b$. Walk me through the numerical risks and how you would use the eigendecomposition to address them.
Matrix decompositions: LU, QR, Cholesky, and SVD
The best decomposition depends on the matrix structure and the operation you need next. LU is useful for repeated solves with a general square matrix. Cholesky is efficient for symmetric positive-definite matrices. QR is a stable choice for full-rank least squares. SVD is the most informative and robust option for rectangular or rank-deficient matrices, though it costs more.
Interviewers care less about memorizing factorization notation than about choosing correctly. State the matrix assumptions, compare computational cost, and explain what fails when those assumptions are violated.
Matrix Decompositions
Interviewers at Two Sigma, DE Shaw, and similar firms frequently test whether you can distinguish between SVD, Cholesky, QR, and LU decompositions and know when each one is appropriate. You need to articulate not just the factorizations themselves but also their computational costs, numerical properties, and real-world use cases in portfolio optimization or regression.
You have a covariance matrix of asset returns and need to simulate correlated random samples for a Monte Carlo risk engine. Which decomposition do you use, and what happens if the covariance matrix is only positive semi-definite rather than positive definite?
Sample Answer
Reason through it: You need a matrix $L$ such that $\Sigma = LL^T$, so you can generate correlated samples as $L z$ where $z \sim N(0, I)$. The natural choice is Cholesky decomposition because it is $O(n^3/3)$, roughly half the cost of a general LU, and it directly exploits the symmetry and positive definiteness of $\Sigma$. Now, if $\Sigma$ is only positive semi-definite, Cholesky will fail because you will encounter a zero or negative value under the square root during factorization. In that case, you fall back to the eigendecomposition $\Sigma = Q \Lambda Q^T$, zero out or clamp tiny negative eigenvalues, and form $L = Q \Lambda^{1/2}$. This is a common practical issue when your number of assets exceeds your number of return observations.
In a large-scale linear regression with more features than observations, an interviewer asks you to solve the least squares problem. Why would you choose SVD over QR here, and what is the computational trade-off?
You are building a real-time pricing engine that must solve the same linear system $Ax = b$ thousands of times per second with different right-hand sides $b$ but the same matrix $A$. Walk me through which decomposition you would precompute and why.
Suppose you are performing PCA on a large matrix of daily returns for 5000 stocks over 250 trading days. An interviewer asks: should you compute the eigendecomposition of the covariance matrix or use SVD directly on the returns matrix? Justify your answer with computational complexity.
Explain the relationship between QR decomposition and Gram-Schmidt orthogonalization. When would numerical instability in classical Gram-Schmidt matter in a quantitative finance context?
Linear transformations and quadratic forms
Linear transformations reshape space while preserving addition and scalar multiplication. Projections, rotations, reflections, and changes of basis are common geometric examples. Singular values describe how much the transformation stretches each orthogonal direction.
For a symmetric matrix, the quadratic form xᵀAx is positive definite exactly when every eigenvalue is positive. This connects geometry to convex optimization: a positive-definite Hessian gives local curvature in every nonzero direction, while a negative eigenvalue identifies a descent direction.
Linear Transformations & Quadratic Forms
This section challenges you to think geometrically about what matrices do to spaces: rotations, reflections, projections, and changes of basis. Candidates often struggle here because quant interviews expect you to connect abstract transformation properties to concrete problems like positive definiteness checks in risk models or orthogonal projections in least squares estimation.
You have a covariance matrix for a portfolio of 500 assets, and after a data update one eigenvalue comes back slightly negative. Your PM asks if the matrix is still usable for mean-variance optimization. What do you tell them, and how do you fix it?
Sample Answer
This question is checking whether you can connect positive definiteness to the practical requirement that portfolio variance $\mathbf{w}^T \Sigma \mathbf{w} > 0$ for all nonzero weight vectors. A negative eigenvalue means the quadratic form can go negative, so your optimizer could produce a portfolio with 'negative variance,' which is nonsensical and will blow up your risk estimates. The standard fix is spectral clipping: decompose $\Sigma = Q \Lambda Q^T$, replace any negative eigenvalues in $\Lambda$ with a small positive floor (or zero), and reconstruct. You should mention that this is equivalent to projecting onto the cone of positive semidefinite matrices in the Frobenius norm, and note the tradeoff that aggressive clipping distorts correlations.
Suppose you apply a linear transformation $T$ to $\mathbb{R}^3$ that projects every vector onto a plane, then rotates within that plane by 45 degrees. Is $T$ diagonalizable over the reals? What are its eigenvalues?
You are building a least squares regression model for intraday returns. A colleague suggests using the normal equations directly instead of QR decomposition. Under what conditions does this become numerically dangerous, and why does the geometry of the projection matter here?
Given a symmetric matrix $A$ with a known eigendecomposition, how would you efficiently determine whether the quadratic form $\mathbf{x}^T A \mathbf{x} \geq 0$ holds for all $\mathbf{x}$ restricted to a specific subspace $S$? Walk through your approach.
A matrix $M$ represents a linear transformation in $\mathbb{R}^2$ that sends the unit circle to an ellipse with semi-axes of length 3 and 1. What are the singular values of $M$, and what can you say about $\det(M)$?
Applications in machine learning, data science, and quantitative research
Applied questions ask you to diagnose a modeling problem using linear algebra. In PCA, principal directions maximize projected variance. In least squares, the fitted vector is the projection of the target onto the design matrix's column space. In embeddings and recommenders, a low-rank factorization compresses structure into a smaller latent space.
Always discuss estimation and stability. Near-collinear features make coefficients sensitive; a poorly conditioned covariance matrix amplifies noise; and a low-rank approximation can discard signal if its rank is chosen only from an in-sample variance threshold. Explain how you would validate the choice out of sample.
Applications in Finance & Machine Learning
Knowing the theory is only half the battle: top firms want to see you apply linear algebra to PCA for dimensionality reduction, factor models, mean-variance optimization, and regression diagnostics. You should be prepared to walk through how spectral properties of a covariance matrix drive portfolio construction or how low-rank approximations improve signal extraction from noisy financial data.
You have a covariance matrix estimated from 500 daily returns of 200 assets. Walk me through how you would use PCA to build a factor model, and explain why the raw eigenvalues might mislead you here.
Sample Answer
The standard move is to eigendecompose the sample covariance matrix $\hat{\Sigma}$ and retain the top $k$ eigenvectors as factor loadings, choosing $k$ where the eigenvalue scree flattens. But here, the fact that $T=500 < N=200$ is not the issue since $T > N$, yet the ratio $T/N = 2.5$ is still small enough that Marcenko-Pastur theory tells you the bulk of your eigenvalues are inflated by noise. You should compare your empirical eigenvalue distribution against the Marcenko-Pastur bound $\lambda_{+} = \sigma^2(1 + \sqrt{N/T})^2$ and only trust eigenvalues that exceed it. In practice this means you might keep 5 to 15 factors instead of the 50 that naive variance-explained thresholds would suggest, and you should consider shrinkage estimators like Ledoit-Wolf to regularize the covariance before downstream portfolio construction.
Suppose you are running mean-variance optimization and your portfolio weights come back with enormous long and short positions. Your PM asks you to diagnose the problem using properties of the covariance matrix. What do you tell them?
A colleague proposes using the first two principal components of a large equity return matrix as features in a regression to predict next-day returns. Another colleague suggests using the last two principal components instead, arguing they capture alpha signals hidden in the noise. Who is right, and how would you evaluate the tradeoff?
You are building a statistical arbitrage strategy and want to use a low-rank approximation of the return matrix to separate systematic factors from idiosyncratic residuals. How do you choose the rank $k$, and how does this choice affect your trading signals?
In a multi-factor risk model, you estimate factor returns via cross-sectional regression $r_t = B f_t + \epsilon_t$ each day. Your factor loading matrix $B$ has near-multicollinearity between two style factors. Explain how this manifests in the linear algebra and what it does to your risk decomposition.
You are given a matrix of 50 features for 10,000 observations and asked to detect outliers before feeding data into a trading model. How would you use the Mahalanobis distance, and what role does the eigendecomposition of the covariance matrix play in making this computation robust?
How to refresh linear algebra for an interview
Seven-day linear algebra interview plan
- Day 1: vectors, dot products, norms, bases, span, and independence.
- Day 2: matrix multiplication, rank, null spaces, and projections.
- Day 3: linear systems, invertibility, determinants, and conditioning.
- Day 4: eigenvalues, eigenvectors, diagonalization, and spectral intuition.
- Day 5: LU, QR, Cholesky, SVD, and pseudoinverses.
- Day 6: least squares, PCA, covariance matrices, and quadratic forms.
- Day 7: solve a mixed mock interview aloud and review every missed assumption.
Two-week plan for deeper or PhD-level interviews
Use the first week for the sequence above. In the second week, add proofs and counterexamples, matrix calculus, constrained optimization, randomized or sparse methods, and implementation exercises. Revisit each problem under a changed assumption: rectangular instead of square, semidefinite instead of definite, noisy instead of exact, or high-dimensional instead of small.
Practice checklist
- Draw a 2D or 3D picture before doing algebra.
- Construct a small numerical example for every theorem you use.
- Track matrix dimensions through every expression.
- Explain numerical stability and algorithmic complexity.
- Practice without executing code, then verify with code afterward.
Continue with the interview question catalog, use coding practice for implementation drills, or follow a structured path in DataInterview courses. To keep an offline copy, use your browser's Print command and choose “Save as PDF.”
Test your linear algebra interview readiness
Use the quiz after completing the questions once. For every missed item, write a one-sentence definition, one geometric explanation, and one edge case before retrying.
How Ready Are You for Linear Algebra Interviews?
1 / 6An interviewer asks: 'Two feature vectors have a cosine similarity of zero. What does this tell you about the vectors?' How do you respond?
Linear algebra interview questions FAQ
Frequently Asked Questions
How deep does my linear algebra knowledge need to be for a Quantitative Researcher interview?
You should be comfortable well beyond introductory coursework. Expect questions on eigendecomposition, singular value decomposition, positive definiteness, matrix calculus, and numerical stability. Firms often probe your intuition around why certain decompositions matter in practice, such as how PCA relates to the spectral theorem or why condition numbers affect regression results.
Which companies ask the most linear algebra questions for Quantitative Researcher roles?
Top quantitative trading firms like Jane Street, Two Sigma, Citadel, DE Shaw, and Jump Trading are well known for asking rigorous linear algebra questions. Renaissance Technologies and Hudson River Trading also emphasize mathematical fundamentals heavily. Even large banks with quantitative research desks will test core linear algebra, though typically with less depth than dedicated quant firms.
Will I need to code linear algebra solutions during the interview, or is it purely theoretical?
Many Quantitative Researcher interviews blend theory with implementation. You may be asked to code a matrix decomposition, implement least squares from scratch, or debug a numerical routine in Python or C++. Practicing both pen-and-paper derivations and coding implementations will prepare you for either format. You can sharpen your coding skills with problems at datainterview.com/coding.
How do linear algebra interview questions differ across Quantitative Researcher sub-roles?
For alpha research roles, expect questions tied to dimensionality reduction, covariance estimation, and factor models. For roles closer to statistical modeling or machine learning, you will see more emphasis on kernel methods, matrix calculus, and optimization. Execution-focused quant roles may lean toward numerical linear algebra topics like sparse solvers and iterative methods.
How should I prepare for linear algebra interviews if I lack real-world quantitative research experience?
Start by deeply reviewing a rigorous textbook such as Strang's 'Linear Algebra and Its Applications' or Axler's 'Linear Algebra Done Right,' then connect each concept to practical applications like portfolio optimization or PCA. Work through applied problems that simulate real scenarios, and practice explaining your reasoning out loud. You can find targeted interview questions at datainterview.com/questions to bridge the gap between theory and application.
What are the most common mistakes candidates make on linear algebra interview questions?
The biggest mistake is memorizing formulas without understanding geometric or statistical intuition. For example, many candidates can state the SVD formula but cannot explain what the singular vectors represent in a data context. Other common errors include confusing rank with dimension, ignoring numerical stability when discussing algorithms, and failing to connect linear algebra concepts to the firm's actual problems like risk decomposition or signal extraction.

