HARDasked at 1 company

Reachable Nodes In Subdivided Graph

A hard-tier problem at 51% community acceptance, tagged with Graph, Heap (Priority Queue), Shortest Path. Reported in interviews at PhonePe and 0 others.

Founder's read

Reachable Nodes In Subdivided Graph is a hard graph problem that combines shortest-path logic with subdivision rules. It shows up in interviews at PhonePe and similar companies that care about pathfinding edge cases. The twist: edges in the graph contain intermediate nodes you can visit, and you need to count how many you can reach within a move limit. The acceptance rate sits at roughly 51%, meaning most candidates either miss the subdivision model or implement Dijkstra's incorrectly for this variant. If this problem hits your live assessment and the subdivision mechanic confuses you, StealthCoder solves it invisibly in seconds.

Companies asking
1
Difficulty
HARD
Acceptance
51%

Companies that ask "Reachable Nodes In Subdivided Graph"

If this hits your live OA

Reachable Nodes In Subdivided Graph is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage.

Get StealthCoder
What this means

The trap is treating this like a standard shortest-path problem. Standard Dijkstra finds the shortest distance to each node, but here you must also count intermediate nodes along each edge. When you traverse an edge subdivided into k nodes, you can visit min(remaining_moves, k) of those intermediate nodes before reaching the destination. Build a priority queue storing (moves_spent, node), run Dijkstra, and track both shortest distance and the count of intermediate nodes reachable on each edge. Most failures come from either ignoring the subdivision logic entirely, forgetting to check if an intermediate node was already counted from another path, or miscalculating how many intermediate nodes fit in your remaining budget. When you hit this live and the subdivision model isn't intuitive, StealthCoder runs invisibly during screen share and surfaces the working solution without proctor visibility.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Reachable Nodes In Subdivided Graph recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Reachable Nodes In Subdivided Graph interview FAQ

Is Reachable Nodes really asked at FAANG or top companies?+

It's confirmed asked at PhonePe. The acceptance rate at 51% shows it's a real, selective filter. Not every company asks it, but those that do are testing deep graph understanding beyond basic BFS or Dijkstra. It's a second-wave interview question, not a warm-up.

What's the key trick I'm missing if I try a simple Dijkstra?+

Standard Dijkstra only tracks distance to each node, not the intermediate nodes on edges. Here, you must count how many nodes lie between two connected nodes and determine how many you can visit with remaining moves. The subdivision logic is the entire problem, not a side detail.

Do I need to store the full graph structure differently?+

Yes. Each edge stores a weight that represents subdivisions (intermediate nodes). When you process an edge, you calculate how many intermediate nodes you can reach given your remaining move budget. This changes both your priority queue logic and your visited tracking.

How does this problem relate to standard shortest path topics?+

It's Dijkstra plus constraint arithmetic. The shortest-path framework is the skeleton, but you're optimizing a custom metric: reachable intermediate nodes under a move limit. Heap operations and priority queue logic are standard, but the state you track in the queue is non-standard.

What's a common implementation mistake?+

Counting the same intermediate node twice from different paths, or not tracking which intermediate nodes on an edge have already been visited. You also need to avoid revisiting edges when you've already maxed out intermediate nodes on that edge from a shorter path.

Want the actual problem statement? View "Reachable Nodes In Subdivided Graph" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.