1st Phone Interview:
First introduce myself.
Two questions:
1. The starts();
Asked me the complexity of the Algorithm. And also he ask me what is the worst case:
We can answer:
Find “aaaac” from “aaaaaaaaaaaaaaaaaaaaaaaaaaac"
2. Find the Top K frequency number in a array.
For example:
[1, 2, 3, 1, 2, 3, 4, 4, 5, 4, 4], k = 3
return: [4, 2, 1] or [4, 1, 3] or [4, 2, 3]
[1, 1,1, 2, 2, 3, 4] , k = 2
return : [1, 2]
Then ask him questions.