Group Duplicate Listings by Seller and Normalized Title
Last updated: November 29, 2026
Quick Overview
Given listings as (listing_id, seller_id, title), return groups of listing ids from the same seller whose titles contain the same set of words after lowercasing and stripping punctuation. Only return groups with two or more listings.
eBay
November 29, 20260
0
0 solved
Given listings as (listing_id, seller_id, title), return groups of listing ids from the same seller whose titles contain the same set of words after lowercasing and stripping punctuation. Only return groups with two or more listings.
eBay's catalog team fights duplicate listings, where a seller posts the same item several times to crowd search results, which violates marketplace policy. This warm-up in a phone screen checks whether you pick a good canonical key and use a hash map cleanly before the interviewer layers on fuzzier matching.
What the Interviewer Expects
- Define a normalization that ignores case, punctuation and word order
- Key a hash map by (seller_id, normalized title)
- Return only groups of size two or more, in a deterministic order
- State O(total characters) time and space
- Discuss what this key misses (typos, synonyms like 128GB vs 128 GB)
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 catch near duplicates such as one extra word or a typo?
- What if the same item is listed by two linked seller accounts?
- How would you run this across 1.9 billion listings in a batch job?
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 listings are duplicates when they share a seller and their titles reduce to the same set of words: lowercase, keep only letters and digits, ignore order and repeats. So iPhone 13 Pro 128GB a...
High-Level Design
Build a canonical key per listing and bucket by it. The key is (seller_id, normalized_title) where the normalized title is the sorted unique tokens joined by spaces. Including the seller in the key ...