Group Firmware Modules Into Parallel Boot Stages
Last updated: November 29, 2026
Quick Overview
Given SoC firmware modules and pairs (module, prerequisite), return the modules grouped into boot stages so each stage only depends on earlier stages and the number of stages is minimal. If the dependencies contain a cycle, report the modules that can never start.
Qualcomm
November 29, 20260
0
0 solved
Given SoC firmware modules and pairs (module, prerequisite), return the modules grouped into boot stages so each stage only depends on earlier stages and the number of stages is minimal. If the dependencies contain a cycle, report the modules that can never start.
Snapdragon boot brings up PMIC, clocks, DDR, then subsystems like modem, GPU and WLAN, and independent pieces can start in parallel to cut boot time. Qualcomm onsite coding rounds like this kind of dependency problem because it tests topological sort plus the extra twist of level grouping and clear error reporting.
What the Interviewer Expects
- Models modules as a DAG with edges from prerequisite to dependent
- Uses Kahn's algorithm level by level so each level is a parallel stage
- Argues why level grouping gives the minimum number of stages (longest path)
- Detects cycles by counting processed nodes and reports the blocked set
- Validates unknown module names and sorts within a stage for deterministic output
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
- If each module has a start-up time, how do you compute the minimum total boot time with unlimited parallelism?
- With only K CPU cores available, how does the problem change?
- How would you report the actual cycle, not just the blocked modules?
- How would you handle optional dependencies that can be skipped if missing?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
- Inputs: list of module names, list of
(module, prerequisite)pairs. - Output: list of stages, each a sorted list of modules.
- Every module appears in exactly one stage, after all its prerequisite...
High-Level Design
Build in-degree counts and an adjacency list from prerequisite to dependent. Start stage 0 with all in-degree 0 modules. Process a whole stage at a time: decrement in-degrees of dependents, and those ...