Group Duplicate Vendor Records by Shared Identifiers

Last updated: November 29, 2026

Quick Overview

A customer's vendor master has duplicates created by different teams. Two vendors belong to the same real supplier if they share a normalized tax ID, bank account, or a corporate (non free-mail) email domain, and the relation is transitive. Return the duplicate groups.

ZipHQ
Coding & Algorithms
Software Engineer
ZipHQ
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


A customer's vendor master has duplicates created by different teams. Two vendors belong to the same real supplier if they share a normalized tax ID, bank account, or a corporate (non free-mail) email domain, and the relation is transitive. Return the duplicate groups.

Vendor onboarding is a big part of Zip, and duplicate suppliers cause double payments and fragmented spend data. The question checks whether you recognize a connected components problem, avoid quadratic pairwise comparison, and think about which keys are safe to link on.

What the Interviewer Expects
  • Recognize transitivity and use union-find or graph traversal
  • Index by key so the work is near linear rather than all pairs
  • Normalize identifiers (dashes, spaces, case) before linking
  • Exclude weak keys such as gmail.com that would merge unrelated vendors
  • Return stable, sorted output
Key Topics to Cover
union-find
connected components
entity resolution
data normalization
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you add fuzzy name matching without blowing up runtime?
  • One shared bank account merges two huge groups: how would you guard against a bad key?
  • How would you present merge suggestions to a procurement admin for review?
  • How do you keep groups up to date as new vendors are added?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input is a list of vendor dicts with id and optional tax_id, bank_account, email. Output is a sorted list of groups with two or more ids. Free-mail domains never link vendors....

High-Level Design

Each normalized identifier becomes a key like ('tax', '123456789'). Keep a map from key to the first vendor index that had it; when a later vendor has the same key, union them. Union-find with path ...


Submit Your Answer
Markdown supported

Related Questions