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
Coding & Algorithms
Software Engineer
eBay
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

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
union find
connected components
path compression
fraud detection
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
  • 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 Problems
Sample 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...


Submit Your Answer
Markdown supported

Related Questions