Detect Near-Duplicate Expert Submissions With Shingle Jaccard
Last updated: November 29, 2026
Quick Overview
Given text submissions from contributors writing prompts or rubrics for AI training data, group submissions whose word 3-gram Jaccard similarity meets a threshold, without comparing every pair.
Micro1
November 29, 20260
0
0 solved
Given text submissions from contributors writing prompts or rubrics for AI training data, group submissions whose word 3-gram Jaccard similarity meets a threshold, without comparing every pair.
Human-data vendors are paid for original expert work, so catching copied or lightly edited submissions protects quality for AI lab clients. The interviewer wants candidate generation through an inverted index, union-find grouping, and awareness of MinHash at scale.
What the Interviewer Expects
- Normalizes text before shingling
- Uses an inverted index to avoid all-pairs comparison
- Skips very common shingles that carry no signal
- Groups transitively with union-find
- Explains MinHash and LSH for millions of rows
- Discusses threshold choice and false positives
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 MinHash with LSH banding change the cost, and how do you pick bands and rows?
- Duplicates can be paraphrased by an LLM. What signal would you add?
- Transitive grouping can chain two dissimilar texts through a middle one. Is that acceptable?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: list of (sub_id, text), shingle size k, threshold t. Output: groups of two or more ids that are linked by pairs with Jaccard >= t. Case and punctuation should not matter....
High-Level Design
Lowercase and tokenize, then build the set of word k-grams per submission. Two texts can only reach the threshold if they share at least one shingle, so an inverted index from shingle to submissions y...