Debug DAG Execution Order Code
Given Python code that determines the correct execution order of nodes in a Directed Acyclic Graph (DAG) representing a step function, identify and fix the bug(s) in the provided implementation.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late September, 2026
It was not straight forward leetcode question where I can just implement code and solve problem. Interviewer gave long winded description of problem with table(which interviewer couldn't paste in livecode), problem basically boils down to Directed Acyclic graph and we need to find order of execution. But twist was I don't need to code, he pasted python code and asked to find problem in it. Unfortunately python is not my primary preferred language, I am comfortable in Java, but no consideration given to that. I was surprised, apart from solving core problem and debugging now I have to take cogintive load of translating syntax of language I am not comfortable with.
Your account is free and you can post anonymously if you choose.