The on-site interview included 4 rounds, each part lasted about 45 minutes and there was a 15 minutes break between each part.
Before the interview, every interviewees had a free lunch together on the campus of Microsoft.
First round was the most difficult one for me, even the question was very long and it was hard to remember.
Second, find the lowest common ancestor of two tree nodes. You have to define your own tree node. Those two nodes are not neccessarily in the same tree.
Input will be two tree nodes, and the output should a tree node too.
What’s the time complexity? What if the tree is balanced tree?
Third round, there are three functions, onKeyPress, onUploadStart, onUploadEnd,
When the users are typing, it will call onKeyPress function. After some specific time, it will call onUploadStart function. And then after another specific time, it will call onUploadEnd function.
You should find a way to return the timespan from onUploadEnd time to the first time you call onKeyPress function. Before onUploadStart being called, the users could have typed multiple time.
follow up: write some unitest code.
follow up 2: You should modify the function to make your function return multiple timespan, every onKeyPress before onUploadStart will be uploaded during that upload process.
Final round, two easy ones. check wether two trees are the same tree, and another one is hitcounter.
All interviewers I’ve met were very nice and they helped me a lot.