All 214 Unsupervised Learning interview questions
Clustering, dimensionality reduction, density estimation and anomaly detection.
Every question below opens on its own page, with a full answer, the formulas written out and a multiple-choice check. Free to read, no account needed.
Clustering basics
- How does k-means work and what are its main limitations?easy
- How do you choose the number of clusters k?easy
- When would you pick DBSCAN over k-means?medium
- What does the silhouette score measure?medium
- What is hierarchical clustering and when is it useful?medium
- Gaussian Mixture Model vs k-means — what's the difference?medium
- What is linkage in agglomerative clustering?hard
- Why does clustering degrade in high dimensions?medium
- How does k-means++ initialization work?medium
- When is mini-batch k-means preferred?medium
- k-medoids vs k-means — the difference.medium
- What is fuzzy c-means?hard
- HDBSCAN — how does it improve on DBSCAN?hard
- OPTICS — what does it produce and how do you use it?hard
- Spectral clustering — the core idea.hard
- Affinity propagation — how does it work?hard
- Mean shift clustering — mechanism and use case.hard
- BIRCH — when to use it?hard
- EM for a GMM — one iteration explicitly.hard
- GMM covariance types — which do you pick?hard
- How does BIC choose k in GMM?medium
- How does the gap statistic work?hard
- Why can the elbow method fail?medium
- Calinski-Harabasz index — what is it?medium
- Davies-Bouldin index — how is it computed?hard
- Adjusted Rand Index vs NMI — external cluster metrics.medium
- How do you cluster mixed numeric + categorical data?hard
- Why do you scale features before k-means?easy
- Cosine similarity vs Euclidean — when do you use cosine?medium
- How do outliers affect k-means and how do you handle them?medium
- How do you assess cluster stability?hard
- What is consensus clustering?hard
- Online k-means — how does it work?hard
- 'Cluster then classify' — when does it help?medium
- How do you cluster time series?hard
- What is Dynamic Time Warping?hard
- Community detection in graphs — main approaches.hard
- How do you interpret / visualize clusters?medium
- How do you find nested or hierarchical structure?medium
- Dirichlet Process — how does it help clustering?hard
- One cluster dominates in k-means — what do you do?medium
- Interview: 'you're asked to segment 10M customers — how?'hard
- How do you monitor cluster drift over time?hard
- Mixture models for density estimation — beyond GMM.hard
- LDA vs NMF for topic modeling — which do you pick?medium
- How does BERTopic work?medium
- Applications of clustering in NLP.medium
- How do you cluster images at scale?medium
- User behavior segmentation — feature engineering.medium
- Clustering in single-cell RNA-seq — the standard pipeline.hard
- Interview: cluster 5M e-commerce customers for a marketing campaign.hard
- Interview: how would you group log messages from a large distributed system?hard
- Interview: business asks 'why is customer X in Cluster 3?' — how do you explain?medium
- Interview: 'you have to pick k for the executive team — walk me through it.'medium
- Interview: after segmentation, one segment has 60% women but each region shows 40%. Why?hard
- Interview: how would you cluster 1B rows on a budget?hard
- Interview: you cluster and 3 clusters look 'right', but 2 mix categories — what next?hard
- Interview: 'no labels — how do you know your clustering is any good?'hard
- Interview: 'when should you NOT cluster?'medium
- Interview: 'how would you tune HDBSCAN's min_cluster_size?'hard
- Interview: 'discuss the tradeoffs between k-means, DBSCAN, and HDBSCAN.'medium
- Interview: 'what's the biggest mistake you've seen in a real clustering project?'medium
- Without labels, how do you convince a stakeholder your clustering is any good?medium
- You run k-means on customer data with age, income and number of purchases. What breaks?easy
- The elbow plot has no elbow. How do you pick k?medium
- DBSCAN labels almost everything as noise. What do you change?medium
- Is it a good idea to run k-means on raw text embeddings?hard
- LDA or embedding-based topic modelling for a corpus of support tickets?medium
- Your customer segments change completely when you re-run the pipeline monthly. Is that acceptable?hard
Advanced clustering & density
- Local Outlier Factor (LOF) — how does it work?medium
- Elliptic envelope / robust Mahalanobis distance — when to use?medium
- Kernel Density Estimation — mechanism.medium
- How do you choose the KDE bandwidth?hard
- What is a copula and why use one?hard
- Normalizing flows for density estimation — the idea.hard
- Score matching — what does it estimate?hard
- KL divergence — what it measures and pitfalls.medium
Distance & scaling considerations
- HNSW — how does it work?hard
- Product Quantization (PQ) — how does it compress vectors?hard
- Locality-Sensitive Hashing (LSH) — the core trick.hard
- MinHash — how does it estimate Jaccard similarity?hard
- Interview: your image dataset (10M) has near-duplicates — how do you dedup at scale?hard
- Concretely, what goes wrong with distance-based methods in high dimensions?hard
Cluster evaluation
Linear dimensionality reduction
- PCA vs t-SNE vs UMAP — when do you use each?medium
- How do you decide how many PCA components to keep?easy
- Derive PCA — what does it optimize?hard
- PCA via SVD — the connection.medium
- Why standardize before PCA (usually)?easy
- When does PCA fail?medium
- Kernel PCA — when and how?hard
- ICA vs PCA — the key difference.hard
- Non-negative Matrix Factorization (NMF) — when to use?medium
- Sparse coding — what is it?hard
- Random projection — how does it work?medium
- Linear Discriminant Analysis (LDA) vs PCA — the difference.medium
- Canonical Correlation Analysis (CCA) — use case.hard
- t-SNE perplexity — what does it control?medium
- Top t-SNE pitfalls to avoid.hard
- UMAP vs t-SNE — practical differences.medium
- UMAP key hyperparameters.medium
- Isomap — what does it do?hard
- Locally Linear Embedding (LLE) — how does it work?hard
- Multidimensional Scaling (MDS) — variants.medium
- Autoencoder for dimensionality reduction — pros and cons.medium
- What is the manifold hypothesis?medium
- How do you estimate the intrinsic dimension of a dataset?hard
- Truncated SVD vs PCA on sparse data.medium
- Incremental PCA — when do you need it?medium
- Robust PCA — what problem does it solve?hard
- Why does truncated SVD denoise?hard
- Word embeddings as unsupervised DR of text.medium
- How do modern sentence / doc embeddings work?medium
- Matrix completion — how does it relate to unsupervised learning?hard
- Principal Components Regression (PCR) — what does it do?hard
- Partial Least Squares (PLS) — how is it different from PCR?hard
- LSA (Latent Semantic Analysis) — how does it relate to modern retrieval?medium
- Matrix factorization for recsys — objective.medium
- Interview: 'you have 500 features, most correlated — how do you preprocess?'medium
- Interview: 'when should you use PCA vs autoencoder for dim reduction?'medium
- How many principal components do you keep, and what does 95% variance actually guarantee?medium
- What conclusions can you not draw from a t-SNE plot?hard
Anomaly & outlier detection
- What are the main approaches to anomaly detection?medium
- Isolation Forest — how does it detect anomalies?medium
- One-class SVM — mechanism and pitfalls.hard
- Autoencoder for anomaly detection — how?medium
- VAE-based anomaly detection — advantages.hard
- Deep SVDD — the core idea.hard
- Semi-supervised vs unsupervised anomaly detection.medium
- Positive-Unlabeled (PU) learning — when useful?hard
- Anomaly detection in time series — what changes?hard
- How is drift detection an unsupervised problem?medium
- Maximum Mean Discrepancy (MMD) — what is it?hard
- Wasserstein distance — intuition.hard
- Covariate drift vs concept drift vs label drift — the differences.medium
- Out-of-distribution (OOD) detection — approaches.hard
- Conformal prediction for anomaly detection.hard
- Scan statistics — when do you use them?hard
- CUSUM change-point detection — how does it work?hard
- How do you handle 99.9% normal / 0.1% anomaly training data?hard
- How do you explain why a point is anomalous?medium
- Interview: 'design an unsupervised fraud detection system'.hard
- How would you detect anomalies in multi-modal data (image + tabular)?hard
- How would you detect fraud rings (colluding accounts)?hard
- Interview: production fraud detector — daily volume 10M, current FN too high.hard
- Interview: model trained in region A must now serve region B — approach?hard
- Interview: 'design anomaly detection for a factory sensor with 200 signals.'hard
- Isolation forest or autoencoder for anomaly detection?medium
Autoencoders & VAEs
- What is self-supervised learning and why does it matter?medium
- How does contrastive learning work?hard
- What is an autoencoder and what are the common variants?medium
- Autoencoder variants — quick tour.medium
- Derive the VAE ELBO.hard
- VAE vs plain autoencoder — the key advantages.medium
- β-VAE — what does the β hyperparameter do?hard
- VQ-VAE — the core idea.hard
- SimCLR — recipe.medium
- MoCo (Momentum Contrast) — how does it enable smaller batches?hard
- BYOL — how does it avoid the need for negatives?hard
- SimSiam — what makes it minimal?hard
- DINO — self-distillation with no labels.hard
- MAE (Masked Autoencoder) — He et al. 2022.medium
- CLIP — how does contrastive image-text training work?medium
- JEPA (I-JEPA, V-JEPA) — LeCun's alternative to generative SSL.hard
- InfoNCE loss — formula and intuition.hard
- Why are augmentations so important in contrastive SSL?medium
- Word2Vec skip-gram — objective and training.medium
- GloVe vs Word2Vec.medium
- Word embedding analogies — why do they work?hard
- Sentence-BERT — how does it improve on BERT for retrieval?medium
- Node2Vec — how does it learn graph node embeddings?medium
- Modern graph representation learning — GNNs.hard
- Self-supervised graph learning — approaches.hard
- Self-supervised audio — wav2vec 2 and HuBERT.hard
- How are multimodal embeddings unified across text / image / audio?hard
- Scaling laws for self-supervised pretraining.hard
- Mode / representation collapse in SSL — what and why?hard
- VICReg / Barlow Twins — non-contrastive SSL via covariance regularization.hard
- Fine-tuning vs linear probe vs prompt-tuning — when do you use each?medium
- What is a 'foundation model' in the unsupervised sense?medium
- Interview: 'you have unlabeled images — which SSL method should you use?'hard
- Interview: 'when should you use a VAE vs GAN vs diffusion for generation?'hard
Topic modeling & text
- What is topic modeling and when do you use LDA?medium
- TF-IDF weighting — formula and rationale.easy
- BM25 — why is it still competitive with modern retrievers?medium
- Vector search / approximate nearest neighbors — main algorithms.medium
- How is RAG retrieval an unsupervised problem?medium
- PMI and PPMI — what they measure.hard
- How do you cluster / retrieve code snippets?hard
- Interview: users complain search returns irrelevant results — how do you fix?hard
- Interview: choose a sentence embedding model for a startup RAG.medium
- Interview: 'you have 1M support tickets — how do you categorize them?'hard
Recommender & association
- Collaborative filtering — how does it use unsupervised methods?medium
- Implicit feedback vs explicit ratings in recsys.hard
- How do you handle the cold-start problem?medium
- Two-tower recsys — architecture and use.hard
- Association rule mining — Apriori & FP-Growth.medium
- How does image similarity search work in production?medium
- Market basket analysis — modern approach.hard
- Unsupervised image segmentation — approaches.hard
- Zero-shot image classification via CLIP — mechanism.medium
- How does unsupervised learning help with noisy labels?hard
- Interview: design a recommender for a new streaming service.hard
- Interview: your model's accuracy dropped 15% overnight — how do you diagnose?hard
- Interview: you must ship an embedding service serving 100M vectors, 10ms p95 latency.hard
- Interview: how do you monitor drift in an embedding-based retrieval system?hard
- Interview: 'when should you use graph-based methods over tabular?'medium
- Interview: 'you have to embed 100M documents monthly — cost strategy?'hard
- Interview: 'summarize when unsupervised learning wins in production.'medium
- How do you make recommendations for a brand-new user?medium