[ INFO ]category: Behavioral · Onsite difficulty: medium freq: first seen: 2018-05-29
[MEDIUM][ONSITE]OnsiteSDE ISelected
$catproblem.md
Status: 3rd year undergrad, BS Computer Engieering
Position: Software Engineering Intern at Microsoft Advanced Technology Labs
Location: Cairo, Egypt
There was a long filteration process till reaching the interview stage:
Filling an online appliation with the personal details like university, age, GPA ... etc.
An online coding test was sent to the filtered candidates which included 2 problems:
`
Check if the parentheses are balanced in a string or not.
Given 2 arrays of equal size one containing the values and
the corresponding entry in the other array contains the order of the node,
you are required to rearange the values according to the order such that
the absolute difference between each 2 consecutive nodes are less than k
(k is a given integer).
`
The students who passed this online test where invited to Microsoft Cairo office to have 2 onsite interviews, each student was dedicated about 3 hours (an hour for each interview and a rest), the interveiws went as follows:
The first interview
`
Given
array of integers
integer k
you can only put + or - between any 2 consecutive elements till reaching the
end of the array, if the total sum of the elements is divisible by k return true,
else repeat with another combination till all the combinations are finished or
the answer is found.
You are also required to analyze the complexity of your algorithm
ex [1, 2, 3] k = 2
1
+/ \-
2 2
+/ - +/ -
3 3 3 3
`
The second interviewIt was a couple of linkedlist questions The first one: I was required to detect if 2 linkedlists are intersecting and calculate the complexity of the algorithm. The second one: I was required to detect a loop in a linkedlist and also detect the node of the start of the loop, there was an extra question to do a mathematical proof for the method I used which was Floyid's cycle detection algorithm.