Day 25 of 133

Clustering: k-means, DBSCAN, hierarchical + DSA Linked List

Lloyd's algorithm, cluster count selection, when DBSCAN beats k-means.

DSA · NeetCode Linked List

  • Lru CacheDSA · Linked List

    Interview questions to prep

    1. Why hash map + doubly linked list — what does each give you in O(1)?
    2. How would you make this thread-safe? What's the simplest correct approach?
  • Merge K Sorted ListsDSA · Linked List

    Interview questions to prep

    1. Compare divide-and-conquer (pairwise merge, O(N log k)) vs heap-of-k-heads (also O(N log k)) — when does each win in practice?
    2. What if the lists are streaming — does the heap approach still work?

ML · Clustering

  • Interview questions to prep

    1. Walk through Lloyd's algorithm for k-means.
    2. Why does k-means initialization (k-means++) matter?
    3. How would you choose k? Elbow vs silhouette vs gap statistic.
  • DBSCAN & HDBSCANTraditional MLscikit-learn

    Interview questions to prep

    1. When does DBSCAN beat k-means?
    2. What two hyperparameters does DBSCAN have and how do you pick them?
  • Interview questions to prep

    1. When is hierarchical clustering more useful than k-means?
    2. Compare linkage methods (single, complete, average, Ward).

References & further reading