Microsoft Interview Questions
- 0of 0 votes
AnswersGiven an array , delete all duplicates in it.
- Abhinav May 19, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersTwo unsorted linked lists are given.
- Abhinav May 19, 2010
Find the union.
Eg: a) 1->9->9->5->7->8->9->7
b) 44->33->1->9->55
Result:
1->9->5->7->8->44->33->55
The elements in the result can be in any order| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersGiven a very very long linked list with 'n' nodes.
- Abhinav May 19, 2010
Also given a positive integer 't'>1.
Delete every 't'th node. In the resultant linked list, again delete 't'th node. Repeat this till only t-1 nodes remains.
Find the node.
Eg:
Linked list : 10->20->30->40->50->60->70
n = 7
t = 3
Phase 1:
10->20->40->50->70
Phase-2:
10->20->50->70
Phase-3:
10->20->70
Phase-4:
10->20
Simple solution with many traversals is obvious.
Is there a solution with one traversal or O(n)?
b) Similar for circular linked list.
Keep deleting 't'th node till 1 node remains.
Note here not till 't-1' nodes but till 1 node remains.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm C Coding - 0of 0 votes
AnswersImagine you have a hard disk with blocks of memory 1..n. Files can be stored on one or more of these blocks. If a file spans more than one block, you can know the next block by querying the current block. Also you can query block with Node.isEmpty() method to know if it has any data. The system has a table which has a list of the files and the first node of each file. But that table has been corrupted, reconstruct that table. The names of the files are immaterial and you can get the index as well as the name of the nextblock when you query for Node.NextBlock()
- prolific.coder May 15, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersGiven a array of random integers, sort the odd elements in descending order and even numbers in ascending order.
- k May 09, 2010
e.g. for i/p (1,4,5,2,3,6,7)
O/p = (7,5,3,1,2,4,6)
Optimize for time complexity.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
Answersfind a cycle in a directed graph
- k May 09, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersRandomize a given array, discuss optimizations
- k May 09, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
Answersyou are given 80 balls and out of which only 1 has more weight than other 79. also, you are given weighing machine which can weigh any number of balls of 2 sets( 40 40 or 25 25 etc) at one time.
- Ganesh.Deo May 01, 2010
find the minimum number of steps required to find the ball of more weight than others. (i tried it came out to be 5 steps atleast, but he wanted more efficient solution )| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Brain Teasers - 0of 0 votes
Answerhow will you test a calculator?
- cygonmod May 01, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
Answershow to find a the ph no. of a candidate which is not mentioned in the resume?
- cygonmod May 01, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test General Questions and Comments - 0of 0 votes
AnswersGiven an array of balls, which can be one of two colors (RED or BLUE), write a function that partitions the array in-place such that on exit from the function all the balls of the same color are contiguous. It does not matter whether the red or blue balls come first. The return value from the function is the index of the first ball of the second color. If there is only one color of balls in the array then the return value should be 0. It is not legal to change the color of a ball. They must be moved. Consider performance, memory utilization and code clarity and elegance of the solution when implementing the function.
- abhays.1984 April 09, 2010
C++ Prototype
class Ball
{
public:
enum BallColor { RED, BLUE };
BallColor Color() const { return _color; }
private:
BallColor _color;
// Other data in class (unrelated to assignment)
};
unsigned Partition( Ball aBalls[], unsigned cBalls )
{
//your code goes here
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersTest a DVD player
- dude4133 March 31, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersPerform Sorted Insert on a link list and write test cases
- dude4133 March 31, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersDifference between c++ and c#
- dude4133 March 31, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Object Oriented Design - 0of 0 votes
AnswersCan there exist a loop in a doubly linked list? if so how will you remove it?
- Anonymous March 31, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
Answers#1. Implement (in C++ or C#) a function that removes the nth element of a single linked list.
- abhays.1984 March 19, 2010
C++:
class Node
{
char* value;
Node* next;
};
Node** RemoveNth (Node** list, int n)
{
}
C#:
class Node
{
string value;
Node next;
}
Node RemoveNth(Node list, int n)
{
}
#2. Using the following table provide at least 5 test cases to test the function implemented in the previous part.
Node n Expected Result
~~~~ ~~~ ~~~~~~~~~~~~~~~~~| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding Data Structures Testing - 0of 0 votes
AnswersWrite a function that would: return the 5th element from the end in a singly linked list of integers, in one pass, and then provide a set of test cases against that function
- abhays.1984 March 19, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding Testing Linked Lists - 0of 0 votes
Answerstest MS Excel cell
- bill March 04, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersGiven a time find the angle between hour and minute hand
- Varun February 22, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersReverse a linked list
- Varun February 22, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersReverse a linked list with atmost two extra pointers.
- Rocky February 12, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Linked Lists - 0of 0 votes
AnswersDesign an efficient Data Structure for a Tic Tac Toe game.
- Rocky February 12, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Data Structures - 0of 0 votes
AnswersWrite a function which gives a hint/suggestion for the (i,j) position in a sudoku?
- Anonymous February 01, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite a function that takes an input string and returns a new string containing the unique characters from the input string, in the order in which they appeared in the original string. For example, "This is a string." should return "This atrng.". Show how you would test this function.
- kumar.palike January 26, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersWrite classes you need to support validation of inputs and return values. Show what specific input values and return values you would use to validate it.
- kumar.palike January 26, 2010
C:\>ping.exe /?
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
Answersfind all denomination for a give amount for ATM in C language eg: say x=1000*x1+500*x2+...+1(paise)*xn than find x1,x2,...xn
- anonymous January 14, 2010
try to separate x into maximum no. of denomination.
The code should be in C language.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersHow would you test a general website login page.
- DC December 20, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing