Graph Interview Questions

Nodes, edges, connectivity, and shortest paths.

107 problems

#Title
332Reconstruct Itinerary
399Evaluate Division
765Couples Holding Hands
924Minimize Malware Spread
928Minimize Malware Spread II
959Regions Cut By Slashes
990Satisfiability of Equality Equations
1042Flower Planting With No Adjacent
1101The Earliest Moment When Everyone Become Friends
1135Connecting Cities With Minimum Cost
1168Optimize Water Distribution in a Village
1334Find the City With the Smallest Number of Neighbors at a Threshold Distance
1349Maximum Students Taking Exam
1361Validate Binary Tree Nodes
1462Course Schedule IV
1489Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree
1557Minimum Number of Vertices to Reach All Nodes
1568Minimum Number of Days to Disconnect Island
1579Remove Max Number of Edges to Keep Graph Fully Traversable
1584Min Cost to Connect All Points
1601Maximum Number of Achievable Transfer Requests
1615Maximal Network Rank
1627Graph Connectivity With Threshold
1631Path With Minimum Effort
1697Checking Existence of Edge Length Limited Paths
1719Number Of Ways To Reconstruct A Tree
1724Checking Existence of Edge Length Limited Paths II
1743Restore the Array From Adjacent Pairs
1761Minimum Degree of a Connected Trio in a Graph
1778Shortest Path in a Hidden Grid
1782Count Pairs Of Nodes
1786Number of Restricted Paths From First to Last Node
1791Find Center of Star Graph
1810Minimum Path Cost in a Hidden Grid
1820Maximum Number of Accepted Invitations
1879Minimum XOR Sum of Two Arrays
1947Maximum Compatibility Score Sum
1971Find if Path Exists in Graph
1976Number of Ways to Arrive at Destination
2076Process Restricted Friend Requests
2077Paths in Maze That Lead to Same Room
2092Find All People With Secret
2093Minimum Path Cost in a Hidden Grid
2097Valid Arrangement of Pairs
2123Minimum Operations to Remove Adjacent Ones in Matrix
2127Maximum Employees to Be Invited to a Meeting
2172Maximum AND Sum of Array
2203Minimum Weighted Subgraph With the Required Paths
2204Distance to a Cycle in Undirected Graph
2242Maximum Score of a Node Sequence
2307Check for Contradictions in Equations
2359Find Closest Node to Given Two Nodes
2360Longest Cycle in a Graph
2392Build a Matrix With Conditions
2473Minimum Cost to Buy Apples
2508Add Edges to Make Degrees of All Nodes Even
2608Shortest Cycle in a Graph
2662Minimum Cost of a Path With Special Roads
2699Modify Graph Edge Weights
2714Find Shortest Path with K Hops
2737Find the Closest Marked Node
2836Maximize Value of Function in a Ball Passing Game
2850Minimum Moves to Spread Stones Over Grid
2876Count Visited Nodes in a Directed Graph
2924Find Champion II
2959Number of Possible Sets of Closing Branches
3108Minimum Cost Walk in Weighted Graph
3112Minimum Time to Visit Disappearing Nodes
3123Find Edges in Shortest Paths
3235Check if the Rectangle Corner Is Reachable
3243Shortest Distance After Road Addition Queries I
3244Shortest Distance After Road Addition Queries II
3265Count Almost Equal Pairs I
3267Count Almost Equal Pairs II
3276Select Cells in Grid With Maximum Score
3310Remove Methods From Project
3341Find Minimum Time to Reach Last Room I
3342Find Minimum Time to Reach Last Room II
3376Minimum Time to Break Locks I
3377Digit Operations to Make Two Integers Equal
3378Count Connected Components in LCM Graph
3383Minimum Runes to Add to Cast Spell
3385Minimum Time to Break Locks II
3387Maximize Amount After Two Days of Conversions
3419Minimize the Maximum Edge Weight of Graph
3435Frequencies of Shortest Supersequences
3481Apply Substitutions
3493Properties Graph
3532Path Existence Queries in a Graph I
3534Path Existence Queries in a Graph II
3536Maximum Product of Two Digits
3547Maximum Sum of Edge Values in a Graph
3594Minimum Time to Transport All Individuals
3600Maximize Spanning Tree Stability with Upgrades
3604Minimum Time to Reach Destination in Directed Graph
3620Network Recovery Pathways
3650Minimum Cost Path with Edge Reversals
3656Determine if a Simple Graph Exists
3660Jump Game IX
3710Maximum Partition Factor
3778Minimum Distance Excluding One Maximum Weighted Edge
3873Maximum Points Activated with One Addition
3887Incremental Even-Weighted Cycle Queries
3910Count Connected Subgraphs with Even Node Sum
3928Minimum Cost to Buy Apples II
3970Shortest Path With At Most K Consecutive Identical Characters
3977Minimum Time to Reach Target With Limited Power