FastPrepSmallest Sufficient Team
Problems/Smallest Sufficient Team

Smallest Sufficient Team

Expedia logoExpedia● MediumFULLTIMEONSITE INTERVIEW
QuestionFunctionExamplesConstraints

Problem statement

Source note: The reported task identifies this algorithmic exercise. The executable interface, bounds, deterministic tie rules, and examples are the documented practice contract.

Given a list of distinct required skills and the skills held by each person, return indices of a smallest team whose combined skills cover every required skill.

If several minimum-size teams exist, return the lexicographically smallest increasing index list. Every input has at least one sufficient team.

Function

smallestSufficientTeam(requiredSkills: String[], peopleSkills: List<List<String>>) → int[]

Examples

Example 1

requiredSkills = ["java","sql","aws"]peopleSkills = [["java"],["sql"],["aws"],["java","sql"]]return = [2,3]

No one has all three skills, so a team needs at least two people. Persons 2 and 3 cover java, sql and aws together; every other pair misses a skill.

Example 2

requiredSkills = ["a"]peopleSkills = [["a"]]return = [0]

The only person has the only skill, so the team is [0].

Example 3

requiredSkills = ["a","b"]peopleSkills = [["a"],["b"],["a","b"]]return = [2]

Person 2 alone has both skills, so one person is enough. Persons 0 and 1 also cover both, but that team is larger.

Constraints

  • 1 <= requiredSkills.length <= 16.
  • 1 <= peopleSkills.length <= 60.
  • Skill names are case-sensitive; unrequired skills may be ignored.

More Expedia problems

  • Scramble StringONSITE INTERVIEW · Seen Sep 2026
  • Balanced NumbersOA · Seen Aug 2026
  • REST API: Discounted PriceOA · Seen Aug 2026
All Expedia interview questionsSee Expedia hiring insights
Saved
class Solution {
    public int[] smallestSufficientTeam(String[] requiredSkills, List<List<String>> peopleSkills) {
        // Write your code here.
    }

}
Checking account…