Microsoft Interview Questions
- 0of 0 votes
AnswersWrite an algorithm to check if a tree is BINARY or not.
- kenny September 03, 2012 in India
You are just passed the root of the tree.| Report Duplicate | Flag | PURGE
Microsoft Algorithm - 0of 0 votes
AnswersAlgorithm best suited to sort a linked list.
- kenny September 02, 2012 in India
Write a C program to implement that algo.| Report Duplicate | Flag | PURGE
Microsoft Algorithm - 0of 0 votes
AnswersThere is a linked list where some nodes have similar number. Sort them such that all the similar number nodes are cluster together.
- learn September 01, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersYou have a book will billion pages. Each Page P has L lines and each lines has W number of words. Design a search algorithm which gives me best match search results. Best match is when all the words given by user exactly matches.
- CodeBuster August 31, 2012 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersYou came to a parking lot which is like a long road, which goes till very large length(say infinite length). Car parked on both sides of that road. You parked your car somewhere and forgot where is it. Write algirithm and then code to search your car. Note that- you dont know length of parking lot and you cant assume its length, you dont know where is your car, you are in middle of somewhere and your car might be in any side of the road
- CodeBuster August 31, 2012 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersManage n queues in a given memory.
- Naveen Reddy Mandadi August 31, 2012 in India
Support below operations on queues.
//initialize n queues in memory m of size s
//queues will be identified with numbers from 0 to n-1
void initialize(void* m,int s,int n);
//enqueue object o into queue identified by q
//as long as there is free memory this should be successful
void enqueue(int q,Object o);
//dequeue an object from queue identified by q
Object dequeue(int q);
Give the best solution such that there will be minimum relocation of queues| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Algorithm - 0of 0 votes
AnswersImplement a hashset of size M for numbers.
- aditya.eagle059 August 30, 2012 in India
Minimum candidate number will be 1, maximum candidate number can be N. (N>M)
I said simply to initialize an array of size N. when a number X comes in set Arr[X]=1. For lookup return the value of Arr[X].
He was fine with it, but asked me to give a better algorithm where initialization of array is NOT required. In above case we are assuming all elements of arr will be initialized to 0.
How can we do this any ideas ?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersTwo elements of BST are swapped by mistake. You have to restore the tree without changing its structure.
- Nascent August 30, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Trees and Graphs - 2of 2 votes
AnswersWrite down the various test cases for railway portal system. write the situation when it can crash.
- Aalok August 27, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Testing - 0of 0 votes
AnswersRemove all two zeros in the given string.
- Naveen Reddy Mandadi August 25, 2012 in India
Example: a3409jd00dk000d
Output: a3409jddk000d
Note: If there are less/more than two zeros consecutive, it should not be replaced.| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Algorithm - 0of 0 votes
AnswersFind sub-array in an array of integers whose sum is maximum, integers can be negative, zero or positive.
- Naveen Reddy Mandadi August 25, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Algorithm - 0of 0 votes
AnswersFind a raised to the power b, where both a and b are integers
- Naveen Reddy Mandadi August 25, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Algorithm - 0of 0 votes
AnswersMultiply two large integers represented in char array.
- Naveen Reddy Mandadi August 25, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Algorithm - 0of 0 votes
AnswersGiven two string, check whether the other is permutation of first one or not.
- androidify August 25, 2012 in United States
Eg: box
xob Ans: True
Eg: box
obxx : Ans: False
This was simple one for Microsoft Developer profile.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 1of 1 vote
AnswersGiven a sorted doubly linked list, create a binary tree which is well balanced.
- androidify August 25, 2012 in United States
No example was given in the test.
Used the method similar to binary search.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
AnswersCheck whether a singly linked list is a pallindrome.
- androidify August 25, 2012 in United States
Eg: 1->2->1 Ans: True
1->3->2->1 Ans: False
I did it by using recursion in O(n) time.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
Answersyou are given a system of passing binary trees among 2 ppl
- Aashish August 24, 2012 in India
Step1: convert the tree to preorder and inorder strings
Step2:send those strings to the intended person
Step3:get back tree from the strings
whats your strategy of testing?write various test scenarios.---10 marks| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersWe have a text editor application where we can choose 1)between 100s of
- Aashish August 24, 2012 in India
different fonts like arial, calibri, etc.. 2)different text sizes 3) different formatting such as bold, Italics, regular, etc..
Imagine that the application is similar to word(there we will have these options). Now give different test cases to test this application.| Report Duplicate | Flag | PURGE
Microsoft Software Development Manager - -4of 4 votes
Answerswhat pattern can we expect for microsoft written test? or like from what areas can we expect questions?
- satyasri.achanta August 24, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
Answersgiven a n*n matrix A[]of distinct integers, find a index i,j such that a[i][j]<a[i+1][j],a[i][j]<a[i][j+1],a[i][j]<a[i-1][j],a[i][j]<a[i][j-1],
- learn August 23, 2012 in United States
time complexity should be less than O(n^2)| Report Duplicate | Flag | PURGE
Microsoft Algorithm - 0of 0 votes
AnswersAn unsorted array is given, where there is no specific range in which the elements occur. There is only one duplicate element present in it. Let it is a[i]. It should be within the half of the size of the array from where it appears for first time. i.e. the duplicate element should be within (i+(arr_size/2)), at ith index it appears for 1st time. Find the duplicate element with minimum number comparisons.
- Psycho August 23, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
Answersdouble factorial of a number N
- ayush.tiet August 22, 2012 in India
example: N!!| Report Duplicate | Flag | PURGE
Microsoft Developer Program Engineer Algorithm - -1of 1 vote
Answers1)find first N factorial primes (not prime factorials)
- ayush.tiet August 22, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Developer Program Engineer Algorithm - -1of 1 vote
Answerswrite efficient program to find the sum of x^y + y^ and x^y - y^x and x^y/y^x and x^y*y^x
- ayush.tiet August 22, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Developer Program Engineer Algorithm - 0of 0 votes
AnswersTest cases for finger print reader say in a laptop to login. Here you can swipe your finger to have a secured login. e.g. I will swipe my finger and the system will allow me to login.
- Aashish August 22, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswerDesign a crawler
- sb August 21, 2012 in India
constrains- a website can ban you if there are more than 5 parallel requests on that website at a time.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Application / UI Design - 1of 1 vote
AnswersGiven an array with positive, negative and zeros, arrange the given array such that negatives are on left, zeros in the middle and positives on the right.
- babbupandey August 20, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm Arrays