Microsoft Interview Questions
- 0of 0 votes
AnswersRound 2:(1.h 15min)
- dutta.dipankar08 May 19, 2014 in India for MS Office Platform
===================
Q1. Given a sorted array having duplicate elements,how would you find first index of a given element in O(nlogn).
Write code for it. Change the condition to find out last index of that elements.
[ Hint Binary search]| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - -2of 2 votes
AnswersR1 | Q2. Find an element in a sorted rotated array in O(nlogn ) complexity.
- dutta.dipankar08 May 19, 2014 in India for MS Office Platform| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersRound 1: (1 h)
- dutta.dipankar08 May 19, 2014 in India for MS Office Platform
==============
Q1. Design a Garbage collector like java. How would you detect depended reference loop ?
Hist : Class design, Cycle detection algorithms for disjoint graph( List of connected graph)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - -1of 3 votes
AnswersThere is a byte array which contains the character of one byte and two bytes. One byte character has range 0 to 127 and first character of 2 byte character is 128 to 255 and second byte character has range 0 to 255. Now, two pointers are given, one points to the start of the and another points to somewhere else.
- !@# May 16, 2014 in India
Tell which character 2nd pointers points to?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a set of 21 tasks = {A, B,....Z} except I, O, U, X and Q. Each task requires 4 hours of processing. Except for tasks E, Y, P, R, W that require 8 hours of processing.
- foobar May 14, 2014 in United States
You have 3 machines to process these tasks = T1, T2, T3. T1 and T2 are available everyday for 8 hours. T3 is available only on Mon, Wed and Fri for 8 hours.
You are given 3 lists that indicate the dependency list among the tasks.
L1 = A->R->K->M (eg A can be completed if R is completed, R can be completed only if K is completed etc.)
L2 = N->G->V->E->Z->H
L3 = C->F->Y->D->J->P->T->S->W->B->C (cycle)
Each task needs one machine for its duration to complete.
Tasks cannot be resumed. Which means the 8 hour tasks cannot be executed over 2 days.
Each machine can process only one task at any time.
T1, T2 and T3 can process different tasks in parallel.
You are starting your schedule on a Wednesday.
Machines can be scheduled only during weekdays.
The first Monday in your schedule is a downtime for all the machines.
Given these constraints, write a program that generates a schedule between the tasks and machines such that all the tasks are completed at the
earliest.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm C++ Coding - 0of 4 votes
AnswersGiven a linked list with next and high pointers, populate high pointers to the next higher node, inplace and O(n).
- HardCode May 13, 2014 in India| Report Duplicate | Flag | PURGE
Microsoft Linked Lists - 0of 0 votes
AnswersGiven a table of the form:
- 14mit1010 May 11, 2014 in United States
1 A,B,C,A,B
2 A,B,A,A,A
3 C,D,C
Give the number of duplicate characters, eg: for 1 there are 2 A's and 2 B's, so the result is 2
For 2 A is repeated 4 times so the result is 3
For 3, C is repeated twice so the result is 1
My suggestion was to use a CLRSQL function to calculate it| Report Duplicate | Flag | PURGE
Microsoft SDE1 SQL - 1of 1 vote
AnswersWrite a function to return a path from a given node of a Binary tree to the node on its right.
- 14mit1010 May 10, 2014 in India
Each node contains a left pointer, a right pointer and a parent pointer
The root node is not provided, the tree is not balanced, the tree is not a Binary search tree
Finding the root node and running BFS from there is not an acceptable solution. You have 30 minutes to give syntactically correct code
I was unable to complete this question and was rejected without further interviews. Perhaps I did something to offend the interviewer, this was for an entry level SDE position| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
AnswersYou have a set of pairs of characters that gives a partial ordering between the characters. Each pair (a, b) means that a should be before b. Write a program that displays a sequence of characters that keeps the partial ordering (topological sorting).
- iwanna May 05, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm - 0of 2 votes
AnswersGiven pattern P (say aba) search for the pattern if the input is a stream of characters.
- Goooogle2014 May 02, 2014 in United States for Bing
1. You cant store the stream of chars. not even till Length(P)
2. You have access to only one char of stream at a time.
I gave KMP algo which was okay for him, but he mentioned you could have used some better DS..
I am wondering which DS can be used to store pattern..
Trie ???
You need to consider cases for stream like aababa
there are 2 occurences| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 2of 2 votes
Answersgiven a string determine which character appears the most and the number of times that character appeared.
- Glenwright327 April 25, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersAs you are on Seattle, tell me how many rain drops pour on earth every year
- Mukesh Dua April 24, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft SDE-2 - 0of 0 votes
AnswersWe have a bag containing numbers 1, 2, 3, …, 100. Each number appears exactly once, so there are 100 numbers. Now one number is randomly picked out of the bag. Find the missing number.
- Mukesh Dua April 24, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft SDE-2 - 1of 1 vote
AnswersWhat do you think is the next big thing in technology? For example, search engine is Google, social media is Facebook, etc. etc...
- pritabread March 05, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Behavioral - 0of 0 votes
Answers"How would you find the number of gas stations in the United States?"
- pritabread March 05, 2014 in United States
*You cannot look up any concrete information (like the average number of gas stations per state), but you need to yield an accurate answer.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswersImplement a class that does string manipulation by overloading the following operators: <<, >>, = and ==. For example consider the following code:
- Pritam March 05, 2014 in United States
StrShift example;
example = “Microsoft”;
printf(“\”example << 2\” results in %s\n“, example << 2);
In the above code the output would be “ftMicroso” which shows the last two characters of the string “Microsoft” rotated to the left of the string. Please note that state is maintained so two calls of example << 1 would give the same end result as calling example << 2 once.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 3of 3 votes
Answers3. Write a class that represents a minimal heap. The heap class should at a minimum support the following methods:
- Pritam March 04, 2014 in United States
- AllocTinyHeap() which should initialize the heap with a given amount of bytes
- DeleteTinyHeap() which frees all memory associated with the heap
- TinyAlloc() which allocates a given number of bytes on the heap if there is room
- TinyFree() which frees a specific location on the heap
You may define whatever parameters are necessary for the above methods as well as write any additional methods. Overall consideration will be given to correctness, design, code readability as well as any unit testing done. As part of a final solution please submit test cases you used to verify correctness in addition to any unit tests done.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 1of 1 vote
AnswersMove the first n numbers in a 10 element array to the end.
- FrickenHamster March 03, 2014 in United States for Lync
I think the way to do it was to reverse the array and then reverse the first 10-n and then the last n.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Arrays - 1of 3 votes
AnswersOne of the questions in one of the interviews -
- pretentious.bastard March 03, 2014 in United States for SQL BI
Given a stack S and another empty stack T and a variable v, write a function that returns S but with its elements reversed.| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Stacks - 0of 0 votes
AnswersSuppose you have a collection of collection
- MM February 24, 2014 in United States
Eg : CEO-> Vps-> GMs ->..
CEO will contain collection of VP's, VP's will have collection of GM's and so on.
Suppose you need to find a particular GM is the alias is given. Write a linq query to get the employee details if the employee alias is given.
Hint : Use Recursion + Linq| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Software Development Manager - 1of 1 vote
AnswersGiven an array of integers and a length L, find a sub-array of length L such that the products of all integers are the biggest.
- hongbin034 February 24, 2014 in United States
Example:
Input: {4, 1, -7, -8, 9}, 3
Output: {-7,-8,9}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersDesign a download manager. The download manager would be shipped with a browser. Detailed design of components and interaction between them.
- pretentious.bastard February 24, 2014 in United States for Windows Azure Mobile
Follow up question - What features would you add to the download manager so that it is more marketable than others.| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Object Oriented Design - 0of 0 votes
AnswersSuppose you get number of unique users every second from bing
- MM February 24, 2014 in United States
For eg, 2,4,5,1,2,etc
You need to write a web service method , such that it takes the input n, which return lowest n unique number from the list of unique numbers. For eg, if n is 3 then you need to return 2,1,2| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 1of 1 vote
AnswersA draw method is given, write a function to draw a chess board. The Draw method, draws a square and has parameters row position, column position and color.
- MM February 23, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersForgot to add this question along with my previous...
- Jeanclaude January 27, 2014 in United States
This is a brain teaser type question...
S E N D
+
M O R E
--------------
M O N E Y
--------------
Each of the above characters hold a specific value which is unique (meaning no two characters have same value). Now the question is, to uncover what value each character stands for...
(Hint - 'M' has to be 1 because it's the carry in the result (M O N E Y). Now similarly back track the rest of the characters)
Note: this hint is given by me, for the sake of understanding the question for interested folks, it was not given to me in the interview).| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersImagine we have a large string like this "ABCBAHELLOHOWRACECARAREYOUIAMAIDOINGGOOD" which contains multiple palindromes within it, like ABCBA, RACECAR, ARA, IAMAI etc... Now write a method which will accept this large string and return the largest palindrome from this string. If there are two palindromes which are of same size, it would be sufficient to just return any one of them.
- Jeanclaude January 22, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 0of 0 votes
AnswersTest cases for int rand() which returns a random number between 0 - 999
- IntwPrep.MS January 17, 2014 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer - 2of 2 votes
AnswersGiven a number give its english form
- IntwPrep.MS January 17, 2014 in United States for Bing
1-> One
999 -> Nine hundred and ninety nine
Max number is: 999, 999, 999| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer - 0of 0 votes
AnswersDesign a webservice which would take a word, and return all anagrams
- IntwPrep.MS January 17, 2014 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer - 2of 2 votes
AnswersGiven a graph that where A->B indicates that node A should be processed before processing B. Design an parallel algorithm to process all the nodes
- IntwPrep.MS January 17, 2014 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer