Article Microsoft Interview Questions
About The Company
Microsoft is a multinational computer technology that develops, manufactures, licenses and supports a wide range of software products for computing devices
History
The company was founded in 1975 to develop and sell BASIC Interpreters for Altair 8800. Microsoft rose to dominate the home computer operating system market with MS-DOS in the mid-1980’s, followed by the Windows line of operating systems.
Product Divisions
- Platform Products and Services Division: This division produces Microsoft's flagship product, the Windows operating system. It has been produced in many versions, including Windows 3.1, Windows 95, Windows 98, Windows 2000, Windows ME, Windows Server 2003, Windows XP, Windows Vista and recently Windows 7.
- Business Division: The Business Division produces Microsoft Office, which is the company's line of office software. The software product includes Word, Access, Excel, Powerpoint and many more.
- Entertainment and Devices Division: Microsoft also has its presence in products such as Windows CE for PDA's and smartphones. They entered the game console market dominated by Sony and Nintendo with the release of Xbox.
Sample Questions
1.Given two sorted arrays where the size of the second array is large enough to hold the first array, write code to merge them in sorted order.
Solution:
Let the two arrays be a[n], b[m+n+c] //m elements & c >=0
Let i be the iterator for a[]
Let j be the iterator for b[]
Let k be the position that needs to be filled
i = index for last element of a[] = n-1
j = index for last element of b[] = m-1
k = m+n-1;
while(i>=0 && j>=0 {
if(a[i]>b[j])
b[k--] = a[i--]
else
b[k--] = b[j--]
}
while(i>=0)
{
b[k--] = a[i--];
}
2.Write a code to check whether a tree is balanced or not?
Solution:
/**
If the function return's 0, it means its not a balanced tree.
Else its a balanced tree.
**/
int balTree(node *ptr) {
assert(ptr != 0);
int l_hight = 0 , r_hight = 0;
if(ptr->left)
l_hight = balTree(ptr->left);
if(ptr->right)
r_hight = balTree(ptr->right);
if(!((l_hight - r_hight) <=1 && (l_hight - r_hight) >= -1 ))
return 0;
return (((l_hight > r_hight) ? l_hight : r_hight ) + 1);
}
Solution:
Let the two arrays be a[n], b[m+n+c] //m elements & c >=0
Let i be the iterator for a[]
Let j be the iterator for b[]
Let k be the position that needs to be filled
i = index for last element of a[] = n-1
j = index for last element of b[] = m-1
k = m+n-1;
Solution:

