Return the Lexicographically Smallest Topological Order

Quick 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.

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.

|Home/Coding & Algorithms/OpenAI
OpenAI logo
OpenAI
Aug 1, 2026
mediumSoftware EngineerOnsiteCoding & Algorithms
71
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...