Microsoft Interview Questions
- 0of 0 votes
Answersfill all the numbers from 1 to 8 in the diagram shown below such that no two consecutive numbers are next to each other(either horizontally vertically or diagonally) i hope i am clear .. i mean 1 can not have a neighbor as 2 , 5 can't have neighbor as 6 or 4 ...
- X July 25, 2011----- | | ------------------- | | | | ------------------- | | | | ------------------- | | -------
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersThese question were asked in Written test held in delhi...
- X July 25, 2011
1) find the bug in the following code which concatenates 2 strings ---
char * concatenate(char *s1,char *s2)
{
char buffer[1024];
int i=0;
while(*s1)
{
buffer[i++]=*s1;
s1++;
}
while(*s2)
{
buffer[++i]=s2;
s2++;
}
return buffer;
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersThese question were asked in Written test held in delhi...
- ajitpec July 25, 2011
1) find the bug in the following code which concatenates 2 strings ---
char * concatenate(char *s1,char *s2)
{
char buffer[1024];
int i=0;
while(*s1)
{
buffer[i++]=*s1;
s1++;
}
while(*s2)
{
buffer[++i]=s2;
s2++;
}
return buffer;
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
Answerswrite down the output...even after knowing , i did wrong...:P u guys be careful..:P
- Rajeev Jayaswal July 23, 2011int b=3; cout<<b++*++b<<endl;
| Report Duplicate | Flag | PURGE
Microsoft Developer Program Engineer - 0of 0 votes
AnswersDesign an Evaluation of a mathematical expression.
- Chari July 20, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 0of 0 votes
Answersfind all the permutations of a string.
- Ramani.s July 18, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
Answerssearch a number in a sorted array of the form
- rahul July 17, 2011
eg: 4 5 6 1 2 3
in O(logn).| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Arrays - 0of 0 votes
AnswersGiven a very big file of words, a word in each line, sort the words
- Anonymous July 09, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 1of 1 vote
AnswersGiven a Binary Search Tree, find the 2nd maximum element.
- Anonymous July 09, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersGiven a binary tree where initially sibling pointers(left to right) are null for all nodes, connect all nodes at each level.
- Anonymous July 09, 2011
When I gave a solution with BFS, interview wanted a iterative solution as he feels BFS is easy solution.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a Roman number, convert it into the decimal number. Write the code considering the all cases including invalid strings.
- Anonymous July 09, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven an integer n, write code to calculate n+1, without using +,-,++,--,*,/
- deep July 01, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersGiven n arrays, find n number such that sum of their differences is minimum. For e.g. if there are three arrays
- A June 30, 2011
A = {4, 10, 15, 20}
B = {1, 13, 29}
C = {5, 14, 28}
find three numbers a, b, c such that |a-b| + |b-c| + |c-a| is minimum. Here the answer is a = 15, b = 13, and c = 14| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a rectangle with known width and height, design an algorithms to fill the rectangle using n squares(n is integer, also given) and make sure in the result the wasting area is minimized. Length of square doesn't have to be integer.
- xdunder June 24, 2011
I.e, given width=3,height=2,n=5, one solution is that rectangle can be filled with five 1x1 squares and the wasting area is 1. Another solution could be filled with five 0.9x0.9 squares, but the wasting area is more than first solution.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGiven a BST and integer value K.
- anonymous June 17, 2011
Find two nodes x and y such that x->data + y->data = K
Time O(n), space O(1)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersGiven a character array with a set of characters, there might be repetitions as well, given two characters, you should give the minimum distance between these two characters in the whole array. O(n^2) and O(n) solutions are possible.
- SS June 11, 2011| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersPrint an mxn matrix spirally. Write code for the same.
- SS June 11, 2011| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersGiven a continuous stream of 1's and 0's how do you determine whether the number so far is divisible by 3? At any point of time, you will have previous sequence in hand and a 1 or a 0 appears, without looking at the entire sequence we should be able to tell whether the sequence formed by adding the new number will is divisible by 3 or not?
- SS June 11, 2011| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersGiven a sorted array, find a pair of elements that sum upto a given value.
- SS June 11, 2011| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersDifference between Dictionary and a Hashtable ?
- soni vashisht June 09, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm