Group Duplicate Helpdesk Tickets by Normalized Subject Line
Last updated: November 29, 2026
Quick Overview
Given a list of (ticket_id, subject) pairs from an IT helpdesk, group tickets whose subjects are the same after normalization (case, punctuation, reply prefixes such as RE: and FW:, and embedded ticket numbers like INC00123). Return only groups with two or more tickets, in order of first appearance.
Moveworks
November 29, 20260
0
0 solved
Given a list of (ticket_id, subject) pairs from an IT helpdesk, group tickets whose subjects are the same after normalization (case, punctuation, reply prefixes such as RE: and FW:, and embedded ticket numbers like INC00123). Return only groups with two or more tickets, in order of first appearance.
An employee assistant sees bursts of near-identical tickets during an outage ("VPN not working" filed forty ways), and spotting them is the first step toward suggesting a known incident instead of filing a new ticket. In a phone screen the interviewer checks that you can turn fuzzy requirements into a clean normalization function and a hash-map grouping without over-engineering.
What the Interviewer Expects
- Asks which differences should be ignored before coding (case, punctuation, prefixes, ticket IDs)
- Separates normalization from grouping so each is testable
- Uses a dictionary keyed by the normalized string for linear time
- Preserves deterministic output order
- Handles subjects that normalize to an empty string
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 extend this to catch paraphrases like "VPN down" vs "cannot connect to VPN"?
- Tickets arrive as a stream; how do you emit a group as soon as it reaches size five?
- What goes wrong if you strip all digits instead of only ticket IDs?
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 (ticket_id, subject). Two subjects are duplicates if they match after: lowercasing, removing leading re: / fw: / fwd: prefixes (possibly repeated), removing ticket references li...
High-Level Design
Write normalize(subject) as a small pipeline of regex passes, then a single pass over the tickets that appends each id to groups[normalized]. A separate order list records first appearance so ou...