Group Duplicate Support Tickets by Normalized Message Fingerprint
Last updated: November 29, 2026
Quick Overview
Given a list of (ticket_id, text) pairs from a customer's support inbox, group tickets whose text is identical after lowercasing and stripping punctuation and extra whitespace. Return only groups with two or more tickets, ordered by first appearance.
Sierra
November 29, 20260
0
0 solved
Given a list of (ticket_id, text) pairs from a customer's support inbox, group tickets whose text is identical after lowercasing and stripping punctuation and extra whitespace. Return only groups with two or more tickets, ordered by first appearance.
Sierra agents ingest historical tickets from a customer's helpdesk to learn common intents, and duplicates skew that analysis. This warm-up checks that you can pick a clean canonical key, use a hash map correctly, and keep output deterministic.
What the Interviewer Expects
- Define the normalization rule explicitly before coding
- Use a dictionary keyed by the normalized string
- Preserve first-appearance order of groups and of ids inside a group
- Run in O(total characters) time
- Discuss what normalization misses (typos, reordered words)
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 treat 'order #123' and 'order #456' as the same intent?
- How would you catch near duplicates with small typos at scale?
- What changes if tickets stream in and you must flag a duplicate on arrival?
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 is a list of (ticket_id, text). Two tickets are duplicates when their text matches after: lowercasing, dropping every character that is not a letter or digit, and collapsing whitespace. Output...
High-Level Design
Compute a fingerprint per ticket by extracting alphanumeric tokens and joining them with single spaces. Bucket ids under that fingerprint in a dictionary, and keep a separate list of fingerprints in t...