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

Posted
20 Jun 2024
312 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.

How it went

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.

Questions asked (1)

  1. 01

    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

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Google recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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