一年经验, CS 小本
- 开始时间晚了15分钟，所以只问了一个问题 https://www.geeksforgeeks.org/diameter-n-ary-tree/
Follow-up: can we optimize the split function from O(N)? Yes - cumulative sum and binary search makes it O(k*logN)
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.
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.
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.