Link Buyer Accounts Sharing Payment Or Device Fingerprints

Last updated: November 29, 2026

Quick Overview

Given a list of accounts, each with a set of identifiers such as card fingerprints, shipping addresses, and device ids, group together all accounts that are connected directly or transitively through any shared identifier.

Whatnot
Coding & Algorithms
Software Engineer
Whatnot
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Given a list of accounts, each with a set of identifiers such as card fingerprints, shipping addresses, and device ids, group together all accounts that are connected directly or transitively through any shared identifier.

Trust and safety at Whatnot has to catch shill bidding and buyers who rack up unpaid orders across many accounts. This question checks whether you see the transitive grouping as union-find and can explain path compression in plain terms.

What the Interviewer Expects
  • Recognize transitive connectivity and choose union-find or BFS
  • Map each identifier to the first account that used it
  • Union accounts through shared identifiers
  • Keep accounts with no shared identifiers as singletons
  • Discuss very common identifiers that would over-merge
Key Topics to Cover
union find
path compression
hashing
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
  • A shared office address links hundreds of unrelated accounts. How do you prevent that?
  • How would you update groups incrementally as new accounts sign up?
  • How would you split a group if an identifier is later found to be bad data?
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: [(account_id, [identifiers])]. Two accounts are in the same group if they share any identifier, or are linked through a chain of accounts that do. Output a sorted list of groups, each a sorte...

High-Level Design

Treat accounts as nodes. Instead of comparing every pair (quadratic), keep owner[identifier] pointing at the first account that used it. When another account shows the same identifier, union the two...


Submit Your Answer
Markdown supported

Related Questions