Skip to content
Tech Interview Prep
Technical interview guideNew

UMAP and Nonlinear Embeddings

How UMAP builds a fuzzy k-nearest-neighbour graph and lays it out in low dimensions, how its parameters change the picture, and how to read the result without over-interpreting it.

Read
14 min
Practice MCQs
25
Interview Q&A
25
Edition
v1
Editorial status
Reviewed

Scope: umap-learn 0.5.x (Python package, current 0.5 line) and the algorithm as published by McInnes, Healy and Melville (arXiv 1802.03426, 2018). Parameter defaults (n_neighbors=15, min_dist=0.1, n_components=2, metric='euclidean') are those of umap-learn 0.5.x; verify against the release in use before quoting them..

Curated: · Written: · Reviewed:

25 questions · Flow follows Relevance until this set has a learning order.

MCQ-1A team has log-normalised expression for 2,000 samples across 30,000 genes and needs a 2D plot to check whether batch separates the samples. The report must name the axis that carries any batch split and the share of variance that axis explains. Which first analysis fits this brief?
MCQ-2A 1,500-point dataset lies on a Swiss roll in three dimensions. Two points that are far apart along the sheet sit on neighbouring turns of the roll, so they are close together in 3D. Which 2D embedding is most likely to place them far apart in the output?
MCQ-3A UMAP run with n_neighbors=15 on 2,000 cells has an outlier X whose nearest neighbour Y is 12 units away. Y's own nearest neighbour is 0.5 units away, and Y's bandwidth sigma is 0.8. After symmetrisation, what is the fuzzy weight of the edge between X and Y?
MCQ-4A team embeds 3,000 points in six groups of 500 each with umap-learn, n_neighbors=5, min_dist=0.1 and the euclidean metric. In the original feature space each group is one tight cloud with no sub-structure. Before reading any shape into the 2D plot, what should the team expect to see?
MCQ-5A team embeds 6,000 cells with UMAP at default min_dist and the euclidean metric. Two 30-cell subclusters sit inside a 2,000-cell population and separate cleanly at n_neighbors=15. They rerun on the same matrix with n_neighbors=200. Which outcome should they expect in the 2D plot?
MCQ-6Two UMAP runs on the same 2,000 cells use identical settings except one value. The run with the lower value draws points packed into tight clumps, and the run with the higher value spreads them across the plot. Which UMAP setting governs how tightly points may pack in the layout?
MCQ-7A team embeds 4,000 support tickets with a text model whose vectors are not normalised. Relatedness is defined by cosine similarity, and vector norm tracks ticket length, ranging from 3 to 11. Their first UMAP run uses the default euclidean metric and places long tickets apart from short tickets on the same topic. Which setting should they change?
MCQ-8A team runs UMAP twice on the same 4,000 cells of normalised expression, changing only `random_state` from 1 to 2. HDBSCAN labels agree on most cells across the two runs. In run 1 cluster C sits at the far left of the plot, and in run 2 it sits at the far right, while the gap between C and its neighbour cluster D looks about the same in both. The figure is going into a methods slide, so which claim should it carry?
MCQ-9An audit needs a 2D UMAP embedding of 40,000 transactions regenerated bit-identically each year on pinned `umap-learn` and Python versions. The current notebook runs with parallel workers enabled and no seed, so reruns differ. Which setting should the team keep for the audit run?
MCQ-10A team plots 4,000 cells with UMAP and sees clusters P and Q 2 units apart. A rerun on the same matrix with a different random_state puts them 9 units apart. Which conclusion does the plot support about how alike P and Q are?
MCQ-11A UMAP plot of 2,000 single cells shows cluster X with 1,400 cells packed into about 3 units of plot width, and cluster Y with 200 cells spanning about 9 units. The team wants to say Y is more heterogeneous in the original 50-dimensional PCA space. Which step settles that claim?
MCQ-12A team embeds 8,000 cells measured on 60,000 log-normalised features. About 40% of the features have variance near zero and carry only sampling noise. A 2D UMAP run on all raw columns is slow and the clusters blur into one another. Which input should they pass to UMAP?
MCQ-13A UMAP model was fitted on 8,000 batch-1 PBMC cells after PCA to 50 components, then `transform` was called on 1,200 cells from a second protocol whose library sizes are about a third of batch 1's. Batch 2 forms one tight group sitting on cluster T4. Which check best tells you whether that placement can be trusted?
MCQ-14A team passes class labels as y to umap-learn and gets two clean islands in its 2D plot. What does that plot show about the classes in the raw features?
MCQ-15A team must embed 200,000 cells from their 50 principal components on an 8-core machine, rebuilt weekly within 30 minutes. New batches of about 5,000 cells arrive daily and must be placed without moving cells already plotted. Which setup meets all three constraints?
MCQ-16A team embeds 900 single cells twice, once with t-SNE and once with UMAP at n_neighbors=15, and wants both plots to reflect the same neighbourhood size. A colleague sets t-SNE perplexity to 15 and the cluster shapes change noticeably from the earlier run. What should the team do before comparing the two plots?
MCQ-17A team embeds 12,000 cells from 2,000 log-normalised features with UMAP (2 components, `n_neighbors=5`, `min_dist=0.0`) and runs HDBSCAN with `min_cluster_size=10` on the coordinates. It returns 340 clusters with median size 14, and the team plans to report them as cell states. Which step comes first?
MCQ-18A team fits UMAP once on all 3,000 customer rows with `n_components=2`, sees four islands in the scatter, and must report how many customer segments exist. Which count should the report carry?
MCQ-19A UMAP of 6,000 blood cells shows a 60-cell bridge between a monocyte cluster and a dendritic cluster. Both end clusters have sharp marker signatures and the bridge cells score intermediate on each, but 52 of the 60 bridge cells come from the day-2 batch. Which next step tests whether the bridge reflects a real transition?
MCQ-20A UMAP of 25,000 droplets built on 2,000 principal components shows a 12-point island far from every main cluster. The island's cells have a median of 310 UMI each, against 4,100 in the main clusters. Which step best separates a real rare population from a low-count artefact?
MCQ-21A team fits UMAP on 6,000 cells with `n_components=10` and runs HDBSCAN on the output, which returns six clusters. A PCA projection of that 10D embedding onto its first two components puts clusters 2 and 4 on top of each other, and the product lead needs one 2D plot on the slide with the six clusters kept exactly as analysed. Which approach gives a usable picture while keeping the clustering the team reports?
MCQ-22A team runs umap-learn twice on the same 6,000 hepatocyte cells, changing only `min_dist` from 0.1 to 0.7. The second 2D plot is more spread out, but the same three groups appear. Which UMAP setting fixes which points count as neighbours?
MCQ-23A 2,400-row sensor table has 12 numeric features in mixed units, all to be standardised before UMAP. One row is a confirmed instrument fault: its column-7 reading is 1,000,000 where normal readings sit between 40 and 60. Policy forbids imputing or editing values in the embedded table. Column 2 has a genuine long tail that carries the signal. Which preprocessing keeps neighbour distances meaningful?
MCQ-24A team runs UMAP twice on the same 50,000 cells with identical settings and no random_state. The two plots look alike, but the neighbour indices logged for each run differ for about 2% of cells, and the layouts shift slightly. Which step most likely produced the difference in the neighbour lists?
MCQ-25A UMAP of 4,000 tumour cells shows clusters K and L well apart, and the team must report whether they are distinct cell types. K and L were sequenced on the same lane, and the gap between them moves from 3 to 9 plot units across random seeds. Which check settles whether K and L are biologically distinct?