Google L3/ L4 Phone Screen

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-03-06Added By Anonymous
Source: Link
🧭 Experience: unknown
✅ Outcome: unknown
💰 Compensation: unknown
📍 Location: unknown
🏢 Company: Google
🎓 Education: unknown
🎁 Benefits: unknown
📅 Offer Date: unknown

Implement the class BestAnagramFinder, which takes a list of words named as 'dictionary' as a parameter while initialization. The class has the below methods: 1. hashAnagram: an abstract method which takes a 'word' as a parameter and returns the hash value of the word. 2. calculateScore: a method which takes a 'word' as input and calculates the score of it. The score is calculated by adding up all the absolute distance of the adjacent characters in the word. 3. findBestAnagram: a method that takes a 'word' as input and returns the best anagram for the 'word' (best anagram is the word which has the maximum score).
Comments