Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 323. Number of Connected Components in an Undirected Graph
Given n labeled nodes and a list of undirected edges, determine how many connected components the graph contains. This requires grouping nodes reachable from each other (e.g., via DFS/BFS or Union-Find) and counting the distinct groups.
Asked at:
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early June, 2025
Amazon
Senior
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.