FastPrepMaximum Programmer-Problem Matching
Problems/Maximum Programmer-Problem Matching

Maximum Programmer-Problem Matching

Google logoGoogle● MediumNEW GRADPHONE SCREENONSITE INTERVIEW
QuestionFunctionExamples

Problem statement

Source note: PhD Intern — A 2026 Google internship report described matching people to questions by shared tags, then improving lookup with a hash map; a priority-queue follow-up was mentioned but not specified enough to formalize. The existing canonical task keeps the maximum matching formulation. Earlier evidence omitted input limits, the original method name, and whether to return an assignment or only its size.

Each problem has a list of tags, and each programmer has a list of skills. A programmer is compatible with a problem when the programmer's skills and the problem's tags share at least one identical string.

Match programmers to problems so that each programmer and each problem appears in at most one pair. Return the maximum possible number of compatible pairs.

Function

maximumProblemMatches(problemTags: List<List<String>>, programmerSkills: List<List<String>>) → int

Examples

Example 1

problemTags = [["java"], ["python", "sql"], ["go"]]programmerSkills = [["java", "python"], ["java"], ["rust", "go"]]return = 3

The first programmer can take the Python problem, the second programmer can take the Java problem, and the third programmer can take the Go problem. These three pairs use every programmer and problem once, so no larger matching is possible.

Example 2

problemTags = [["java"], ["python"], ["sql"]]programmerSkills = [["java", "python"], ["python"]]return = 2

Match the first programmer to the Java problem and the second programmer to the Python problem. Only two programmers are available, so the maximum is 2.

More Google problems

  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • 0/1 Knapsack with Weight and Volume LimitsONSITE INTERVIEW · Seen Nov 2026
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public int maximumProblemMatches(List<List<String>> problemTags, List<List<String>> programmerSkills) {
        // Write your code here.
    }
}
Checking account…