Smallest Group of Engineers Covering Every Required On-Call Skill
Last updated: November 29, 2026
Quick Overview
An incident needs up to 16 required skills, and each of up to 60 engineers has a subset of them. Return the indices of a smallest group whose combined skills cover all required skills.
Meta
November 29, 20260
0
0 solved
An incident needs up to 16 required skills, and each of up to 60 engineers has a subset of them. Return the indices of a smallest group whose combined skills cover all required skills.
A Meta onsite question that tests bitmask dynamic programming over subsets, framed around staffing an incident response for a large outage. The interviewer checks whether you notice the small skill count, encode skill sets as masks, and reconstruct the chosen team.
What the Interviewer Expects
- Recognize set cover is NP-hard in general but tractable with 16 skills
- Encode each engineer's skills as a bitmask
- Run DP over 2^m skill masks storing the smallest team
- Reconstruct the team, not just its size
- Prune engineers whose skills are a subset of another's
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
- What if each engineer has a cost and you minimize total cost?
- How would you handle 40 required skills?
- How do you return all optimal teams?
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: list required of m <= 16 skill names, and people, a list where each entry lists skill names. A cover is guaranteed to exist. Output: list of person indices of minimum size whose union conta...
High-Level Design
Map each required skill to a bit, so each person becomes a mask. Let dp[mask] be the smallest team (as a list of indices, or size plus a parent pointer) that covers at least the skills in mask. Star...