Skip to main content
Interview

Graph problems that keep appearing in interviews - a compilation

Sachin AhujaSachin Ahuja
11 months ago
192

After giving 15+ interviews this year, here are graph problems I've seen repeatedly:

BFS/DFS based:

  • Number of islands
  • Clone graph
  • Word ladder
  • Rotten oranges

Shortest path:

  • Network delay time (Dijkstra)
  • Cheapest flights within K stops

Topological Sort:

  • Course schedule I and II
  • Alien dictionary

Union Find:

  • Number of connected components
  • Accounts merge

If you can solve all of these comfortably, you'll handle 90% of graph questions in interviews imo.


graphsinterview-prepcompilationdsa

Comments (4)

Sign in to join the discussion.
Shivam Goyal
Shivam Goyal10 months ago

I keep messing up on 'Network delay time'. I always mix up Dijkstra and Bellman-Ford. Any advice?

Ritesh Pandey
Ritesh Pandey11 months ago

Do you think these problems cover other graph concepts like bipartite graphs or Euler circuits? Haven't seen them mentioned.

Vera Chen
Vera Chen11 months ago

Wow, this is super helpful! How often did you get asked about topological sort problems? They seem a bit niche to me.

Anna Mueller
Anna Mueller11 months ago(edited)

I'm having trouble with the 'word ladder' problem. Any tips for tackling it efficiently?