Microsoft Interview Questions
- 0of 0 votes
AnswersEstimate the number of auto's standing idle in any area in Bangalore.
- Anonymous June 14, 2012 in India for Bing| Report Duplicate | Flag | PURGE
Microsoft Program Manager - 0of 0 votes
AnswersName any one microsoft product, you have been using and suggest 5 improvements in it alongwith priority assignments p1 -p5.
- Anonymous June 14, 2012 in India for Bing| Report Duplicate | Flag | PURGE
Microsoft Program Manager - 0of 0 votes
AnswersGiven an array A[n] such that A[i+1] = A[i]+1 OR A[i]-1, and a number k, can you determine in most efficient way whether k is present in A[n] or not?
- Yoda June 12, 2012 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Computer Scientist Algorithm - 0of 0 votes
AnswersWrite a method to sort an array of strings so that all the anagrams are next to each other.
- Pawan Sharma June 05, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Sorting - 0of 0 votes
AnswersGiven a matrix of size n x m filled with 0's and 1's
- pavel.em May 30, 2012 in United States
e.g.:
1 1 0 1 0
0 0 0 0 0
0 1 0 0 0
1 0 1 1 0
if the matrix has 1 at (i,j), fill the column j and row i with 1's
i.e., we get:
1 1 1 1 1
1 1 1 1 0
1 1 1 1 1
1 1 1 1 1
complexity: O(n*m) time and O(1) space
NOTE: you are not allowed to store anything except
'0' or '1' in the matrix entries| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersGiven a set of numbers from 1 to n^2, generate subsets consisting of n numbers such that each subset has one and only one matching number from any other subset
- geeksavy May 16, 2012 in India
The max number of sub-sets is n squared + n
An example is as follows:
n = 3
n squared set = 1, 2, 3, 4, 5, 6, 7, 8, 9
sub-set 1 = 1, 2, 3
sub-set 2 = 1, 4, 7
sub-set 3 = 1, 5, 9
sub-set 4 = 1, 6, 8
sub-set 5 = 2, 5, 8
sub-set 6 = 2, 4, 9
sub-set 7 = 2, 6, 7
sub-set 8 = 3, 6, 9
sub-set 9 = 3, 5, 7
sub-set 10 = 3. 4, 8
sub-set 11 = 4, 5, 6
sub-set 12 = 7, 8, 9| Report Duplicate | Flag | PURGE
Microsoft Algorithm - 0of 0 votes
Answersgiven 2 unsorted integer arrays a and b of equal size. Determine if b is a permutation of a. Can this be done in O(n) time and O(1) space ?
- pavel.em May 16, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft - -1of 1 vote
AnswersPrint the sum of a binary tree
- spammer May 12, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersReverse a String any lang you like
- spammer May 12, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiven AAABBGFF should get an output 3{A} 2{B}1{G}2{F}
- spammer May 12, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersThere is an arithmetic expression with three operations: plus, minus, and multiplication, but an evil dwarf changed precedence of operators in a way that +/- had higher precedence than * when the expression was parsed. So as an input we get tree with wrong structure, and for example the expression:
a + b * c + d - e
is represented as
* / \ + + / \ / \ a b c - / \ e f
Convert the tree to the right form taking into account that there can be parentheses but they group only expressions with + and -, i.e. the expression (a * b) + c is invalid input and should not be handled.
- diamond May 11, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
Answersgiven an array of positive integers A and the numbers N and S. Determine the number subsets of A of size S which sum up to N.
- pavel.em May 08, 2012 in United States
e.g. A[] = {1,2,5,3,6}
N = 9, S = 3
then we have 2 subsets of size 3: 1+3+5 and 1+2+6| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersFind the kth smallest element in a sorted array
- neo April 28, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersFind the kth smallest element in a (MxN) matrix.
- neo April 28, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
Answersin an array n/2 elements are repeated. las vegas algo to find the element. runtime is o(log(n)). follow up question:- minimum number of elements to be repeated to keep the runtime o(log(n)). next :- what is the runtime if repeated elements is root(n).
- anonymous April 25, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven an n-ary tree, find the closest common ancestor ? Discuss the time complexity and write testcases.
- ps April 24, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Trees and Graphs - 0of 0 votes
AnswersImplement a stack with 3 operations: push, pop and findmiddle(). At any point in time, findmiddle() should return the middle element of the stack (n/2+1) without popping out the elements. ie. in O(1) time
- ps April 20, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersIdentify whether an math expression is legal.
- superffeng April 20, 2012 in United States for Server and tools in microsoft erp
for example: {[3*(3+2)]+1}*5 is legal
{(]3++}+4 is illegal| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersHow to test a whiteboard?
- superffeng April 20, 2012 in United States for Server and tools in microsoft erp| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersReverse the word in a string.
- superffeng April 20, 2012 in United States for Server and tools in microsoft erp
for example:
"hello world" after is
"olleh dlrow"
desgin test cases| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
Answersprint out the start and end index of the subarray that has the largest sum in an integer array.
- superffeng April 20, 2012 in United States for Server and tools in microsoft erp
Design test case| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
Answersreturn the 2nd largest number in an integer array, then design test cases:
- superffeng April 20, 2012 in United States for Server and tools in microsoft erp| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
Answersprint all compositions of a number in odd parts, i.e. for n = 8:
- pavel.em April 17, 2012 in United States
7 + 1
5 + 3
5 + 1 + 1 + 1
3 + 3 + 1 + 1
3 + 1 + 1 + 1 + 1 + 1
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersWrite a program for binary tree (not BST) where left is connected to right and the whole structure is connected.
- ps April 16, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Data Structures - 2of 2 votes
AnswersGiven a set of numbers from 1 to n squared, generate unique sub-sets consisting of n numbers such that each subset has one and only one matching number from any other sub-set
- msjob99 April 11, 2012 in United States
The max number of sub-sets is n squared + n
An example is as follows:
n = 3
n squared set = 1, 2, 3, 4, 5, 6, 7, 8, 9
sub-set 1 = 1, 2, 3
sub-set 2 = 1, 4, 7
sub-set 3 = 1, 5, 9
sub-set 4 = 1, 6, 8
sub-set 5 = 2, 5, 8
sub-set 6 = 2, 4, 9
sub-set 7 = 2, 6, 7
sub-set 8 = 3, 6, 9
sub-set 9 = 3, 5, 7
sub-set 10 = 3. 4, 8
sub-set 11 = 4, 5, 6
sub-set 12 = 7, 8, 9
Write the C++ algorithm that will work for any arbitrary integer value n. The n-squared set can be placed into any built in C++ data structure eg 2d array.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
Answersregular expression matching: given a regular expression just composed with letters and *, whether a string str can be generated by the regular expression? for example, regular expression a*b*c , the string aabaabc cann't be generated by the regular expression.
- Red Lv April 09, 2012 in China for STC| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer String Manipulation - 0of 0 votes
Answerswhat is the range of int data type?
- ashish March 25, 2012 in India for bing
what is the maximum number (decimal number) that can be stored using any datatype ?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Computer Architecture & Low Level - 0of 0 votes
Answerswhat does malloc returns ? what happens when ou write:
- ashish March 25, 2012 in India for bing
List* node;
node=malloc(sizeof(node));
where does node points to ?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
Answersgiven a linked list and two integers M and N. Scan the linked list such that you retain M nodes then delete next N nodes and continue the same till the end of linked list.
- ashish March 25, 2012 in India for bing| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Linked Lists