Link Buyer Accounts That Share Payment or Shipping Details
Last updated: November 29, 2026
Quick Overview
Given accounts as (account_id, list of identifiers such as card fingerprints, addresses or phone numbers), group accounts that are connected directly or transitively through any shared identifier, and return the groups.
eBay
November 29, 20260
0
0 solved
Given accounts as (account_id, list of identifiers such as card fingerprints, addresses or phone numbers), group accounts that are connected directly or transitively through any shared identifier, and return the groups.
eBay's trust and safety teams link accounts to catch shill bidding, where a seller bids on their own items from a second account, and to spot buyer fraud rings. This onsite problem checks union find, path compression, and the judgment to talk about noisy shared identifiers like a warehouse address.
What the Interviewer Expects
- Map each identifier to the first account that used it
- Union accounts sharing an identifier
- Use path compression and union by size
- Return deterministic sorted groups
- Discuss false links from very common identifiers
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
- Some identifiers (a freight forwarder address) are shared by thousands of honest users. How do you avoid linking them?
- Support adding accounts online and querying whether two accounts are linked.
- How would you run this over hundreds of millions of accounts in Spark?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: a list of (account_id, identifiers). Two accounts are linked if they share any identifier, and linking is transitive. Output: each group as a sorted list of account ids, groups sorted. Accoun...
High-Level Design
This is connected components on a bipartite graph of accounts and identifiers. Rather than building the graph, keep owner[identifier] = the first account index that used it, and union every later ac...