Merge Gamer Profiles That Share Linked Email Addresses
Last updated: November 29, 2026
Quick Overview
Each Xbox profile record has a gamertag and a list of linked email addresses; two records belong to the same person if they share any email, directly or through a chain. Group the records and return each person's gamertags and the union of their emails.
Microsoft
November 29, 20260
0
0 solved
Each Xbox profile record has a gamertag and a list of linked email addresses; two records belong to the same person if they share any email, directly or through a chain. Group the records and return each person's gamertags and the union of their emails.
Identity consolidation comes up across Microsoft accounts, Xbox, and LinkedIn, where duplicate or legacy profiles must be linked before features like family settings or purchase history work. The interviewer is checking that you see transitive grouping as connected components and pick union-find or graph traversal deliberately.
What the Interviewer Expects
- Recognizes transitive sharing as connected components
- Uses union-find with path compression or BFS over an email graph
- Normalizes emails (case) and handles accounts with no emails
- Produces deterministic output ordering
- Analyzes complexity in terms of total emails
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- New records arrive continuously: how do you update groups incrementally?
- How would you split a group if a user unlinks an email?
- At 500 million records, how would you run this as a distributed batch job?
- What privacy or abuse risks come from automatically merging identities?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Two records are the same person if they share an email, and the relation is transitive. Emails are case-insensitive. Records with no email stand alone. Output a list of (gamertags, emails) groups, e...
High-Level Design
Build a bipartite graph between record nodes and email nodes; people are its connected components. Union-find is a clean fit because I only need to union each record with each of its emails and later ...