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
Coding & Algorithms
Software Engineer
ByteDance
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

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
topological sort
Kahn's algorithm
DAG levels
cycle detection
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported