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
Coding & Algorithms
Software Engineer
Meta
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

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
Bitmask DP
Set cover
Subset states
Reconstruction
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
  • 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 Problems
Sample 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...


Submit Your Answer
Markdown supported