Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Group Similar Call Transcripts

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Group Similar Call Transcripts. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Assort Health wants to deduplicate short call transcript snippets before downstream review. Given a list of lowercase strings, group together all strings that are anagrams of each other and return the groups.

Two strings belong in the same group if they contain exactly the same characters with the same frequencies, regardless of order. Implement an algorithm that efficiently groups all such strings.

Formal Specification

  • Input: transcripts, a list of lowercase strings
  • Output: A list of groups, where each group is a list of strings that are anagrams of one another
  • Strings may be returned in any order, and groups may be returned in any order

Constraints

  • 1 <= len(transcripts) <= 10^4
  • 0 <= len(transcripts[i]) <= 100
  • transcripts[i] contains only lowercase English letters

Function Signature

def group_anagram_transcripts(transcripts):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output