脸熟 实习电面

九月初内推的,Oct 22面的,一个很好的国人大哥

面了两道题,题目都很简单,也都是原题,感觉fb刷tag题就好了
第一个是给一个binary tree,输出站在树的右边,能看到哪些点,从上到下。我是用bfs写的,用了两个queue
第二个是一个array,输出是一个array,对每个数输出除了该数之外的其他数字的乘积,比如[1,2,3,4]输出[24,12,8,6],不用除法

楼主面的时候实在是太紧张了,有点语无伦次那种,蛮懊恼…发帖攒人品,希望能好运~

报个挂经

The interview started with a brief introduction.

The first question was a LC easy about finding the first bad version which I quickly came up with the binary search algorithm and implemented the code. Then I went through some examples and tested my algorithm.

Second problem was serialize and deserialize a binary tree which is LC hard. I explained my solution for serialize and implemented that. I also tested that on an example that the interviewer provided and it worked. Then I started to think about the deserialize part and they told me there is not much time left and Its okay if I can just explain my method. I quickly mentioned my big picture and my though process but then they asked me if I have any questions for them.

报下我的

题目是 https://leetcode.com/problems/exclusive-time-of-functions/

First 5 min were introduction. After that he started descrbing the problem to me. Then we discussed more about the valid cases of inputs and invalid cases of input and went over some test cases to manually calculate the output and then I coded the solution in under 10 min. Then he gave me a follow up on the same which was just asking me how to handle multi threads of the process which I was able to answer correctly. This whole question took up 35 min. Honestly I did not even get stuck or took a lot of time to code. The interviewer was nice but he wanted to make sure we are on the same page and made me come up with a lot of test cases and manually write the output before coding.