Essential Graph Problems for SDE Interviews
If you're having your placement season in a few months or want to revise graph concepts, I've made a list of hand-picked problems to cover the depth and breadth of graphs.
This isn't a magic list that guarantees you'll crack every interview or assessment. But these are standard problems and patterns I've consistently seen across interview experiences, company blogs, and my own preparation journey.
I've organized these by pattern because that's how interviews work, they don't ask "solve graph problem #47." They ask problems that test whether you understand BFS, topological sort, or Union Find. Once you recognize the pattern, the solution follows.
Think of this as your focused revision toolkit. Not too overwhelming, not too sparse. just the right problems to build strong pattern recognition.
Let's gooo!
Connect with me on LinkedIn to stay updated with more coding resources, interview tips, and problem-solving strategies!
Problem List by Pattern
1. Graph Traversal (DFS/BFS Fundamentals)
- Number of Islands
- Clone Graph
- Max Area of Island
- Pacific Atlantic Water Flow
- Number of Connected Components in an Undirected Graph
- Surrounded Regions
- Keys and Rooms
- Count Sub Islands
- Flood Fill
- Island Perimeter
2. Shortest Path Problems
- Shortest Path in Binary Matrix
- Rotting Oranges
- 01 Matrix
- Walls and Gates
- Shortest Bridge
- Network Delay Time
- Path with Maximum Probability
- Cheapest Flights Within K Stops
- Minimum Cost to Make at Least One Valid Path in a Grid
- Shortest Routes I
3. Topological Sort & Dependency Resolution
- Course Schedule
- Course Schedule II
- Alien Dictionary
- Sequence Reconstruction
- Minimum Height Trees
- Parallel Courses
- Sort Items by Groups Respecting Dependencies
- Course Schedule IV
- Game Route
4. Union Find (Disjoint Set Union)
- Number of Provinces
- Redundant Connection
- Graph Valid Tree
- Accounts Merge
- Most Stones Removed with Same Row or Column
- Smallest String With Swaps
- Satisfiability of Equality Equations
- Number of Operations to Make Network Connected
- Lexicographically Smallest Equivalent String
- Minimize Malware Spread
5. Cycle Detection
6. Graph Coloring & Bipartite Graphs
7. Minimum Spanning Tree
- Min Cost to Connect All Points
- Connecting Cities With Minimum Cost
- Optimize Water Distribution in a Village
- Find Critical and Pseudo-Critical Edges in MST
- Road Construction
8. Advanced DFS/BFS Applications
- Word Ladder
- Word Ladder II
- Minimum Genetic Mutation
- Open the Lock
- Sliding Puzzle
- Snakes and Ladders
- Bus Routes
- Shortest Path to Get All Keys
9. Advanced Graph Algorithms
- Critical Connections in a Network
- Reconstruct Itinerary
- Evaluate Division
- Longest Increasing Path in a Matrix
- Swim in Rising Water
- Shortest Path Visiting All Nodes
- Reachable Nodes In Subdivided Graph
- Minimum Number of Days to Disconnect Island
- Number of Ways to Arrive at Destination
10. Matrix & Grid Graph Problems
- As Far from Land as Possible
- Shortest Path in a Grid with Obstacles Elimination
- Escape a Large Maze
- Shortest Path with Alternating Colors
- Time Needed to Inform All Employees
11. Graph Construction & Modeling
- Reconstruct a 2-Row Binary Matrix
- Check if There is a Valid Path in a Grid
- Water and Jug Problem
- Pyramid Transition Matrix
12. Competitive Programming Classics
- Labyrinth
- Building Roads
- Message Route
- Building Teams
- Round Trip
- Monsters
- Shortest Routes II
- High Score
- Flight Discount
- Cycle Finding
- Flight Routes
- Planet Queries I
- Road Reparation
- ABC 139 E - League
- ABC 168 D - .. (Double Dots)
- ABC 176 D - Wizard in Maze
- ABC 209 E - Shiritori
- ARC 090 D - People on a Line
Let's connect on LinkedIn - I regularly share interview tips, problem-solving strategies, and coding resources that can help accelerate your preparation!
Good luck!