New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Meta
Coding Question
AI Insights
Quick Summary
Identify dependencies that execute exclusively at specific time steps without others running in parallel.
Model the dependencies as a Directed Acyclic Graph (DAG) where edges represent prerequisite relationships.
Simulate the build process level-by-level using a BFS approach to detect when only one task is ready.
What This Tests
Graph representation using adjacency lists
Topological sorting and in-degree management
Level-order traversal logic
Simulating concurrency constraints
Common Patterns
Graph Traversal
BFS
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Accepted
2.2k
/4.3k
Acceptance Rate
50.3%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
n =
edges =
Output
Expected