← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Stripe coding interview for a software engineer role, one question, pretty much the whole session was spent on a single Java design problem involving JGit and file ownership logic. Felt more like a take-home style problem crammed into a live setting.

Questions Asked (1)

Q1

Write a Java program that automatically selects a code reviewer for a pull request by comparing two git branches, identifying changed files, and matching them to owners from a CSV file to find who owns the most changes.

API & IntegrationsAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

I'd used JGit before but only barely, so the diff part took me longer than I wanted to admit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases, then outline a modular design: use JGit to diff branches, parse the CSV into a map of file patterns to owners, and compute the owner with the most changed lines. Discuss trade-offs like exact vs. pattern matching and performance for large diffs.

Pro tip: Mention that you would cache the CSV data and use a trie or prefix tree for efficient file path matching, and that you'd handle binary files and renames gracefully. This shows you think about real-world robustness and performance.

1. Clarify Requirements and Edge Cases

Ask about the CSV format (e.g., columns for file path and owner), whether matching is exact or pattern-based, and how to handle files with no owner. Also consider binary files, renames, and large repositories.

2. Design the Solution Architecture

Break the problem into three modules: a Git diff component using JGit to compare branches and list changed files with line counts, a CSV parser to load ownership data into a map, and a matcher that aggregates changes per owner and selects the top owner.

3. Implement Git Diff with JGit

Use JGit's DiffCommand to compare the two branches, then iterate over DiffEntries to get changed files. For each file, compute the number of added and deleted lines using EditList or DiffFormatter.

4. Parse CSV and Match Owners

Read the CSV using a library like OpenCSV or manual parsing, storing file patterns and owners. For each changed file, find the matching owner (exact or pattern) and accumulate the total changed lines per owner.

5. Select Reviewer and Discuss Trade-offs

Determine the owner with the maximum total changed lines; if tie, use a secondary criterion like most files. Discuss performance optimizations (e.g., caching, parallel processing) and how to handle missing owners or ambiguous matches.

Key Points to Mention

  • Use of JGit for Git operations (DiffCommand, DiffEntry, EditList) to compute changed lines.
  • Efficient CSV parsing and data structure choice (e.g., HashMap for exact matches, Trie for prefix patterns).
  • Handling edge cases: binary files, renames, deletions, and files with no owner.
  • Trade-offs between exact file path matching and pattern-based matching (e.g., glob patterns).
  • Performance considerations for large repositories: caching, streaming, and parallel processing.
  • Tie-breaking logic and fallback strategies when no owner is found.

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