Microsoft Interview Questions
- 0of 0 votes
Answerswhat's the difference between abstract class and interface?
- Jackie June 19, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Object Oriented Design - 0of 0 votes
AnswerHow will you test a mouse ?
- CUNOMAD May 25, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersHow will you test a keyboard ?
- CUNOMAD May 25, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersHow will you test a notepad ?
- CUNOMAD May 25, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersDiscuss the strategies of how would you check if two folders are in sync or not.(should contain the same files).
- prolificcoder April 27, 2009
Alternative ways and mostly a discussion kind of question| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Ideas - 0of 0 votes
AnswersConvert a binary search tree to a circular sorted linked list. The highest valued node should point to the lowest valued node at each step.
- prolificcoder April 27, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C++ Coding Data Structures Linked Lists - 0of 0 votes
AnswersTest a function that sorts a linked list. You have two pointers head which is the original unsorted list and head1 which is said to be the sorted linked list. Return true if head1 did the sorting correctly and return false if not.
bool testlinkedlistsort(Node *head,Node *head1)
I got the solution correct but messed it up while writing it over the white board :|
- prolificcoder April 27, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C++ Coding Data Structures Debugging Testing Linked Lists - 0of 0 votes
AnswersDesign testcases for the strcpy function.
- Anonymous March 27, 2009// Takes two null terminated strings // and copies the chars in src onto dest // including the null character. strcpy(char *dest, char *src);
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersHow would you eliminate duplicates in a linked list(singly) without using extra memory. You can use new variables for storing pointers but cannot go on to have a pointer for each node in the list.
- MSrej March 08, 2009
- The values in the node are unicode characters.
- for eg: a->b->c->a->d->NULL
should be transformed to:
a->b->c->d->NULL| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Linked Lists - 1of 0 votes
AnswersThere are two linked lists which converge at one point. Return the 1st node at which they converge
[__]-->[__]-->[__]--> [__]-->[__] [__]-->
Hope my diagram is understandable
- Anonymous February 11, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Software Engineer in Test Linked Lists - 1of 0 votes
AnswersYou are creating a calculator for a second grader kids.
- Daniel Johnson February 07, 2009
Write a function:
int Calculate(char *in)
where char *in is a string that contains an expression like: "1+2" or "-234334-345345" and you return the results accordingly. It is given that there would be two operands and an operator between them.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C++ Object Oriented Design - 0of 0 votes
AnswersA binary tree contain integer values (both positive and negative) in its data field. Given a number N, find a path from root to leaf which sums to N.
- Daniel Johnson February 07, 2009
bool ContainsSum(btree *root, int N)
It was simple. By doing a iterative pre-order traversal, and keeping tab of sum of elements, we can easily determine if sum of elements from root to any of the leaves is equals to N.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Data Structures - 1of 1 vote
AnswersThis problem is called Maximum contiguous sub sequence sum problem. I have been asked this question more than once at different interviews at Microsoft.
Given an array which can contain both positive and negative numbers, find the maximum contiguous sub sequence sum.
For example in an array = {2, -3, 4, -5, 6, -3, 8}, it should return 11.
Here was my solution.
- Daniel Johnson February 07, 2009maxsofar = 0 maxendinghere = 0 for i = [0, n) /* invariant: maxendinghere and maxsofar are accurate are accurate for x[0..i-1] */ maxendinghere = max(maxendinghere + x[i], 0) maxsofar = max(maxsofar, maxendinghere)
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGiven a set of points in a co-ordinate plane, how can you form a spiral??
- Venkata Sadineni February 07, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 1of 0 votes
AnswersYou have been given a sorted array which has been rotated unknown number of times.
- Daniel Johnson February 04, 2009
For example: 7 6 5 1 2 3 4
Find the number of times it is rotated. Your algorithm should be less than O(n).
Follow up questions: Test on the following input.
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1....10^10 times 1.
He wanted a foolproof algorithm that will not break on these stress cases. It was for Windows Manageability Group.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 2of 2 votes
Answershow would you merge two sorted arrays provided not to use a third array nor u can allocate extra space. try to optimize the problem to the best. time complexity should be less than O(n^2)
- not a looser January 19, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Software Engineer in Test Arrays - 5of 0 votes
AnswersGiven a string where there are numbers and some numbers are repeated, e.g. 13413124...,
- Anonymous December 29, 2008
design a data structure for it and the data structure should store positions of each number.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGiven That One of the strings is very very long , and the other one could be of various sizes. Windowing will result in O(N+M) solution but could it be better? May be NlogM or even better?
- me December 28, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersWAP for tic-tac-toe game and test it
- An December 15, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C - 2of 0 votes
Answers1. Carefully see the following transition from one word to other-
- Aks December 07, 2008
PAN -> PEN -> MEN -> MET
Here each word is achieved by changing any one character in previous word. Now you are given with a Source word (PAN here) and a Destination word (MET here) and need to find out shortest transition chain following above rule using only meaningful words. Dictionary containing thousands of meaningful words is provided to you. WAP for this.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGiven a string and print the words which have the same exact letters. Space is the only seperator.
- Nina November 18, 2008
For example, abc bbe bca derwe eeb
it will print abc bca.
abc bbe abcd derwe eeb will print nothing.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite code and test cases for traversing a linked list.
- Aniruddha Gore November 03, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing Linked Lists - 1of 1 vote
AnswersWrite code and test cases for reversing a C-style string.
- Aniruddha Gore November 02, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C String Manipulation Testing - 2of 0 votes
AnswersIn MS Excel, the column numbers are named as A, B, C, ......, Z. If you go beyond this 'Z' column you will encounter AA-->AZ, BA-->BZ, .... ZA-->ZZ then AAA-->AAZ, ABA-->ABZ, ........ and you can imagine how long this sequence can go! The question was to write a function which takes in a positive integer and
- Aniruddha Gore November 02, 2008
returns the character set at that column. For example: if column number is 26 my function must return 'AA' (0-based index). I basically started looking for any specific pattern if I can find for how many columns names are 1 letter, 2 letter, etc. fortunately there's a pattern involved. I couldn't solve the question completely as we ran out of time but interviewer seemed satisfied as I started by looking for a pattern and not sat down to code without giving a thought.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 1of 1 vote
AnswersWrite a function int Compare_Strings(char* str1, char* str2){...} such that the function returns +1, -1 or 0 based on whether str1 is LEXICOGRAPHICALLY greater, smaller or equal to
- Aniruddha Gore November 02, 2008
str2; the comparison should be case-insensitive. For example: "abc" is smaller than "mno" as 'a's ASCII value is less than 'm's. However, "ABC" and "abc" are equal.
Also discuss the test-cases.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 0of 0 votes
AnswersHow would you know whether a website like gmail or yahoomail is reliable?
- Anonymous October 28, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersDefine a two-dimensional boolean array. Minimize the memory allocated. Write a function to set a value to an element of this array.
- Anonymous October 28, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Arrays