Group Members Whose Normalized Skill Sets Are Identical

Last updated: November 29, 2026

Quick Overview

Given a list of (member_id, skills) pairs where skills is a list of free-text strings, group the member ids whose skill sets are identical after trimming whitespace, lowercasing, and ignoring order and duplicates. Return only groups with at least two members.

LinkedIn
Coding & Algorithms
Software Engineer
LinkedIn
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given a list of (member_id, skills) pairs where skills is a list of free-text strings, group the member ids whose skill sets are identical after trimming whitespace, lowercasing, and ignoring order and duplicates. Return only groups with at least two members.

A warm-up in the LinkedIn phone screen built around the Skills section of a profile. The interviewer checks whether you pick a hashable canonical key quickly and handle messy user input without overengineering.

What the Interviewer Expects
  • Normalizes each skill string (strip, lowercase) before comparing
  • Uses a frozenset or sorted tuple as a hashable canonical key
  • Groups with a dictionary in one pass over the input
  • Filters out singleton groups and keeps output deterministic
  • States linear time in total skill characters
Key Topics to Cover
hashing
canonical keys
frozenset
string normalization
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you treat synonyms such as 'JS' and 'JavaScript'?
  • What changes if members are near-identical, sharing 90% of skills?
  • How would you run this across 1 billion profiles in a batch job?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: list of (member_id, skills); skills may contain casing differences, extra spaces, and repeats. Two members match when their sets of normalized skills are equal. Output: list of groups (each a...

High-Level Design

Build a canonical key per member: frozenset(s.strip().lower() for s in skills if s.strip()). A frozenset ignores order and duplicates and is hashable, so a single defaultdict(list) buckets members...


Submit Your Answer
Markdown supported