一年经验, CS 小本
第一轮
- 开始时间晚了15分钟,所以只问了一个问题 https://www.geeksforgeeks.org/diameter-n-ary-tree/
直接给出解法,跑了一个例子测试它。面试官指出,有个edge case漏了
第二轮
-
Chocolate Sweetness
Follow-up: can we optimize the split function from O(N)? Yes - cumulative sum and binary search makes it O(k*logN)
第三轮
- 感觉面试官不感兴趣。他给了我一个题,然后出去打电话了,我不得不在他在外面的时候做题。
-
https://leetcode.com/problems/most-stones-removed-with-same-row-or-column 变种
Given coordinates (double x, double y) of balls, if there are 2 balls in same row or col you can remove any one, return max no. of balls that can be removed. Quickly coded that one and spent most of my time on the next one. -
https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array
Gave the naive solution immediately but struggled with the optimal solution. Interviewer said that I was close but did not code anything.
第四轮: [Googleyness and Leadership]
- Mostly related to stuff on my CV plus questions like how do you deal with problematic teammates, most difficult/rewarding problem you’ve solved in your career etc.
第五轮
-
https://leetcode.com/problems/palindromic-substrings
Got to the DP O(N^2) time O(N) space solution quickly. Interviewer said he wanted better space complexity, I could not figure out the 2 pointer approach. Interviewer gave me a hint near the end of the interview, and was able to solve and code the optimal one.
挂在第五轮