Compare PCA, t-SNE and UMAP. When would you use each, and how do people misread these plots?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
PCA is linear and belongs in a pipeline. t-SNE and UMAP are non-linear and belong on a screen, for looking at data, not for feeding a downstream model.
Full worked answer
PCA is linear and belongs in a pipeline. t-SNE and UMAP are non-linear and belong on a screen, for looking at data, not for feeding a downstream model.
PCA finds orthogonal directions of maximum variance (eigenvectors of the covariance matrix, in practice the SVD of the centred data). It is deterministic, cheap, invertible (you can project back and measure reconstruction error), and it preserves global structure. That makes it the one you can ship: shrink 1536-d embeddings to 256 to cut index size and latency, decorrelate features, denoise. Standardize first if features have different units. The failure mode: variance is not information. A low-variance direction can be the discriminative one, and PCA will throw it away.
t-SNE and UMAP optimise a neighbourhood-preservation objective. They are stochastic, do not preserve distances, and they mislead in specific documented ways:
- Cluster sizes are meaningless. t-SNE expands sparse regions and compresses dense ones.
- Distances between clusters are largely meaningless, especially for t-SNE.
- The plot changes with perplexity / n_neighbors and with the random seed. You can produce convincing clusters out of pure Gaussian noise by picking perplexity low enough.
UMAP preserves more global structure, is faster, and can transform new points (t-SNE cannot, without hacks), but the same caveats hold.
My rules: PCA down to ~50 dims first as a denoise and speed step, then t-SNE/UMAP. Sweep perplexity/n_neighbors and multiple seeds, and only believe structure that persists across all of them. Never quote a cluster count read off a UMAP plot as a finding; confirm by clustering in the original space and sanity-checking against labels.
For embedding work specifically, treat these as debugging aids. Do my paraphrases land near each other? Have my chunk embeddings collapsed into one blob? Good questions. "How many intents do my users have" is not answerable from the picture.
What a good answer covers
- PCA is linear and belongs in a pipeline
- PCA finds orthogonal directions of maximum variance (eigenvectors of the covariance matrix, in practice…
- It is deterministic, cheap, invertible (you can project back and measure reconstruction error), and it…
- That makes it the one you can ship
- Standardize first if features have different units
Key terms: PCA · t-SNE and UMAP · Cluster sizes are meaningless
Interviewer follow-ups to expect
You need to cut a 3072-d embedding index in half without hurting recall. Walk me through your options and how you would validate the choice. Why can UMAP transform new points when t-SNE cannot?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep