Execute Async Tasks Respecting a Dependency Graph (Build System Simulation)

Given a list of async tasks where each task may declare dependencies (other tasks that must complete first), implement a scheduler that resolves the dependency graph (using topological sort) and executes tasks in the correct order — running independent tasks in parallel where possible and waiting for dependencies to complete before starting dependent tasks. This is exactly how build tools like Webpack, Vite, and Make work internally, and is asked for Staff/Principal-level frontend roles.

Examples
Input: []
Output:
Hints

Execute Async Tasks Respecting a Dependency Graph (Build System Simulation)

Given a list of async tasks where each task may declare dependencies (other tasks that must complete first), implement a scheduler that resolves the dependency graph (using topological sort) and executes tasks in the correct order — running independent tasks in parallel where possible and waiting for dependencies to complete before starting dependent tasks. This is exactly how build tools like Webpack, Vite, and Make work internally, and is asked for Staff/Principal-level frontend roles.