Return the Lexicographically Smallest Topological Order
Company: OpenAI
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Overview: Return the lexicographically smallest valid ordering of a directed dependency graph, or an empty result when a cycle exists. The problem tests deterministic graph processing, duplicate-edge handling, isolated nodes, and rigorous complexity analysis.