Group Anagrams: Python Interview with a Facebook Engineer

preview_player
Показать описание
Watch a Facebook engineer conduct a Python mock interview, "Group Anagrams", where given an array of strings strs, group the anagrams together. This question is of medium difficulty, typical for candidates with a few years of experience. In this case, the interviewee solved the problem using a dictionary inside a tuple and maintaining a counter! Watch for the extra question, "Find K Closest Elements" posed by the interviewer, and how the candidate uses a binary search method to tackle it!

TIMESTAMPS
00:00 Introduction
00:30 Question 1 - Group Anagrams
08:20 Question 1 - Coding Begins
17:10 Question 1 - Optimize solution
24:57 Question 2 - Find K closest elements
42:35 Question 2 - Coding Begins
45:30 Feedback
Рекомендации по теме
Комментарии
Автор

Note that the candidate misidentifies the complexity as O(n^2logn), it should be O(n wlogw). I didn't hear them state the complexity of the optimized solution but it is O(nw).

JoeMiyagi