Friday, September 9, 2016

Microsoft interview experience

Telephonic Round

1. 
Given n light bulbs, write two methods. 

isOn(i) to determine if a light bulb is on
toggle(start, end) to toggle all the light bulbs in the range 
The question is present at career cup https://www.careercup.com/question?id=5668664122540032
2. Given a number n, tell the count of distinct binary search trees that could be formed from it
Face to Face
Round 1:
1. Implement Singleton design pattern
2. Find majority element in an array
Round 2:
1. Given a string, return longest palindromic sub string