← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Apr 2026Remote

Summary

Stripe coding screen focused on a graph traversal problem dressed up as a user deduplication/entity linking task. The problem itself was interesting but the weighted similarity piece added enough complexity that I spent way too long on setup before getting to the actual BFS.

Questions Asked (1)

Q1

Given a list of user records with fields like name, email, and company, plus per-field similarity weights and a score threshold, find all records reachable from a target user within two hops in the resulting link graph.

Algorithms & Data StructuresSystem DesignData Modeling
Author's notes

I got tripped up building the pairwise similarity matrix first, which burned a good chunk of time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem by restating the inputs and outputs, then propose a two-phase solution: first build the link graph by computing pairwise similarity scores and applying the threshold, then perform a breadth-first search from the target user up to depth two. Discuss trade-offs between precomputing the full graph versus on-the-fly neighbor generation, and consider scalability for large datasets.

Pro tip: Mention that for large datasets, you can avoid O(n²) pairwise comparisons by using blocking or indexing techniques (e.g., locality-sensitive hashing) to find candidate matches, and emphasize that the two-hop reachability can be computed efficiently with BFS while deduplicating results.

1. Clarify requirements and constraints

Ask about data size, whether weights are per-field and how they combine, threshold semantics (e.g., >= or >), and whether the graph is directed or undirected. Confirm that 'two hops' means up to two edges away.

2. Design similarity computation

Define how to compute a composite similarity score from per-field similarities and weights (e.g., weighted sum or average). Discuss normalization and threshold application to decide if an edge exists.

3. Build the link graph

Choose between precomputing all pairwise similarities (O(n²)) or generating neighbors on demand. For large n, propose indexing/blocking to reduce comparisons, and store the graph as an adjacency list.

4. Traverse two hops from target

Use BFS from the target user, exploring up to depth 2. Collect all visited nodes (excluding the target) and deduplicate if a node is reachable via multiple paths.

5. Analyze complexity and optimize

Discuss time and space complexity: graph construction O(n²) worst-case, BFS O(V+E). Suggest optimizations like early termination, caching, or distributed processing for scale.

Key Points to Mention

  • Weighted similarity score computation and threshold application
  • Graph representation (adjacency list) and edge creation criteria
  • Breadth-first search for two-hop reachability with deduplication
  • Time and space complexity, including O(n²) pairwise comparison issue
  • Scalability techniques: blocking, indexing, or approximate similarity
  • Handling directed vs undirected graphs and potential cycles

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.