Group Duplicate Loan Applications by Normalized SSN and Email
Last updated: November 29, 2026
Quick Overview
Given a list of loan applications with an id, SSN and email, return groups of application ids that refer to the same person after normalizing SSN formatting and email aliases. Only groups with two or more applications should be returned.
Upstart
November 29, 20260
0
0 solved
Given a list of loan applications with an id, SSN and email, return groups of application ids that refer to the same person after normalizing SSN formatting and email aliases. Only groups with two or more applications should be returned.
Upstart's early coding assessment favors short, practical problems close to real lending data, and duplicate application detection is a daily concern on its personal loan funnel. The interviewer checks that you pick the right hash key, normalize inputs before hashing, and keep the code clean.
What the Interviewer Expects
- Normalize SSNs by stripping non-digits
- Lowercase emails and handle Gmail dot and plus aliases
- Use a dictionary keyed on the normalized pair
- Return only groups of size two or more
- Run in linear time
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
- How would you match on SSN alone OR email alone, rather than both?
- What changes if the input is too large to fit in memory?
- Which other aliasing rules would you worry about for non-Gmail providers?
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 applications are duplicates when their normalized SSN and normalized email both match. SSNs may arrive as 123-45-6789 or 123456789. Emails are case-insensitive, and for Gmail the dots and anyt...
High-Level Design
Build a canonical key (digits_of_ssn, canonical_email) for each row and append the id into a dictionary of lists. A single pass is enough because equality on a canonical key is transitive, so no gra...