Plan Parallel Deployment Waves for Volcano Engine Microservices
Last updated: November 29, 2026
Quick Overview
Given n services and dependency pairs (a, b) meaning b may only deploy after a finishes, return the services grouped into the fewest sequential waves where each wave deploys in parallel, or None if the dependencies contain a cycle.
ByteDance
November 29, 20260
0
0 solved
Given n services and dependency pairs (a, b) meaning b may only deploy after a finishes, return the services grouped into the fewest sequential waves where each wave deploys in parallel, or None if the dependencies contain a cycle.
Volcano Engine, ByteDance's cloud business, rolls out interdependent services in stages, and release tooling questions like this appear in ByteDance technical screens. The interviewer wants Kahn's algorithm processed level by level and a clean cycle check.
What the Interviewer Expects
- Model services as a DAG with in-degrees
- Process zero in-degree nodes as a whole wave
- Argue that level-by-level Kahn gives the minimum number of waves
- Detect cycles by counting processed nodes
- State O(V + E) time
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Each wave can deploy at most k services: is greedy still optimal?
- Services have deploy durations: return the earliest finish time.
- Which single dependency, if removed, shortens the plan most?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: n services labeled 0 to n-1 and a list of (before, after) edges. Output: a list of waves; every edge goes from an earlier wave to a later one. If a cycle exists, return None so the release tool...
High-Level Design
Kahn's algorithm, but instead of popping one node at a time, take every node with in-degree zero as the current wave. Removing the wave lowers in-degrees of its successors, and those that reach zero f...