Google Challenger Question - Find the Optimum solution for Question and Volunteer scenario

google logo
google
June 20, 202430 reads

Summary

I recently encountered a challenging Google problem that focused on efficiently assigning support questions to a team of volunteers based on their tag specializations.

Full Experience

During a technical challenge from Google, I was presented with an intriguing problem centered around resource allocation. The task was to create an optimal assignment strategy for support questions, each tagged with various topics, to a group of volunteers. Each volunteer had a specific set of tags they were proficient in. The core constraints were that a question could only be assigned to one volunteer, and a successful assignment required at least one matching tag between the question and the volunteer. This problem required careful consideration of matching algorithms and optimization to achieve the desired outcome.

Interview Questions (1)

Q1
Assign Support Questions to Volunteers
Data Structures & Algorithms

You run a support questions and answers website like StackOverflow. Recently, the amount of questions has grown dramatically. A group of engineers has volunteered to help but each volunteer has a prioritized list of tags they can support. Volunteers must be assigned questions with tags from their personal tags list.

JSON input:

{
  "questions": [
    {
      "id": "0",
      "title": "how do i install vs code",
      "tags": ["mac", "vs code"]
    },
    {
      "id": "1",
      "title": "my program is too slow please help",
      "tags": ["python", "ai"]
    },
    {
      "id": "2",
      "title": "why is the hitbox off by 2 pixels",
      "tags": ["c#", "game"]
    },
    {
      "id": "3",
      "title": "my dependency injection stack trace is strange",
      "tags": ["java", "oop"]
    },
    {
      "id": "4",
      "title": "socket.recv is freezing",
      "tags": ["python", "networking"]
    },
    {
      "id": "5",
      "title": "i have a memory leak",
      "tags": ["c++", "networking"]
    }
  ],
  "volunteers": [
    {
      "id": "sam5k",
      "tags": ["python", "networking"]
    },
    {
      "id": "djpat",
      "tags": ["ai"]
    },
    {
      "id": "jessg",
      "tags": ["java", "networking"]
    },
    {
      "id": "rayo",
      "tags": ["java", "networking"]
    }
  ]
}

Constraints:

  • Question can be assigned to at most one volunteer.
  • At least one tag must match between question and volunteer.

Expected Output:

Question ID: 1, Assigned To: djpat
Question ID: 3, Assigned To: jessg
Question ID: 4, Assigned To: sam5k
Question ID: 5, Assigned To: rayo
Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!