Microsoft Interview Questions
- -4of 4 votes
AnswersWrite a function called FooBar that takes input integer n and prints all the numbers from 1 upto n in a new line. If the number is divisible by 3 then print "Foo", if the number is divisible by 5 then print "Bar" and if the number is divisible by both 3 and 5, print "FooBar". Otherwise just print the number.
- rpisid November 14, 2013 in United States
for example FooBar(15) should print as follows:
1
2
Foo
4
Bar
Foo
7
8
Foo
Bar
11
Foo
13
14
FooBar
I know, easy right? ;)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Brain Teasers - 3of 3 votes
AnswersYou have three jars filled with candies. One jar is filled with banana candies, one jar is filled with lemon candies and one jar has a mix of both. All the jars are mislabelled (i.e. all the jars have wrong labels about what kind of candies they contain).
- rpisid November 14, 2013 in United States
All the candies look very similar in shape, size and color and they even smell the same. The only way to distinguish them is by tasting.
You have to eat one and only one candy to determine the correct jar labels. You can eat that one candy from any jar you want as long as you eat only one in total.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Brain Teasers - 4of 4 votes
AnswersGiven an integer array. Perform circular right shift by n.
- wolfengineer November 09, 2013 in United States
Give the best solution.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Arrays - 0of 0 votes
AnswersGiven two strings remove duplicates and test it
- AVK November 08, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersGiven a function to reverse a linked list write code to test the function
- AVK November 08, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 1of 1 vote
AnswersRemove common characters from two strings and print the common characters and test cases
- AVK November 08, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 1of 1 vote
AnswersDelete m nodes for every n nodes in linked list and write the test cases
- AVK November 08, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - -1of 1 vote
AnswersComplexity of a function:
- ritujain86 November 05, 2013 in United States for Autopilot
int func_fibonacci ( int n) {
if (n < 2) {
return n;
} else {
return ( func_fibonacci(n-1) + func_fibonacci(n-2));
}
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - -8of 8 votes
AnswersGiven a result in string of pass, fail, blocked, unknown as pppppppfffffbbbbbuuuuu or pppppppppppppppfffffff or pfpfpfpfpfpfpfpfpuuuuuuuuu or any combination of characters from p,f,b, or unknown character say u or x or y or z... question is write a program which can identity a pattern like all tests passed or all tests are failing or tests started failing (blocking issue may be) or unknown pattern... this is what my friend recall if someone also faced this question and recall better explaination , please add.. interviewer asked to code the solution not algo...
- Jack Williams November 01, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersDesign remote controller for me.
- cccorez October 30, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 2of 2 votes
AnswersYou have 10 million IP addresses. (IPv4 4 byte addresses). Create a hash function for these IP addresses.
- Aasen October 30, 2013 in United States
Hint: Using the IP's themselves as a key is a bad idea because there will be a lot of wasted space.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern - 5of 5 votes
AnswersGiven two sorted arrays, we can get a set of sums(add one element from the first array and one from the second). Find the Nth element in the set of sums. Suppose that array A is {1,3,4,8,10}, array B is {20, 22, 30, 40}. then the sum set will be{21(1+20),23(1+22 or 3+20), 25(3+22), 24(4+22)...} the 3rd element in the sum set is 25.
- ophis.W October 28, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Algorithm - -2of 4 votes
Answersdifference between thread and process.
- shakib034 October 27, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Operating System - -4of 4 votes
Answersdesign an alarm clock for a deaf person.
- shakib034 October 27, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Brain Teasers - 0of 2 votes
Answers3 fruit baskets having apple, orange and mix. all labeled wrong. with only one sample taking from one basket but not peeking find out which basket has which one.
- shakib034 October 27, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Brain Teasers - 1of 9 votes
Answers9 identical balls. one ball is heavy. find the heavy ball with only 2 measurements ........ dead easy.
- shakib034 October 27, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Brain Teasers - 0of 0 votes
Answersgiven a file with each line containing information <country name,state name,city name,no_of_people visited> the user want to know the no of hits of the site from the no of people visited but the request may change frequently e.g sometime it may be asked 2 find hits according to cities,sometime it may be according 2 state,might be according 2 country or around the world.design the algorithm clearly mentioning the data structure 2 b used in the algorithm
- vishal October 26, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft SDE1 Algorithm - -1of 3 votes
AnswersFor a given map (ie Bing map) given longitude/latitude/ how would you design the system so that when map longitudeDelta/latitdueDelta changed you add additional pins on map for regions that was not previously cover.
- chocoboman October 24, 2013 in United States
In another word, how would you design it to avoid getting and displaying duplicated pins| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Object Oriented Design - 2of 2 votes
AnswersThere is a matrix which contains white cells , black cells and only one gray cell, need to go from (0,0) to (N-1, N-1) if Arra[N][N]
- jyotinder1.pec October 22, 2013 in United States for advance algorithm
constraints:
a. The path should cover only white cells and should go via grey cell.
b. The node once visited cannot be visited again.
White cells are represented by 0, black cells by 1 and grey cell by 2.| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm - -1of 1 vote
AnswersWrite a function to retrieve the number of a occurrences of a substring(even the reverse of a substring) in a string without using the java substring() method.
- girishreddy5 October 22, 2013 in United States
Ex: 'dc' in 'abcd' occurs 2 times (dc, cd).| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 2of 2 votes
AnswersGiven an input list of lists.. flatten the list. For e.g.
- techpanja October 22, 2013 in United States for yammer
{{1,2}, {3}, {4,5}} ... Output should be {1, 2, 3, 4, 5}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 2of 2 votes
AnswersFind the max height of a binary tree.
- techpanja October 22, 2013 in United States for yammer| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 3of 3 votes
AnswersWrite your own regular expression parser for following condition:
- techpanja October 22, 2013 in United States for yammer
az*b can match any string that starts with and ends with b and 0 or more Z's between. for e.g. azb, azzzb etc.
a.b can match anything between a and b e.g. ajsdskjb etc.
Your function will have to parameters: Input String and Regex. Return true/false if the input string satisfies the regex condition. Note: The input string can contain multiple regex. For e.g. az*bc.g| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 3of 3 votes
AnswersHere is a good puzzle:
- Anonymous October 15, 2013 in United States
How do you write a program which produces its own source code as output?| Report Duplicate | Flag | PURGE
Microsoft Front-end Software Engineer - 0of 0 votes
AnswersHow would you assign numbers if you were AT&T, describe a data structure
- juny October 07, 2013 in United States for Azure| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Data Structures - 1of 9 votes
AnswersGiven a string say "ABCD". Now create a new string with duplicates of each character in the original string and append the reverse of the same string (with duplicates) excluding the last character.
- Anonymous October 03, 2013 in India
First iteration: AABBCCCCBBAA
[ABC three types of chars; Here c is the last char.Ignore duplicates after the last char c]
Second iteration: AABBBBAA
[here b is the last char]
Third iteration: AAAA
[no second char left]| Report Duplicate | Flag | PURGE
Microsoft Testing / Quality Assurance - 1of 3 votes
AnswersI was asked this question during campus placement drive :
- Myth October 02, 2013 in United States
You have a Timer which goes to from a certain range ( n to 0), where n is not fixed and we can have it as much as we want.
The timer when goes to 0 an associated callback for the request is done.
We have multiple requests coming into the system, however the Timer is insufficient to deal with them at all at once ( it can deal with a figure less than number of requests).
How do you reuse the timer and handle all asynchronous requests?| Report Duplicate | Flag | PURGE
Microsoft Intern - 3of 13 votes
AnswersPrint the numbers between 30 to 3000.
- Anonymous September 25, 2013 in United States
CONSTRAINT:
The numbers shouldnt contain digits either in incresing order or decreasing order.
FOLLOWING NOT ALLOWED
##123,234,345,1234,2345##increasing order,
##32,21,321,432,3210 etc##decresing order.
FOLLOWING ALLOWED:
243,27,578,2344 etc.,
Now see who ll code ths....| Report Duplicate | Flag | PURGE
Microsoft Developer Program Engineer - 3of 5 votes
AnswersGiven an n X n matrix, find all elements which are zero, when found set all the elements in that row and column to zero.
- akula.maheshk September 24, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft SDE1 Algorithm - 1of 1 vote
AnswersWrite a function that takes an unsorted array of integers as a paramater and returns the array without duplications. (Order of returned array doesn't matter as long as ONLY one of each integer in the original array is present).
- toinetoine September 20, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Algorithm