union-find Interview Questions
41 interview questions in our bank cover union-find, most of them Coding & Leetcode-style Questions. They average 3.1/5 difficulty — medium — and each one was reported by a candidate after a real interview. Companies known to ask about union-find: Uber, Google, ByteDance, Amazon, Stripe, and 15 more.
Practice these on the problems board →Companies that ask about union-find
Question mix
- Coding & Leetcode-style Questions41
Difficulty
- 2/5 — easy1
- 3/5 — medium36
- 4/5 — hard4
Questions tagged union-find
Min Cost to Connect All Points (Manhattan MST)
3/5Finding optimal network connections in a multi-dimensional space is a fundamental graph theory challenge, featured here as a reported ByteDance interview question. Applicants are asked to determine the absolute minimum expenditure required to link a scatter of coordinates using grid-based distances, effectively building a minimum spanning tree. This problem tests your expertise in advanced graph algorithms and efficient edge weighting strategies. Unlock the full challenge details and a robust algorithmic solution with your subscription.
Coding & Leetcode-style QuestionsByteDanceSix Degrees of Collusion - Fraud Ring Detection
3/5In this graph-traversal coding challenge reported from Stripe interviews, you will investigate interconnected transaction logs to uncover fraudulent rings by tracking shared user identifiers like digital devices and payment cards. The exercise evaluates your capability to construct relational networks, execute transitive queries, and efficiently handle graph components at scale. Unlocking the complete problem text, edge cases, and the reference implementation requires an active subscription.
Coding & Leetcode-style QuestionsStripeMinimum Score of a Path Between Two Cities
3/5This graph theory challenge, reported from Visa technical interviews, requires finding an optimal route across a network of connected locations. Instead of traditional shortest-path metrics, the objective centers on identifying a trajectory where the weakest link or maximum weight encountered along the way is minimized. It tests your proficiency with graph traversal algorithms and data structures like disjoint-set unions or modified search strategies. Gain full access to the complete problem statement and verified code solution with your subscription.
Coding & Leetcode-style QuestionsVisaMinimum Rooks After Captures
3/5Combinatorial optimization on grid matrices frequently appears in technical screenings, as highlighted by this reported Amazon interview question. You are tasked with minimizing the number of pieces remaining on a board after applying specific capture rules along rows and columns. This puzzle examines your strategic thinking and ability to reduce complex matrix interactions to their simplest form. Access to the full problem details and efficient algorithmic solution requires an active subscription.
Coding & Leetcode-style QuestionsAmazonNumber of Islands and Grid BFS Variants
3/5This frequently reported ByteDance interview question evaluates your ability to navigate two-dimensional matrices using graph traversal techniques. You will be tasked with identifying distinct clusters of connected elements within a grid, alongside common variations such as computing region sizes and calculating boundaries. This exercise tests your proficiency in implementing breadth-first and depth-first search algorithms efficiently under constraints. To explore the complete problem statement, optimal algorithmic approaches, and fully working code implementations, a subscription is required.
Coding & Leetcode-style QuestionsByteDanceMinimize Path Value (Minimax Path)
3/5Finding paths that minimize the maximum edge weight in a network is a classic graph theory problem frequently encountered in Palantir interviews. The goal is to traverse a weighted undirected graph from a starting vertex to a destination while keeping the highest edge stress along the route as low as possible. This challenge tests your familiarity with modified shortest path algorithms and priority queue strategies. Access the complete problem overview and model solution with a subscription.
Coding & Leetcode-style QuestionsPalantirNumber of Islands and Total Island Perimeter
3/5Analyze a grid-based spatial environment to simultaneously determine distinct regional clusters and calculate their aggregate boundary lengths. This classic graph traversal puzzle has been featured in technical interviews at ByteDance, testing your proficiency with matrix traversal techniques and spatial reasoning. You will develop robust algorithms to inspect connected components efficiently. Gaining access to the full problem context and model solution requires a subscription.
Coding & Leetcode-style QuestionsByteDanceDetermine Whether Two Horses Are Related
3/5This conceptual coding challenge, frequently reported during technical screenings at Google, asks you to determine whether two distinct subjects share a biological lineage within a provided ancestry graph. The exercise tests your mastery of graph traversal strategies, lineage tracking, and relationship validation across complex hierarchical datasets. Gain access to the full problem text, structural constraints, and an optimal algorithmic solution by upgrading to a paid subscription.
Coding & Leetcode-style QuestionsGoogleMaking a Large Island by Flipping One Zero
4/5Explore this engaging graph traversal challenge frequently featured in Meta technical interviews. Candidates are tasked with analyzing a grid matrix to determine the largest possible contiguous region of connected elements achievable after performing a single targeted modification. This problem evaluates your grasp of connected components, depth-first search strategies, and spatial reasoning under constraints. Master the underlying graph concepts to efficiently evaluate neighborhood expansions without brute-force recalculations. The complete problem description and model solution require a subscription.
Coding & Leetcode-style QuestionsMetaMinimum Link Reallocation to Connect Repositories
3/5Featured in an IBM technical interview, this graph theory problem requires calculating the fewest link reassignments needed to connect a network of isolated or fragmented repositories into a single component. You are given an undirected graph and must strategically relocate edges to achieve full connectivity while minimizing changes. The exercise tests your grasp of graph connectivity, component analysis, and spanning tree concepts. View the complete problem statement and a robust algorithmic solution with a subscription.
Coding & Leetcode-style QuestionsIBMPhoto Groups via Transitive Similarity
3/5This ByteDance interview question challenges engineers to partition a collection of visual items into distinct clusters based on transitive relational data. The exercise examines graph traversal techniques and disjoint-set data structures to efficiently compute connected components within a relationship matrix. Success depends on recognizing how equivalence relations translate into graph connectivity problems. To view the full problem statement along with the complete optimal implementation, a subscription is required.
Coding & Leetcode-style QuestionsByteDanceMerge Detections from Multiple Vision Systems (Bounding Box Fusion)
3/5Reported during Nuro engineering interviews, this problem involves building a fusion algorithm to combine overlapping spatial predictions from multiple automated vision detectors into a clean, consolidated set of bounding boxes for video frames. It tests spatial reasoning, scoring thresholds, and geometric overlap calculations. To access the comprehensive problem description, edge cases, and model code solution, a subscription is required.
Coding & Leetcode-style QuestionsNuroValidate a Forest from (parent, child) Edges
3/5In this graph theory coding challenge often featured at Waymo, candidates must determine whether a collection of directed edges correctly forms a disjoint set of trees. The assessment checks proficiency with graph traversal, cycle detection, and autonomous test case creation. Unlocking the full problem requirements, algorithmic strategies, and clean code solution requires a paid subscription.
Coding & Leetcode-style QuestionsWaymoEarliest Time to Connect All Riders
3/5Solve a graph connectivity and temporal tracking challenge featured in technical interviews at Uber, where you must determine the precise moment a community of participants becomes fully unified. By analyzing chronologically ordered interaction logs, you will track relationship formations and evaluate network topology changes over time. This exercise tests your command over graph traversal algorithms, disjoint-set data structures, and handling time-series edge updates. Unlock the complete problem statement, follow-up scenarios, and expert solution with a subscription.
Coding & Leetcode-style QuestionsUberCount Same-Color Squares in an Unbounded Grid
3/5In this engaging coding challenge reported during a Waymo phone screen, candidates must compute the number of uniform-color squares within an unbounded, sparse two-dimensional canvas. This puzzle tests your ability to efficiently manage coordinate-based data structures without pre-allocated size limits while recognizing contiguous shapes. You will need to implement a robust search or traversal strategy to isolate monochromatic regions. Access to the comprehensive problem statement and the verified model solution requires an active subscription.
Coding & Leetcode-style QuestionsWaymoCount Connected Components (Union-Find)
3/5Understanding graph connectivity and equivalence classes is essential for tackling complex network problems, frequently featured in Amazon technical evaluations. This exercise challenges you to group interrelated items based on transitive relationships and efficiently count the resulting isolated components or track group sizes. You will explore advanced data structures designed to perform fast union and find operations on disjoint sets. Unlock the comprehensive problem description and the complete model solution with an active subscription.
Coding & Leetcode-style QuestionsAmazonEvaluate Division
3/5In this classic coding interview question reported at Uber, you are given a set of proportional relationships between variables and must compute the outcomes of various division queries based on those known ratios. The exercise assesses your graph traversal skills, treating the variables as nodes and the given proportions as weighted directed edges. You will need to determine connectivity and calculate cumulative scaling factors dynamically. Read the entire problem statement and verified code implementation by joining with a subscription.
Coding & Leetcode-style QuestionsUberNumber of Islands (Plain and Streaming)
3/5Grid traversal and connected component identification are classic themes in technical evaluations, as seen in this reported Uber interview question. The objective is to compute distinct land masses within a matrix based on multi-directional adjacency rules, alongside a challenging dynamic update follow-up where terrain modifies iteratively. This problem tests your graph exploration abilities and proficiency with disjoint-set data structures to maintain real-time aggregates efficiently. Preparing for this scenario sharpens your algorithmic thinking for spatial data challenges. To view the full problem description and expert model solution, a subscription is required.
Coding & Leetcode-style QuestionsUberFriendship Connectivity with Union-Find
3/5In this Google interview challenge, you are tasked with tracking dynamic relationships within a population using efficient graph algorithms. The problem evaluates your ability to process continuous connection updates and instantly evaluate transitive associations between entities. Success depends on implementing an optimal disjoint-set data structure to handle frequent queries with minimal latency. Unlock the full challenge breakdown and optimized code solution by purchasing a subscription.
Coding & Leetcode-style QuestionsGoogleMax Value Range Across Connected Components
3/5Evaluating graph connectivity and analyzing structural extremes forms the foundation of this engaging Amazon interview question. You are tasked with examining a network of vertices and edges, grouped into distinct components, to find the maximum disparity between node values across any single component. This problem assesses your ability to traverse graph topologies efficiently while tracking aggregate statistics within clusters. Solving this cleanly demonstrates strong command over fundamental graph algorithms and data structures. To view the complete breakdown and optimal code solution, please consider subscribing.
Coding & Leetcode-style QuestionsAmazonBoard Score — Connected Areas × Crowns
3/5This Airbnb coding interview question requires calculating an aggregate score for a grid containing multi-attribute tiles encoding category types and value weights. Candidates must identify maximal connected components of identical terrain types, aggregate internal point distributions, and compute a final metric based on region size and cumulative values. Reviewing the complete problem details, graph traversal strategies, and the verified model solution requires an active platform subscription.
Coding & Leetcode-style QuestionsAirbnbRedundant Connection
3/5This graph theory problem, frequently asked in software engineering interviews at Apple, tests your ability to identify and remove a superfluous link from a cyclic graph to restore a valid tree structure. The exercise evaluates graph traversal techniques and disjoint-set data structures to efficiently find the target connection. Unlock the complete problem description, optimal algorithms, and reference code by obtaining a subscription.
Coding & Leetcode-style QuestionsAppleFind Sizes of Connected Components in Undirected Graph
3/5In this C3.ai technical assessment, you are tasked with analyzing network relationships represented as an undirected graph. The objective is to partition the nodes into distinct subgraphs and compute the exact population size of each isolated cluster. This exercise evaluates your proficiency with graph traversal algorithms, such as depth-first search or disjoint-set data structures. Access the complete problem description and a comprehensive model solution by purchasing a subscription.
Coding & Leetcode-style QuestionsC3.aiChecking Existence of Edge Length Limited Paths
3/5This Uber interview question challenges you to process a network of connected nodes and evaluate connectivity queries subject to strict edge-weight thresholds. It evaluates your grasp of graph traversal algorithms and efficient offline query processing strategies. Upgrade your account to access the complete problem details and optimal code implementation.
Coding & Leetcode-style QuestionsUberEarliest Time When Everyone Becomes Connected
4/5This frequently reported Google coding interview question challenges you to determine the exact moment a group of individuals becomes fully linked through a chronological sequence of pairwise interactions. To solve this efficiently, candidates typically employ disjoint-set data structures to track component merging in near-constant time. You will need to process relationship logs sequentially and identify when all separate entities consolidate into a single network. The complete problem statement, optimal algorithmic approach, and clean source code require a subscription to access.
Coding & Leetcode-style QuestionsGoogleGraph Distance / Connectivity (MLE Phone Variant)
3/5Explore large-scale network connectivity and shortest-path determinations framed within a social and content-sharing ecosystem, as reported in machine learning engineering interviews at Pinterest. This challenge tests your expertise in handling vast graph structures, evaluating node relationships, and optimizing traversal queries under constraints. You will need to apply advanced data structures and pathfinding techniques to succeed. Unlock the complete problem statement and optimal algorithmic solution with a paid subscription.
Coding & Leetcode-style QuestionsPinterest2D Points Connected Components by Radius
3/5Tackle a geometric clustering problem where spatial coordinates must be grouped based on a proximity threshold, a classic coding interview question encountered at Google. This challenge tests your proficiency with graph traversal techniques and disjoint-set data structures to efficiently determine transitive relationships among coordinates. You will practice optimizing neighborhood scans and managing spatial connectivity to compute the final cluster count. Unlock the comprehensive breakdown and fully optimized model solution with a subscription.
Coding & Leetcode-style QuestionsGoogleNumber of Good Pairs
3/5In this Commvault interview question, you are given an undirected graph and asked to calculate the total number of node pairs that reside in completely separate connected components. The challenge requires you to analyze graph topology and effectively group vertices to determine reachability between disconnected regions. It is an excellent test of graph traversal algorithms and disjoint-set data structures. Unlock the full problem details and the optimal model solution by acquiring a subscription.
Coding & Leetcode-style QuestionsCommvaultAccounts Merge
3/5This popular Electronic Arts interview question challenges you to consolidate overlapping user identities based on shared contact details. You will be given multiple profile records containing names and email addresses, and your goal is to group accounts that belong to the same individual and organize their communication channels alphabetically. This problem effectively tests graph traversal and set management skills. Unlock the full problem description and comprehensive solution by getting a subscription.
Coding & Leetcode-style QuestionsElectronic ArtsAccount Merge / User Deduplication
3/5This identity consolidation problem was featured in an Airbnb coding interview, focusing on duplicate detection across multi-attribute user records. You need to design an algorithm that processes registration streams sequentially, linking profiles that share common identifiers while preserving the original owner. The exercise evaluates graph connectivity concepts and state tracking proficiency. Unlock the full problem details and efficient reference solution by subscribing.
Coding & Leetcode-style QuestionsAirbnbMaximum Difference Across Connected Components
2/5Encountered in Akuna Capital recruitment rounds, this task requires analyzing an undirected network to discover connected subgraphs and calculate the span between the maximum and minimum node identifiers within each group. It evaluates your proficiency in graph traversal algorithms such as depth-first search or disjoint-set data structures. Unlocking the full problem guidelines, optimal constraints, and reference implementation requires a paid subscription.
Coding & Leetcode-style QuestionsAkuna CapitalCount Ball Clusters on a Grid
3/5This Uber interview question explores spatial relationships by asking you to find the minimum number of isolated clusters formed by coordinate points on a grid based on a distance threshold and transitive attraction rules. You must compute connected components to determine how many separate chain reactions are necessary to sweep through all coordinates. It is a brilliant test of graph traversal and geometry algorithms. Full problem details and the complete model solution are available to subscribers.
Coding & Leetcode-style QuestionsUberNumber of Friend Circles
3/5As reported in an Amazon interview, this problem requires you to identify the total number of distinct "friend circles" within a group of people. You are given a matrix representing direct friendships, and it's important to remember that friendship is transitive – if A is friends with B, and B is friends with C, then A, B, and C all belong to the same circle. Your task is to count how many separate, unconnected groups of friends exist. This tests graph traversal algorithms and connectivity analysis. The full problem and model solution require a subscription.
Coding & Leetcode-style QuestionsAmazonCount Connected Building Components in a City Grid
3/5Prepare for technical evaluations with this classic graph traversal problem frequently featured in Google interviews. You are tasked with analyzing a two-dimensional layout to identify and tally distinct clusters of adjacent elements based on directional connectivity rules. This challenge evaluates your proficiency in depth-first search, breadth-first search, or disjoint-set data structures for connected component analysis. Discover the complete problem description and an optimized model solution by upgrading to a paid subscription.
Coding & Leetcode-style QuestionsGoogleNumber of Islands and Number of Distinct Islands
3/5This reported interview question from XPeng challenges candidates to navigate a two-dimensional grid representing terrain boundaries to count standard land clusters while also identifying how many unique spatial configurations exist among them. This task tests your graph traversal capabilities, pattern recognition, and ability to normalize geometric structures for accurate comparison. To examine the complete problem statement and discover the optimal programmatic solution, a paid subscription is required.
Coding & Leetcode-style QuestionsXPengNumber of Islands
3/5Familiarize yourself with this popular Apple interview exercise where you compute distinct landmasses on a two-dimensional grid of binary indicators. The challenge centers on exploring connected components using graph traversal algorithms like breadth-first or depth-first search. It is a fundamental assessment of spatial reasoning and matrix manipulation proficiency. To view the complete prompt details and professional source code solution, please subscribe.
Coding & Leetcode-style QuestionsAppleDisplay Sort
3/5Encountered during Figma interviews, this geometric sorting task challenges you to arrange UI elements based on their spatial positioning on a canvas. The objective is to establish a natural reading order by grouping components into rows using vertical overlap rules and sorting horizontally from left to right. This puzzle tests your mastery of spatial algorithms, coordinate geometry, and transitive grouping logic. Gain full access to the comprehensive problem guide and clean code solution with a subscription.
Coding & Leetcode-style QuestionsFigmaMaximum Group Size by Overlapping Work Intervals (Connectivity via Overlap Paths)
3/5In this Rubrik interview question, you must analyze temporal intervals to determine connectivity patterns among a group of individuals. By modeling timeline overlaps as graph relationships, your task is to identify connected components and determine the maximum cluster size. This problem examines your expertise in graph theory, interval scheduling, and efficient traversal algorithms. The full problem specification and reference implementation are available to subscribers only.
Coding & Leetcode-style QuestionsRubrikNumber of Islands II (Dynamic Union-Find)
4/5Reported as an engaging interview challenge at Uber, this dynamic connectivity problem tracks the number of islands on a grid as water cells progressively transform into land. The task evaluates your ability to maintain connected components efficiently after each incremental update rather than recalculating from scratch. It heavily tests graph algorithms and advanced disjoint-set data structures for optimal performance. Explore the full problem breakdown and expert-crafted model solution with a paid subscription.
Coding & Leetcode-style QuestionsUberRecord Linkage by Weighted Similarity
3/5Featured in Stripe interview loops, this entity resolution problem requires grouping and connecting user records based on weighted multi-field similarity scores. Candidates must build algorithms that traverse relational graphs to identify direct matches, extended network hops, and entire connected components matching specific criteria. It evaluates your grasp of graph theory, similarity metrics, and efficient record linkage logic. Unlock the full challenge details, edge cases, and robust model solution with a subscription.
Coding & Leetcode-style QuestionsStripeMaking a Large Island
4/5Discover how to maximize spatial connectivity by modifying a single element within a grid matrix, a classic algorithmic puzzle frequently featured in Uber technical interviews. This problem tests your expertise in graph theory, specifically connected components, breadth-first search, or depth-first search traversal strategies. You will learn how to efficiently compute region sizes and evaluate potential bridging points to merge adjacent clusters for optimal results. Strengthen your two-dimensional array manipulation skills and prepare for top-tier technical evaluations. The full problem and model solution require a subscription.
Coding & Leetcode-style QuestionsUber
Studied alongside
union-find interview FAQ
- How many union-find interview questions are there?
- 41 reported questions, mostly Coding & Leetcode-style Questions.
- Which companies ask union-find questions?
- Uber (7), Google (5), ByteDance (4), Amazon (4), Stripe (2), Waymo (2), Airbnb (2), Apple (2).
- How hard are union-find questions?
- They average 3.1 out of 5: 1 at 2/5, 36 at 3/5, 4 at 4/5.