Search
⌘K

Leetcode 1971. Find if Path Exists in Graph

Given an undirected graph (n up to 2×10^5) as an edge list, determine whether there exists any path between the given source and destination vertices — a connectivity check typically solved with graph traversal or union‑find in O(n + m) time.

Asked at:

Meta

Microsoft

Microsoft


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid January, 2026

Microsoft

Microsoft

Senior

Early October, 2024

Meta

Mid-level

Shortest Path in a Social Network: Given a directed social network graph, find the minimum number of steps to reach a target person from a starting person. Return -1 if not possible.

Early October, 2024

Meta

Mid-level

Shortest Path in a Social Network: Given a directed social network graph, find the minimum number of steps to reach a target person from a starting person. Return -1 if not possible.

Comments

Your account is free and you can post anonymously if you choose.