← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Stripe coding screen for a software engineer role. Pretty focused on string manipulation and hash map usage, nothing too wild but the canonicalization details tripped me up a bit.

Questions Asked (1)

Q1

Given a list of email addresses, return the count of unique recipients after applying email canonicalization rules: strip everything after the first '+' in the local part, remove all '.' from the local part, and leave the domain unchanged.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I knew the general idea but fumbled on the order of operations at first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the canonicalization rules and edge cases (e.g., multiple '+' signs, dots in domain, case sensitivity). Then outline an algorithm that splits each email into local and domain parts, applies the transformations to the local part, and uses a hash set to count unique canonical forms. Finally, discuss time/space complexity and potential trade-offs.

Pro tip: Mention that you would handle edge cases like empty local part after stripping, and consider whether the domain should be lowercased (often domains are case-insensitive). Also, note that using a set gives O(n) time and space, which is optimal.

1. Clarify requirements and edge cases

Ask about case sensitivity, multiple '+' signs, dots in domain, and invalid emails. Confirm that only the first '+' and all dots in the local part are removed.

2. Design the canonicalization function

Split the email at '@' into local and domain. In the local part, remove everything from the first '+' onward, then remove all dots. Leave the domain unchanged (or lowercase if specified).

3. Choose data structure for uniqueness

Use a hash set to store canonical emails, then return its size. This gives O(1) average insertion and O(n) overall time.

4. Analyze complexity and trade-offs

Discuss time O(n * m) where m is average email length, and space O(n). Mention alternatives like sorting but note set is simpler and faster.

5. Test with examples

Walk through a few examples, including edge cases like 'a.b+c@domain.com' and 'a.b@domain.com' to show they canonicalize to the same address.

Key Points to Mention

  • Splitting email into local and domain parts correctly, handling '@' properly.
  • Applying transformations in the correct order: strip after '+' first, then remove dots.
  • Using a hash set for O(1) uniqueness checks and O(n) overall time.
  • Considering case sensitivity: typically local part is case-sensitive, but domain is not; clarify with interviewer.
  • Handling edge cases: multiple '+' signs, no '+', dots in domain, empty local part after stripping.
  • Discussing time and space complexity and potential optimizations.

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