Microsoft Interview Questions
- 0of 0 votes
AnswersTell me how these DS stored in memory?
- ritz September 07, 2010
Hashtables, Dictionary, Trees, Arrays, LinkLists| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Data Structures - 0of 0 votes
AnswersI attended MS interview loop this week and I was asked the below question.
- c# September 04, 2010
Given a IP address as input, validate the ip address.
ValidateIp(string inpIP)
My answer-I validated the characters in the string and then implemented atoi function on each substring and verified for its value in the range of 0-255, I was also asked to assume that an IP can start with 0.
PS: I am not selected:(, not sure if the interviewer knew some other way and expecting me to say the same:)...| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersHi All,
- c# September 04, 2010
I attended MS interview loop this week, I was unable to get through, pissed off after seeing the beautifully madeup regret mail from the staffing consultant, I wanted to share a question and my answer...Beware of the answer as I am not selected:)
here it goes..
Given a text document as input with a set of strings, assume '\n' is the delimiter, print to the console strings grouped by anagrams.
vinay
naviy
inavy
tes
set
...
My answer:
1. sort all the strings and compare...interviewer was not happy with the time complexity of sorting all strings.
2. create a hashtable where the hashcode is generated using the characters in the string..I got the hash of each string by doing an Exclusive OR of each charcater in the string although i had the dbt if the Ex-OR of non anagrams can be same, this is the only other solution that came to my mind.
Any efficient ways of solving this??| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersHi All,
- C# September 04, 2010
I attended MS interview this week, I was unable to get through, but I wanted to share a question for which i failed to give a efficient implementation..any ideas here..
here it goes...
Implement a firewall
prototype:
bool firewall(string url, list<string> IncludedList, List<string> ExcludedList)
Return true if the url is in included list
Return false if the url is in excluded list.
In a ambiguous situation return true\false based on best match.
Included\Excluded Url can contain '*' ex *.com, *.test.com etc...
if input url is www.test.server.com
IncludedLIst contains *.com and if ExcludedList contains *.test.com
Bestmatch in included is .com less then Bestmatch in ExcludedList .test.com..In this case it has to return false..| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGive an algorithm to compress a memory. To be more clear if you are given a memory of some stored data here and there and some empty and null memory in between, how will you fragment and compress your memory?
- Meenu August 19, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite a code to implement the Sodoku problem.
- Neetu August 12, 2010
Lets say you have a matrix of 9*9 and i can have valued from 1 to 9.
the rules are as below:
1. all the 3*3 matrix shouldn't have any duplicate number.
2. all the rows and columns can't have duplicate numebers.
3. all the diagonal elements in the 9*9 matrix can't have duplicate number.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
Answersyou have given a node of a tree. that node is defined as below:
- Neetu August 12, 2010
node(
int value,
node left;
node right;
node grandparent)
at the starting the grand parent node is null in the tree. you have to assign the grandparent node for all the nodes in the tree.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Data Structures - 0of 0 votes
AnswersGiven two arrays like {1,2,3,4,5} and {3,2,4,5,1}. Output an array which has the index positions on the elements from the first array in the second array.
- manish August 05, 2010
So the answer would be {5,2,1,3,4} as 1 from 1st array exists at 5th position in the second array, 2 from first array exists at 2nd position in the 2nd array and so on.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersHow do you find if onetree is subset of the other?
- manish August 04, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersHow do implement Circular Queue?
- manish August 04, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersHow do implement Queue using Stack and Stack using Queue
- manish August 04, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGiven two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.
- manish August 04, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGiven a book find out the number of times each word appeared. Upon clarification I was told the following things 1. punctuations should be removed 2. case sensitive 3. assume book is given as a huge string to the function prototype 4. Words need not be ordered in any way
- prolific.coder July 13, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 0of 0 votes
AnswerTesting a text box.
- sps July 11, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersTesting a object(paper weight) kind of question.
- sps July 11, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
Answerimplement File.Copy functionality in C#
- sps July 11, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C# - 0of 0 votes
Answersfind the maximum subsequence sum in a linked list. Consider the node as shown below.This node class has a extra item isvertex which determines whether the node is a vertex r not.
- sps July 11, 2010
so find the longest distance between any 2 vertex in the linked list.
Node SLL{
int data;
Node n;
bool isVertex;
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Linked Lists - 0of 0 votes
AnswersWhat should be the test strategy for testing a text engine?
- manish June 27, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
Answers
- Paladin June 09, 2010int IsAnagram(char* str1, char* str2)
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
Answers
- Paladin June 09, 2010int CutNPaste(char* str, int start, int stop, int destination)
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 0of 0 votes
AnswersThere is an array of size 'n' in which first 'a' elements are sorted in either ascending/descending order . The remaining elements 'n-a' elements are again sorted in ascending/descending. Find the index of the point of inflexion.If both parts are sorted in the same way return -1.
- Tenali June 08, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite a program to convert infix expression to postfix expression
- Anonymous June 07, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite a program to find the mirror image of a n-ary tree
- Anonymous June 07, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Trees and Graphs - 1of 1 vote
AnswersPrint a matrix spirally
- Anonymous June 07, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Matrix - 0of 0 votes
AnswersConsider 2 integer Arrays A and B. The elements in both arrays are arranged in ascending order. One of the arrays has exact sufficient space at the end to accommodate the other. Write a function to merge both arrays in ascending order and place it in the largest array.
- Babu Hemanth Kumar May 29, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C - 0of 0 votes
AnswersConsider a right angled Triangle ABC, right angled at B. Lenght of side A (side opposite to angle A)is given. Write a function to find the lengths of side B and side C. The function should take the inputs ( Length of side A and one acute angle either B or C in radians).
- Babu Hemanth Kumar May 29, 2010
1. Write all test cases.
2. Avoid division by zero.
3. Give different ways to implement cosine and sine functions. which one is best and why.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C - 0of 0 votes
AnswersThere are 10 Apple trees. A Farmer has placed these trees in 5 rows of 4 each... Can you tell me how to do it???
- Babu Hemanth Kumar May 29, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Brain Teasers - 0of 0 votes
Answershow will you implement pow(a,b) without using multiplication or division operators. You can use only add/substract operators.
- Anonymous May 23, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm