Cluster Applications Linked by Shared Devices or Bank Accounts

Last updated: November 29, 2026

Quick Overview

Each loan application lists identifiers it used, such as device fingerprints and bank account numbers. Two applications are linked if they share any identifier, and linking is transitive; return all clusters of two or more applications.

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

0

0

0 solved


Each loan application lists identifiers it used, such as device fingerprints and bank account numbers. Two applications are linked if they share any identifier, and linking is transitive; return all clusters of two or more applications.

Fraud rings on an online lending platform often reuse devices and bank accounts across synthetic identities, so Upstart's fraud tooling needs connected components over shared attributes. The onsite coding round checks that you see the transitive closure and reach for union find instead of quadratic pair comparisons.

What the Interviewer Expects
  • Recognize this as connected components
  • Avoid comparing every pair of applications
  • Union each application with the first owner of each identifier
  • Use path compression and union by size
  • Return clusters in a deterministic order
Key Topics to Cover
union find
connected components
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
  • Some identifiers, like a public library IP, are shared by thousands of honest users. How do you keep them from merging everything?
  • How would you support new applications arriving in a stream?
  • Could you also report which identifiers caused each merge for an investigator?
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 mapping from application id to a list of typed identifiers. Output: sorted clusters (each sorted) with at least two applications. Identifiers are typed tuples so a device id never collides wi...

High-Level Design

Keep a map from identifier to the first application that used it. For every later application with that identifier, union the two. After all unions, group applications by their root. This is O(total i...


Submit Your Answer
Markdown supported