← Flipkart questions

Find Source Node in DAG in Linear Time

Filed under Flipkart

Given a Directed Acyclic Graph (DAG) where the source node is unknown, find a single source node that can reach all other nodes in O(N) time complexity, if such a node exists.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Flipkart questions

Collected from public candidate posts and coding forums. Updated Nov 2026.