For GATE purpose, without actually applying DFS, we can answer by just seeing options.
In DFS, we go in depth first i.e., one node to another in depth first order.
Here, $abfehg$ is not possible as we can not go from $f$ to $e$ directly.
Thus, option $(D)$ is correct.
In all the other options we can reach directly from the node to the next node.
So, just visualize and do.