Why does standard agglomerative hierarchical clustering fail to scale to large datasets?

Quick Overview

Asks why standard agglomerative hierarchical clustering becomes impractical as the number of points grows. Tests reasoning about the memory and time cost of pairwise distances and merges, and knowledge of the workarounds used on large datasets.

Why does standard agglomerative hierarchical clustering fail to scale to large datasets?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why does standard agglomerative hierarchical clustering fail to scale to large datasets? Cover both memory and running time, and say what practitioners do instead when there are hundreds of thousands of points. ```hint Count what must be stored How many pairwise distances does the algorithm need before its first merge, and how much memory is that for 100,000 points? ``` ```hint Count the work per merge How many merges are there in total, and how much of the distance matrix does a straightforward implementation scan for each one? ``` ### What a Strong Answer Covers - The memory cost of the pairwise distance matrix, with a concrete size - The time cost of the naive algorithm and of the faster merge algorithms - Why the hierarchy cannot be updated incrementally or in mini-batches - Practical workarounds and what each one changes about the result ### Follow-up Questions - Why can single linkage be computed from a minimum spanning tree, and what does that buy you? - How does a connectivity constraint change the clusters you get? - How would you assign new points to an existing hierarchy without rebuilding it? - When would you choose HDBSCAN or BIRCH over agglomerative clustering on a sample?

Overview: Asks why standard agglomerative hierarchical clustering becomes impractical as the number of points grows. Tests reasoning about the memory and time cost of pairwise distances and merges, and knowledge of the workarounds used on large datasets.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Why does standard agglomerative hierarchical clustering fail to scale to large datasets? Cover both memory and running time, and say what practitioners do instead when there are hundreds of thousands of points.

What a Strong Answer Covers Guidance

  • The memory cost of the pairwise distance matrix, with a concrete size
  • The time cost of the naive algorithm and of the faster merge algorithms
  • Why the hierarchy cannot be updated incrementally or in mini-batches
  • Practical workarounds and what each one changes about the result

Follow-up Questions Guidance

  • Why can single linkage be computed from a minimum spanning tree, and what does that buy you?
  • How does a connectivity constraint change the clusters you get?
  • How would you assign new points to an existing hierarchy without rebuilding it?
  • When would you choose HDBSCAN or BIRCH over agglomerative clustering on a sample?