In a recent interview I was asked below question.
Given a set of nodes and edges with a start Node point to final end node. In the below diagram it starts at 1 ends at 15. Their question was given the Node 2 (or any node) as the starting point how can we find the next node in its path whose input edges are not all reachable from the Node 2 (ie how can we reach 14).
How can I do this, pseudo code should be fine.

i do not see any way to avoid traversing the entire graph at least once (assuming nodes do not have links to parents). if that is ok, then a simple solution based on maps from nodes to the set of immediate parents (‘parent map’ below) is:
write a routine that extends a parent map for all nodes below a starting node (using dfs). the routine does not need to explore nodes that are already keys in the map.
call the routine above for every node in the graph. this gives a complete map from nodes to parents (the transpose of the graph, effectively).
call the routine above from the given node in the question (eg 2), with a new map. this gives a map from nodes to parents reachable from 2.
using a bfs from the given node, find the first node where the parents in the two maps differ.
you don’t need to store the actual parent nodes in the map (it’s just easiest to explain that way); you could do something similar by marking visited nodes and storing a count of the number of parents.
and yet another way of saying this: find the transpose of the graph and the set of nodes reachable from the given node. then bfs from the given node to find the first node where the transpose leads to a parent outside the reachable set. (which really is just the question…)