Find Card Testing Rings Through Shared Fingerprints And Devices
Last updated: November 29, 2026
Quick Overview
Given payment attempts with account, card fingerprint, device id, and a declined flag, group accounts that are connected through any shared card or device, and flag groups at or above a minimum size whose combined decline rate is at least a threshold.
Patreon
November 29, 20260
0
0 solved
Given payment attempts with account, card fingerprint, device id, and a declined flag, group accounts that are connected through any shared card or device, and flag groups at or above a minimum size whose combined decline rate is at least a threshold.
Because Patreon is the merchant of record and absorbs fraud and chargeback risk, low-dollar card testing through cheap tiers is a real threat. This onsite coding question checks whether you recognize connected components, implement union-find correctly, and aggregate metrics per component.
What the Interviewer Expects
- Recognizes the problem as connected components over a bipartite account to attribute graph
- Implements union-find with path compression and union by size
- Avoids O(n^2) pairwise comparisons by remembering the first owner of each attribute
- Aggregates attempts and declines per component, not per account
- Handles missing attributes (null device ids) without merging everything
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
- A shared public Wi-Fi device id or a common corporate card joins unrelated users. How do you limit giant components?
- How would you make this incremental as attempts stream in?
- Which extra signals would you add before auto-blocking, and what is the cost of a false positive for a real patron?
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 accounts are linked if they used the same card fingerprint or the same device. Linking is transitive. For each resulting group with at least min_size accounts, compute declines divided by attemp...
High-Level Design
Model accounts and attributes as a graph and find connected components. Instead of creating attribute nodes, keep first_owner[(kind, value)]; when a later account shows the same attribute, union it ...