FastPrepRecord Linkage Part 3 - Full Connected Component
Problems/Record Linkage Part 3 - Full Connected Component

Record Linkage Part 3 - Full Connected Component

Stripe logoStripe● MediumFULLTIMENEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: July 26, 2026 — 🌺 I re-audited the original author-written source and rebuilt this practice version from the available interview report. It is about a 90% match to the available source. The record fields, weighted similarity threshold, direct-link graph, one-additional-hop follow-up, and final full connected-component objective come directly from the author-written phone-screen report and its worked dataset. FastPrep supplies exact string equality as the field-similarity function, the CSV String[] adapter, deterministic sorting, constraints, and additional examples.

This continues the record-linkage problem. You get a list of user records, a weight for each field, a similarity threshold and a target record. Return every record that is connected to the target, either directly or through a chain of other records.

Inputs:

  • rows is a String[]. Each row has the form "id,name,email,company".
  • weights is a String[] of "field,weight" entries. Each field is one of name, email or company, and the weights add up to 1.
  • threshold is the similarity two records need to be linked.
  • targetId is the id of the target record.

To compare two records, look at each field. Every field that matches in both records adds its weight to their similarity. Two records are linked when their similarity is >= threshold.

Linkage is transitive. If A links to B and B links to C, then A, B and C are all in the same group, even when A and C are not linked directly. The records you can reach from the target through any chain of links form its connected component.

Return the ids of every record in the same connected component as targetId, leaving out the target itself. Return them as an int[] sorted in ascending order.

Function

findLinkedComponent(rows: String[], weights: String[], threshold: float, targetId: int) → int[]

Examples

Example 1

rows = ["1,Alice,alice@gmail.com,Stripe", "2,Alicia,alice@gmail.com,Stripe", "3,Alice,alice@yahoo.com,Google", "4,Bob,bob@gmail.com,Stripe"]weights = ["name,0.2", "email,0.5", "company,0.3"]threshold = 0.5targetId = 1return = [2]

Record 1 links directly to record 2 (similarity 0.8). Record 2 does not link to record 3 (0) or record 4 (0.3 < 0.5), and record 1 links to neither 3 nor 4. So the component of record 1 is {1, 2}; excluding the target, the answer is [2].

Example 2

rows = ["1,Alice,alice@gmail.com,Stripe", "2,Alicia,alice@gmail.com,Stripe", "3,Bob,bob@yahoo.com,Google", "5,Alicia,carol@outlook.com,Stripe"]weights = ["name,0.2", "email,0.5", "company,0.3"]threshold = 0.5targetId = 1return = [2, 5]

Record 1 links to record 2 (email + company match = 0.8). Record 2 links to record 5 (name 'Alicia' + company 'Stripe' match = 0.2 + 0.3 = 0.5 >= threshold), but record 5 does NOT link directly to record 1 (only company matches = 0.3 < 0.5). Transitivity pulls record 5 into record 1's component via record 2. Record 3 links to nobody. Component of 1 = {1, 2, 5}; excluding the target, the answer is [2, 5].

Constraints

  • Each row is "id,name,email,company", and the id is an integer.
  • Each weight entry is "field,weight", where the field is name, email or company. The weights add up to 1.
  • The similarity of two records is the sum of the weights of the fields that match. Two records are linked when their similarity is >= threshold.
  • Linkage is transitive, so the answer is the whole connected component of the target, not only its direct links.
  • Return the ids in the target's component, leaving out the target, as an int[] sorted in ascending order.

More Stripe Phone Screen questions

  • Split Tender Part 4 - RefundsOA · PHONE SCREEN · Seen Nov 2026
  • Merchant Payout Reserve CalculatorPHONE SCREEN · Seen Nov 2026
  • Parse Boolean Rule ExpressionsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Linked Merchants Within Two HopsPHONE SCREEN · Seen Nov 2026
  • Merchant Matching, Parts 1–2: Shared Fields and Weighted ThresholdsPHONE SCREEN · Seen Nov 2026
  • Business Account KYC Verification — Parts 1–5PHONE SCREEN · Seen Nov 2026
  • Financial Account LedgerOA · PHONE SCREEN · Seen Nov 2026
  • Invoice / Payment ReconciliationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Merchant Payout Scheduler, Part 2: Per-Merchant SchedulesPHONE SCREEN · Seen Nov 2026
  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesPHONE SCREEN · Seen Nov 2026

Similar questions at other companies

  • Sentence Equivalence with SynonymsRead AI · PHONE SCREEN
  • Find Duplicate Files in a FilesystemHarvey · PHONE SCREEN · ONSITE INTERVIEWHarvey interview questions
  • Shortest Word Transformation SequenceReddit · PHONE SCREENReddit interview questions
  • Word LadderGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Word Ladder IIBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Find Minimum City HopsAmazon · OA
  • Shortest Path from Encoded Graph EdgesBitGo · OABitGo interview questions
  • Count Distinct Word MeaningsDuolingo · OADuolingo interview questions
  • Word LadderGoogle · ONSITE INTERVIEWGoogle interview questions
  • Word LadderMicrosoft · ONSITE INTERVIEWMicrosoft interview questions

Interview reports that mention this question

  • Stripe Experienced MLE Phone Screens: 1 Experience
  • Stripe New Grad Interview Question Bank: 47 Problems
  • Stripe New Grad Screens and Onsites: 9 Experiences (Part 2 of 2)

Stripe interview experiences

  • Stripe New Grad SWE OA and Phone Screen: 2 Experiences
  • Stripe Experienced SWE OA and Onsite Questions: 3 Experiences
  • Stripe SWE Intern Linked Merchants Team Screen: 1 Experience
All Stripe interview questionsSee Stripe hiring insights
Saved
class Solution {
    public int[] findLinkedComponent(String[] rows, String[] weights, float threshold, int targetId) {
      // write your code here
    }
}
Checking account…