Order Tasks with Dependencies Using a Deterministic Topological Sort

Quick Overview

Return the lexicographically smallest valid task order from a directed acyclic dependency graph, including disconnected and prerequisite-free tasks.

Order Tasks with Dependencies Using a Deterministic Topological Sort

Company: OpenAI

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Return the lexicographically smallest valid task order from a directed acyclic dependency graph, including disconnected and prerequisite-free tasks.

OpenAI logo
OpenAI
Sep 17, 2026
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
Loading...