Group Near-Duplicate Service Requests From the Same Customer
Last updated: November 29, 2026
Quick Overview
Customers sometimes submit the same job several times. Group requests that share customer, category and zip, fall within 24 hours of the group's first request, and have questionnaire answers with Jaccard similarity of at least 0.6.
Thumbtack
November 29, 20260
0
0 solved
Customers sometimes submit the same job several times. Group requests that share customer, category and zip, fall within 24 hours of the group's first request, and have questionnaire answers with Jaccard similarity of at least 0.6.
Duplicate requests on Thumbtack mean pros pay twice for the same job, so detecting them protects pro ROI and trust. The interviewer checks bucketing to avoid all-pairs comparison, a sliding time window and a clearly defined similarity rule.
What the Interviewer Expects
- Buckets by (customer, category) so comparisons stay local
- Sorts by time and expires groups older than the window
- Defines similarity over (question, answer) pairs
- Compares against a fixed group anchor to avoid transitive drift
- Discusses false positives (a customer who really needs two jobs)
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
- Why compare to the anchor instead of any member of the group?
- How would you do this in a streaming system at request-creation time?
- How would you choose the 0.6 threshold with data?
- Free-text descriptions also differ slightly. How would you include them?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Each request has id, customer_id, category, zip, ts (seconds) and answers (question to answer). Two requests are duplicates if same customer, category and zip, the later one is within 24 h...
High-Level Design
Comparing every pair is O(n^2) across all customers, but duplicates can only exist within one customer and category, so bucket first. Inside a bucket sort by time and keep a list of open groups, each ...