Microsoft Interview Questions
- 0of 0 votes
AnswersWhats a Linked List ? Given Two linked list forming a Y shaped linked list . Find the intersecting node...where one list has more nodes than the other ? Runtime analysis etc etc .
- soni vashisht June 09, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersSpiral Matrix psuedo code(& logic) :|
- soni vashisht June 09, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersYou have multiple mail servers in different places around the world, servers have public and private datastores, resources in public datastore are shared obviously and can be read,modified by any user, how will you test the servers?
- ob June 08, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersGiven a set of words in a dictionary, write a program to group all words which are anagrams of each other in to sets.
- ss June 01, 2011
You can use any C++ STLs or other languages like python if you want to code this..
example:
input:
"bat", "tar", "xyz" , "tab", "tar"
output:
[["bat", tab"], ["tar", rat"],"xyz" ]
(Note: In this example, all words are only of three characters but this is not always guaranteed. The input may contain words with any number of characters)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersImplement the function
- ss June 01, 2011
char* strstr(char* p, char*q)
which returns the pointer to the first occurence of the string q within string p. (Return NULL if either p or q is NULL or if q does not exist in p).| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersImplement the function
- ss June 01, 2011
int pow (int a, int b)
that takes two integers 'a' and 'b' and returns a^b (i.e 'a' raised to the power 'b')
1) Do it using as few multiplication operations as possible.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHere I got one question: Merge two arrays and sort them in order as specified at runtime. The two arrays may share common entries between them, but the resultant array must not have duplicates.
- Siva May 19, 2011
Please define this with space and time complexity.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite test cases for
- Anonymous April 21, 2011
int divide(int a, int b)
you have to use subtract to get the result!| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C - 0of 0 votes
AnswersGiven 2 sorted integer arrays, find the intersecting element in them.
- ST April 18, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersGiven 2 sorted linked lists - merge them. Make sure you don't have duplicates in the merged list. The input lists could have duplicates within them or across the 2 lists.
- ST April 18, 2011| Report Duplicate | Flag | PURGE
Microsoft Citrix System Inc Software Engineer / Developer Software Engineer in Test Algorithm Linked Lists - 0of 0 votes
AnswersWhat data structure would you use to implement spell correction in a document. The goal is to find if a given word typed by the user is in the dictionary or not (no need to correct it).
- April 15, 2011
What is the complexity? What if you have to support multiple languages/dictionaries?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersGiven a matrix of 1s and 0s. Implement an algorithm that sets all cells of row i and column j to 0 if the original matrix has a 0 in cell (i,j). Would the algo change if you have to set it to 1 instead of 0?
- April 15, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersSuppose you are given a cube and each face of the cube contains an array of size N X N. You need to print the entries of this cube in a SPIRAL ORDER.
- Guess Who?? April 15, 2011
1) How would you define a spiral in above case such that there is no collision between each layer of the Spiral?
2)How will you store the above structure i.e. cube?
3) Write the code for the same.
PS: I was only given 20-25 minutes to solve above questions.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersThere is an array of size 50 that is expected to contain all the numbers from 1 to 50 (every number occuring only once). But there is one number in the array that doesnot satisfy this condition i.e. one number is either duplicate or outside 1 to 50 range. Find the correct number that is missing in the array.. O(n) soln required.
- Paras April 15, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersIf I have a string like
- Anonymous April 03, 2011
www.bing.com/abc/asd/asdffg/../asdasd/.../asda/../.../
this is a example ,
if you have /../ then dont remove the letters and / before , just remove /../
www.bing.com/abc/asd/asdffg/asdasd/.../asda/.../
Another example
if you have /.../ then remove the letters before and itself
www.bing.com/abc/asd/asdffg/../../| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 0of 0 votes
AnswersAn array is of size N with integers between 0 and 1024(repetitions allowed). Another array of integers is of size M with no constraints on the numbers. Find which elements of first array are present in the second array. (If you are using extra memory, think of minimizing that still, using bitwise operators)
- ilovealgo April 02, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersLongest substring repeated multiple number of times.
- cc April 02, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 1of 1 vote
AnswersRoman numerals to decimal
- cc April 02, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersDesign middle tier for facebook type application.
- gavinashg March 30, 2011
i.e design a service which accepts IIS requests from client and updates the database.
What are the various interfaces to be exposed on middle tier.
I was asked multiple questions around desgining a component and discuss about the APIs to be exposed. How do we approach such issues.
PS: They wanted me to talk about request context, notifications, callback, thread safe etc| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersDesign an alarm clock for a blind person.
- woohoo March 28, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Application / UI Design - 0of 0 votes
AnswerWhat project are you most proud of doing, and why?
- woohoo March 28, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Experience - 0of 0 votes
AnswersFor SDE Interns...On-site Interview #4
Assume that you have 2^32 bytes of memory. When a program asks to allocate memory, a 4kb chunk of memory gets allocated. It can be allocated at any position (e.g. 0, 57, 8192). Now assume we have a function called lookup(), which, when fed an arbitrary address, (1) returns the value of the starting address of the chunk encompassing the requested address if it was allocated, or (2) returns a value indicating false if no block was allocated. Lookup must work IN CONSTANT TIME. To help clarify the functionality, here is some example expected behavior:Allocate(1) /* allocates bytes 1-4096 */ Allocate(4099) /* allocates bytes 4099-8194 */ Lookup(123) /* returns 1 */ Lookup(4096) /* returns 1 */ Lookup(4098) /* returns -1 or false */ Lookup(6042) /* returns 4099 */ Lookup(8198) /* returns -1 or false */
To the readers, my solution had 2 checks maximum (and thus was O(1)). I have provided the solution as pseudocode, java code, and given links to images depicting the reasoning behind my solution as responses below.
- woohoo March 28, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersFor SDE Interns...On-site Interview #3
- woohoo March 28, 2011
Pretend you work for a phone company. At your company, you have a satellite that routes phone calls. We want to bill customers by the maximum number of simultaneous phone calls they make in a single day. (After asking clarifying questions I received the following information: assume no calls last more than 24 hours and that at midnight each night all the calls are automatically dropped. In the event that one call ends as soon as another starts, answer part 2 of this question in such a way as to maximize revenue).
What information should the satellite store for each phone call? Define a data structure for this (e.g. write a struct).
Write a function that finds the maximum number of simultaneous phone calls from a given customer. (Hint: typical solution is O(nlogn), but if you use an absurd amount of memory like I did, it can be done in O(n)).
Edit: Your solution should not be real-time. The data has already been collected and you need to work with it.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm