微软店面过经

在推荐后2周,猎头联系了我

1. Complexity of searching in a AVL/height balanced tree?

Ans : O(logn) - Please explain how you come to the conslusion of O(logn)

2. How would you find the intesection of two linked lists.

Ans: https://leetcode.com/problems/intersection-of-two-linked-lists/
Again, explain as much as you can over the phone. Walk him through your thought process.

3. Remove duplicates from a Sorted Linked List.

Ans: https://leetcode.com/problems/remove-duplicates-from-sorted-list/
Explain your process again.

4. A couple of behavioral and past work experience based questions.

Why do you want to work for microsoft is a MUST.

等待下一步

报个我的:

给⼀颗BST的中序遍历结果,要求返回所有可能的BST,并分析算法复杂度。

我考了这题

Write a function that, given an array A of N integers, returns the lagest integer K > 0 such that both values K and -K exist in array A. If there is no such integer, the function should return 0.

Input:
A = [3, 2, -2, 5, -3]
Output:
3

Input:
A = [1, 2 ,3 ,-4]
Output:
0