Microsoft Interview Question

They asked me a topological sort graph question it was moderated version of a leetcode hard