FastPrepEmployees With Shared Interests
Problems/Employees With Shared Interests

Employees With Shared Interests

Palantir logoPalantir● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Palantir phone screen. The report describes finding people with shared interests from employee records and IDs. It does not give a target employee, the exact rule for what to return, or the data.

For this exercise, every employee who shares a label with another employee is selected. We chose the input layout, the exact-match rule, distinct IDs, the output order, the limits, and the examples.

Our version is about 65% the same as the reported question.

Return the IDs of all employees who share an interest with at least one other employee.

For this exercise, assume employeeIds[i] identifies employee i and interests[i] lists that employee's interest labels. A shared interest means an exact match of a whole label. Repeating a label within one employee's list does not create a match with another employee.

Return each qualifying employee ID once, in increasing numeric order. Return an empty array if no employee qualifies.

Function

sharedInterestEmployees(employeeIds: int[], interests: String[][]) → int[]

Examples

Example 1

employeeIds = [30,10,20]interests = [["hiking","hiking"],["hiking"],["chess"]]return = [10,30]

Employees 30 and 10 share hiking. Repeating hiking for employee 30 does not add another employee. Employee 20's chess label is not shared, so the sorted result is [10,30].

Example 2

employeeIds = [7,4]interests = [["art","art"],[]]return = []

Only employee 7 has art, and employee 4 has no labels. The repeated art label does not connect two different employees, so no ID qualifies.

Example 3

employeeIds = [40,10,30,20]interests = [["art"],["ski"],["art","ski"],["chess"]]return = [10,30,40]

Employees 40 and 30 share art. Employees 10 and 30 share ski. Employee 30 qualifies through both labels but appears once, while employee 20 shares no label. Sorting the qualifying IDs gives [10,30,40].

Constraints

  • 0 <= employeeIds.length <= 100.
  • interests.length == employeeIds.length.
  • Every employee ID is in [1, 1000000000].
  • Employee IDs are distinct.
  • Each interest row contains 0 to 20 labels.
  • Every label contains 1 to 20 lowercase ASCII letters a-z.

More Palantir interview questions

  • Query Words Within K PositionsPHONE SCREEN · Seen Nov 2026
  • Balanced Session ManagerPHONE SCREEN · Seen Oct 2026
  • Merge a 2048 RowPHONE SCREEN · Seen Jan 2025
  • Encrypt Letters by First-Occurrence SubstitutionPHONE SCREEN · Seen Aug 2022
  • Encrypt Text by Columnar TranspositionPHONE SCREEN · Seen Aug 2022
  • Basic Item DiscountsOA · Seen Nov 2026
  • Optimize Discount Selection Under a Point BudgetOA · Seen Nov 2026
  • Stacked Item and Category DiscountsOA · Seen Nov 2026
  • Map and Accumulate Learning QueriesONSITE INTERVIEW · Seen Oct 2026
  • Relational Learning QueriesONSITE INTERVIEW · Seen Apr 2025

Similar questions at other companies

  • Shared Courses for Every Pair of StudentsCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
  • Remove Later Anagrams From a ListBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Group AnagramsWorkday · PHONE SCREEN
  • Process Shopping Records, Promotions, and Display OrderInstacart · PHONE SCREEN · ONSITE INTERVIEWInstacart interview questions
  • Find Duplicate File GroupsAnthropic · PHONE SCREENAnthropic interview questions
  • Insert an Employee into an Organization HierarchyWaymo · PHONE SCREENWaymo interview questions
  • Group AnagramsMotive · PHONE SCREEN · ONSITE INTERVIEWMotive interview questions
  • Stable Top K Frequent WordsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Find Duplicate Image FilesAbnormal Security · PHONE SCREEN

Interview reports that mention this question

  • Palantir FDSE Experienced-Hire Interviews: 5 Experiences

Palantir interview experiences

  • Palantir FDSE New Grad OA Questions: 6 Experiences (Part 2 of 2)
  • Palantir FDSE New Grad Interviews: 5 Experiences (Part 1 of 2)
  • Palantir FDSE Intern OA and Interviews: 3 Experiences
  • Palantir FDSE Karat and Learning: 7 Experiences (Part 2 of 2)
  • Palantir FDSE OA and Interviews: 16 Experiences (Part 1 of 2)
All Palantir interview questionsSee Palantir hiring insights
Saved
class Solution {
    public int[] sharedInterestEmployees(int[] employeeIds, String[][] interests) {
        return new int[0];
    }
}
Checking account…