Upload Button Icon Add office photos

Microsoft Corporation

Compare button icon Compare button icon Compare

Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards

zig zag pattern zig zag pattern

Filter interviews by

Microsoft Corporation Interview Questions, Process, and Tips

Updated 8 Mar 2025

Top Microsoft Corporation Interview Questions and Answers

View all 735 questions

Microsoft Corporation Interview Experiences

Popular Designations

557 interviews found

Interview Questions & Answers

user image Anonymous

posted on 20 May 2015

Interview Questionnaire 

17 Questions

  • Q1. Light is falling on a tree from left side you have to find all the nodes on which this light will fall
  • Ans. 

    The light will fall on the nodes of the tree that are on the left side.

    • Nodes on the left side of the tree will receive the light.

    • Nodes on the right side of the tree will not receive the light.

    • The nodes at the top of the tree may or may not receive the light depending on the angle of incidence.

  • Answered by AI
  • Q2. Check whether a link list is palindrome or not
  • Ans. 

    Check whether a link list is palindrome or not

    • Traverse the linked list and store the values in an array

    • Compare the elements of the array from both ends to check for palindrome

  • Answered by AI
  • Q3. Minimum Edit Distance
  • Ans. 

    Minimum Edit Distance is the minimum number of operations required to transform one string into another.

    • Operations include insertion, deletion, and substitution of characters.

    • Dynamic programming can be used to calculate the minimum edit distance.

    • Example: Minimum edit distance between 'kitten' and 'sitting' is 3.

  • Answered by AI
  • Q4. ZigZag traversal of tree
  • Ans. 

    ZigZag traversal of a tree involves visiting nodes in a zigzag pattern, alternating between left and right children at each level.

    • Start by visiting the root node

    • For each level, alternate between visiting nodes from left to right and right to left

    • Use a queue data structure to keep track of nodes at each level

    • Example: For a tree with root node 1, left child 2, right child 3, left child of 2, right child of 2, left child ...

  • Answered by AI
  • Q5. Pair wise elements which sum to a given value
  • Ans. 

    The question is about finding pairs of elements in an array that sum up to a given value.

    • Iterate through the array and for each element, check if the complement (given value minus the current element) exists in the array.

    • Use a hash set or hash map to store the elements as you iterate through the array for efficient lookup.

    • If the complement exists, you have found a pair that sums up to the given value.

    • Repeat the process...

  • Answered by AI
  • Q6. Intersection point of two linklists
  • Ans. 

    Intersection point of two linked lists

    • Traverse both linked lists to find their lengths

    • Calculate the difference in lengths and move the pointer of the longer list by the difference

    • Move both pointers simultaneously until they meet at the intersection point

  • Answered by AI
  • Q7. Maximum in sliding window
  • Ans. 

    Find the maximum value in a sliding window of a given size in an array.

    • Use a deque to store indices of elements in the current window.

    • Keep the deque in decreasing order of values to easily find the maximum.

    • Slide the window and update the deque accordingly.

    • Return the maximum values for each window.

  • Answered by AI
  • Q8. You have a list of program files, how will you decide which file to compile first and which later, what data structure you will use for storing these dependencies
  • Ans. 

    Use topological sorting to determine the order of compilation. Store dependencies in a graph data structure.

    • Use topological sorting to determine the order of compilation based on dependencies

    • Store dependencies in a graph data structure like adjacency list or adjacency matrix

    • Example: If file A depends on file B, then B should be compiled before A

  • Answered by AI
  • Q9. Best Fit
  • Q10. You have been given time intervals of a you tube video watched mostly. You have to find out the most watched time interval, so that you can put an ad in between that section
  • Ans. 

    The most watched time interval of a YouTube video is determined based on given time intervals.

    • Iterate through the given time intervals

    • Count the number of overlaps for each interval

    • Find the interval with the maximum number of overlaps

    • Place the ad in between that section

  • Answered by AI
  • Q11. Find a number in an infinite stream of sorted numbers
  • Q12. What happens when a computer starts?
  • Ans. 

    When a computer starts, it goes through a series of processes to initialize its hardware and software.

    • The computer's power supply sends electricity to the motherboard.

    • The motherboard checks the hardware components and performs a Power-On Self-Test (POST).

    • The BIOS (Basic Input/Output System) is activated and loads the operating system from the hard drive or other storage device.

    • The operating system initializes and start...

  • Answered by AI
  • Q13. Write a hashing function for storing stream of words
  • Q14. A lot about my projects, what is the best thing you have done so far
  • Q15. Populate sibling pointers in a tree
  • Ans. 

    Populate sibling pointers in a tree

    • Traverse the tree in level order and maintain a queue

    • For each node, set its sibling pointer to the next node in the queue

    • If a node has no sibling, set its sibling pointer to null

  • Answered by AI
  • Q16. TCP/IP, http/https, how to establish a secure connection or send an encrypted data, PPP protocol
  • Q17. Virtual memory

Interview Preparation Tips

College Name: NA

Skills evaluated in this interview

Interview Questions & Answers

user image Anonymous

posted on 20 May 2015

Interview Questionnaire 

13 Questions

  • Q1. Introduce myself
  • Q2. What do I know about CRM
  • Ans. 

    CRM stands for Customer Relationship Management. It is a strategy for managing interactions with customers and potential customers.

    • CRM helps businesses to improve customer relationships and increase sales

    • It involves collecting and analyzing customer data to better understand their needs and preferences

    • CRM software can automate and streamline customer interactions, such as email marketing and customer support

    • Examples of...

  • Answered by AI
  • Q3. Given a client and a server and each of them has a queue in it. Client has to copy the contents of the queue to the server once the internet connection is up. The amount of data which it can copy at one go...
  • Q4. Deep discussion on the current project which i’m working on currently
  • Q5. Permutation of string with test cases
  • Ans. 

    Generate all permutations of a given string

    • Use recursion to generate all possible permutations

    • Swap characters in the string to create different permutations

    • Store each permutation in an array of strings

  • Answered by AI
  • Q6. Asked me about the current project which im working on
  • Q7. Few questions on the technologies which were used in the project
  • Q8. Given N prisoners who are standing in a line and M hatred relationships among them say,P1 hates P2, P3 hates P1, P3 hates P5 etc.. If any of the hate relation contains invalid cases like P1 hates P3 and P3...
  • Q9. Given a root, particular node and distance in a binary tree,.. say (struct node *root, struct node *n,int k) print all nodes which are at a distance of ‘k’ from node ‘n’. He asked me to write the code
  • Q10. Why Microsoft?
  • Q11. Why do u want to leave your current company?
  • Q12. Deep discussion on the current project which I’m working on
  • Q13. Given a binary tree how to construct the mirror tree out of it. I gave a recursive solution. He asked me to write the code for it. He asked me to write the same without using recursion and test cases for ...

Interview Preparation Tips

Round: Test
Experience: 1. Given a sentence say, “these are twelve pens and thirty two sheets” convert this sentence to “these are 12 pens and 32 sheets”. We were asked to do it inline. The interviewer called each one of us and asked us to explain the approach.we were asked to minimize the space and time complexity.

Round: HR Interview
Experience: 1.Discussion on current compensation etc.Overall, it was really a good experience.Thanks a lot.

College Name: NA

Skills evaluated in this interview

Interview Questions & Answers

user image Anonymous

posted on 21 May 2015

Interview Questionnaire 

3 Questions

  • Q1. Write test cases to perform “pair-wise” reverse a linked list.. (Sample Inp 3->4->5->6->7->8, Output 7->8->5->6->3->4. )
  • Q2. Write code for the same problem that satisfies all the above testcase
  • Q3. Given a random function rand(n) , how ll u test that it returns exactly the random numbers between 1 to n?
  • Ans. 

    To test the rand(n) function, generate a large number of random outputs and check if they fall within the range of 1 to n.

    • Generate a large number of random outputs using rand(n)

    • Check if each output falls within the range of 1 to n

    • Repeat the process multiple times to ensure consistency

    • Use statistical tests like chi-squared test to analyze the randomness

  • Answered by AI

Interview Preparation Tips

Round: Technical Interview
Experience: His round is mostly a tech interview with a couple of HR questions here and there.Most of thequestions required writing algorithms. Here are some sample questions:·         “How was the aptitude? You dont seem to happy about it”·         Given two sorted linked lists, merge them to a single sorted list. They will ask for recursive code and also to explain it with some sample inputs.·         Given an array of just two numbers (Ex: 1′s and 0′s), sort them in an efficient way,(somevariations include 3 numbers), also you are required to do it in O(n) solution.·         Write a recursive code to find loop in a singlely link list.This round is easy compared to some of the other rounds. Only a couple questions 4-5 not more here.

Round: HR Interview
Experience: This was longest and toughest round so far as i have heard, most of he people who attended said it was hard. It is also a pure technical round. First after all the introduction, they ask you about the toughest project you have done (Thinking about it me friend said all were easy dont say that :D). My friend told him about his TGMC(the great mind challenge ibm), and questions were asked in detail, as detailed as you can get. Basically you say something he changes it and asks a questions(how can you improve that you _ _ stuff like that). My friend was doing a web related project and they asked him this: given a list of URL’s of the type (URL,type,content) write a program to list out which are the porn site and which are not porn(my friend was like sites with XXX continuously is porn he asked more details, seemed like he knew a lot of porn sites). They kept pointing out this and that while your writing your code and ask you to make certain parted more optimized. For example my friend used 4 flags for the above code he wanted it done with the maximum use of 2 flags and also he want graphs concept to be used.My friend took a good 1 and a half  hours for his part.Then you have to write test cases for the code you have written,(wrote around 30 questions). Then you have to tick which test cases your code handles properly. Then modify the code again to make it work for the remaining cases. The last question was “How to test whether or not a server is good ”( consistency, scalability….).  This is the longest and tuffest round of all. Basically be EXTRA through about a single project.

Round: Technical Interview
Experience: Q1: Write test cases to perform “pair-wise” reverse a linked list.. (Sample Inp  3->4->5->6->7->8, Output 7->8->5->6->3->4. )



Q2: Write code for the same problem that satisfies all the above testcase.



Q3. Given a random function rand(n) , how ll u test that it returns exactly the random numbers between  1 to n?

Round: HR Interview
Experience: HR(they say its HR its not!!):This was not HR. They ask a lot of questions again, no pen or pencil face to face tech chat.



You have to name two subjects you like the most and they ask you questions from it. (I am going to expalin in direct speech)My friends said Computer organization and design and datastructures. Lot of questions about cache, virtual memory, write back and write through.In datastructures about hash table, arrays listed list, advantages and dis advantages of hash table.Also he asked a simple program to wrap it all up:” Given an array of numbers each number is repeated twice, find the only number that is not repeated ”. My friend started with O(n^2) solution, moved on with O(nlogn)(like 5 solutions).He still wanted better and gave clues (he wanted me to use sign bitsJ ).After about 30 minutes it was overIf you are selected they call you to a room and give you a FREE t-SHIRT AND A CAP  .



Most important point..In all the rounds they finally asked ” Do u have any questions ” , Ask good questions here MY friend asked about stuff relating to the companies technology , number of employees, a couple of things about the c compiler, java etc.



Good Luck

College Name: NA

Skills evaluated in this interview

Interview Questions & Answers

user image Anonymous

posted on 25 Aug 2015

Interview Preparation Tips

Round: Test
Experience: 15 objective questions and 2 coding questions. The objective questions were to be done in 25 minutes based on C++ and algorithms (not core subjects like OS or compilers surprisingly). 2 coding questions were:
- Mirror a binary tree
- Some question on bit-manipulation


Round: Technical Interview
Experience: There were just 2 technical rounds: Given an array with pointers to nodes of a n-ary tree with each node containing the parent Id as well. Reconstruct the original tree from the node. Also write down what the structure of the node will look like. The second round was: write a working code to merge 2 linked lists.

College Name: IIT Kanpur

Microsoft Corporation interview questions for popular designations

 Software Engineer

 (65)

 Software Developer

 (62)

 Senior Software Engineer

 (28)

 Software Developer Intern

 (24)

 Intern

 (20)

 Technical Support Engineer

 (14)

 Software Development Engineer

 (11)

 Data Scientist

 (10)

Developer Interview Questions & Answers

user image Anonymous

posted on 12 Sep 2015

Interview Questionnaire 

8 Questions

  • Q1. Given a binary tree (not necessarily complete), connect a node to the node to its right (at the same level). Assume you have an extra pointer in the node to perform the connection
  • Ans. 

    Connect nodes to their right in a binary tree using an extra pointer.

    • Traverse the tree using level order traversal

    • For each node, connect its right child to the next node in the level

    • If there is no next node, set the right child to null

  • Answered by AI
  • Q2. Given a sentence, write a function, which when called, would return the first word in the string and modify the string to contain from second to the last word
  • Q3. Design an elevator system, where there are 5 elevators and 50 floors. What would be the design considerations on which elevator should come when a button is pressed on a given floor?
  • Ans. 

    Design considerations for an elevator system with 5 elevators and 50 floors.

    • Traffic patterns and peak hours should be analyzed to determine the optimal number of elevators to be in operation at any given time.

    • Elevators should be programmed to prioritize stops based on the direction of travel and the proximity of the requested floor to the elevator's current location.

    • The system should be designed to minimize wait times ...

  • Answered by AI
  • Q4. Differences between threads, processes and many such questions
  • Q5. Given two linked lists, find if they have a common node
  • Ans. 

    Given two linked lists, check if they have a common node.

    • Traverse both lists and compare each node's memory address

    • Use a hash table to store memory addresses of nodes in one list and check for matches in the other list

    • If one list is shorter, traverse it first and then start traversing the longer list from the difference in length

  • Answered by AI
  • Q6. Given an array, find if it contains a majority element. An element is a majority element if it occurs more than 50% of times. Do it in O(n)
  • Ans. 

    Find if an array has a majority element in O(n)

    • Iterate through the array and keep track of the count of each element

    • If the count of any element is greater than half the length of the array, return true

    • Otherwise, return false

  • Answered by AI
  • Q7. Given a 2 dim array, find an element which is the maximum in its column and minimum in its row. You are assured that atleast one such element exists. You may return any one if multiple such elements exist....
  • Ans. 

    Find element in 2D array which is max in column and min in row with minimum comparisons

    • Iterate over rows and columns to find max and min elements respectively

    • Compare the max element of a column with the min element of its row

    • Return the element if it satisfies the condition

    • Consider edge cases like multiple elements satisfying the condition

  • Answered by AI
  • Q8. Given an array of numbers, return the same array containing only unique elements in the array
  • Ans. 

    Return an array with only unique elements

    • Use a Set to store unique elements

    • Loop through the array and add each element to the Set

    • Convert the Set back to an array and return it

  • Answered by AI

Interview Preparation Tips

Round: Test
Experience: 1 written test + 3 rounds of technical interviews
For final offer: 3 rounds of technical interview

College Name: Veermata Jijabai Technological Institute, Mumbai [ VJTI ]

Skills evaluated in this interview

Top Microsoft Corporation Developer Interview Questions and Answers

Q1. Given a 2 dim array, find an element which is the maximum in its column and minimum in its row. You are assured that atleast one such element exists. You may return any one if multiple such elements exist. Write a code which makes minimum c... read more
View answer (1)

Developer Interview Questions asked at other Companies

Q1. Which programming language do you use regular in work
View answer (2)

Get interview-ready with Top Microsoft Corporation Interview Questions

Interview Questionnaire 

14 Questions

  • Q1. Merge two sorted linked list and write testcases
  • Ans. 

    Merging two sorted linked lists and writing test cases.

    • Create a new linked list to store the merged list

    • Compare the first nodes of both lists and add the smaller one to the new list

    • Repeat until one of the lists is empty, then add the remaining nodes to the new list

    • Write test cases to cover all possible scenarios, including empty lists and lists of different lengths

  • Answered by AI
  • Q2. WAP to check if the binary tree is height-balanced and write testcases
  • Ans. 

    WAP to check if binary tree is height-balanced and write testcases

    • A binary tree is height-balanced if the difference between the heights of its left and right subtrees is not more than 1

    • Use recursion to check if each subtree is height-balanced

    • Write testcases to cover all possible scenarios, including empty tree, single node tree, and unbalanced trees

  • Answered by AI
  • Q3. Then he asked me about my internship and to explain my projects
  • Q4. Find the intersection point of two linked list
  • Ans. 

    Find the intersection point of two linked lists.

    • Traverse both lists and find their lengths.

    • Move the head of the longer list to make both lists equal in length.

    • Traverse both lists in parallel until the intersection point is found.

  • Answered by AI
  • Q5. You are given file pointer and integer n, write c code for printing last “n” lines in that file
  • Ans. 

    C code to print last n lines of a file given file pointer and integer n.

    • Use fseek() to move the file pointer to the end of the file

    • Count the number of newline characters encountered from the end of the file until n lines are found

    • Use fgets() to read and print the last n lines

  • Answered by AI
  • Q6. What is deadlock?Conditions for that?What are the methods to prevent it?Write code to prevent the deadlock for OS, considering that there are two processes P0 and P1 in OS and they are requesting resource...
  • Ans. 

    Deadlock is a situation where two or more processes are unable to proceed due to a circular dependency on resources.

    • Deadlock occurs when two or more processes are waiting for resources held by each other.

    • Conditions for deadlock are mutual exclusion, hold and wait, no preemption, and circular wait.

    • Methods to prevent deadlock include resource allocation graph, banker's algorithm, and deadlock avoidance.

    • To prevent deadloc...

  • Answered by AI
  • Q7. How will you avoid race condition on shared memory?
  • Ans. 

    Use synchronization techniques like locks, semaphores, or mutexes to prevent multiple processes from accessing shared memory simultaneously.

    • Implementing a locking mechanism to ensure only one process can access the shared memory at a time.

    • Using semaphores to control access to the shared memory.

    • Using mutexes to ensure mutual exclusion and prevent race conditions.

    • Using atomic operations to ensure that memory operations a...

  • Answered by AI
  • Q8. Suppose there are two processes P0 and P1 and they want write to shared memory and while writing they should have exclusive lock on memory and P0 should be first to write the memory.Write C code using sema...
  • Q9. What is IPC? What are its types? compare them
  • Ans. 

    IPC stands for Inter-Process Communication. It is a mechanism that allows processes to communicate with each other.

    • Types of IPC include shared memory, message passing, and pipes.

    • Shared memory allows processes to share a portion of memory.

    • Message passing involves sending messages between processes.

    • Pipes are a unidirectional form of communication.

    • Shared memory is faster than message passing, but message passing is more r...

  • Answered by AI
  • Q10. If you have design offline browser and what will be challenges that you will face
  • Ans. 

    Designing an offline browser poses challenges such as data storage, synchronization, and user experience.

    • Ensuring efficient data storage and retrieval

    • Implementing synchronization with online content

    • Providing a seamless user experience with limited connectivity

    • Handling updates and changes to online content

    • Managing cache and memory usage

    • Dealing with security concerns

    • Handling different file types and formats

  • Answered by AI
  • Q11. Give the data structure to represent N-ary tree and write to code for its BFS
  • Ans. 

    Data structure and code for BFS of N-ary tree

    • N-ary tree can be represented using a node class with a list of child nodes

    • BFS can be implemented using a queue data structure

    • Iterate through the queue and add child nodes to the queue

    • Pop the node from the queue and process it

    • Repeat until the queue is empty

  • Answered by AI
  • Q12. You are given binary tree. Weight of node in binary tree=data present in it*level of that node(root’s level was given to be 1).Find the node in tree with maximum weight
  • Ans. 

    Find node with maximum weight in a binary tree based on data and level of node

    • Calculate weight of each node based on data and level

    • Traverse the binary tree and keep track of node with maximum weight

    • Return the node with maximum weight

  • Answered by AI
  • Q13. You are given infinite sequence of continuos natural numbers-1,2,3,4,5,6.......... Initially you delete every 2nd element so sequence will be 1,3,,5,7,9,11,13..... now in the resultant sequence you dele...
  • Ans. 

    Program to check if a given number is a lucky number or not.

    • Create a function that takes an integer n as input

    • Initialize a variable count to 2

    • Loop through the sequence and delete every count-th element

    • Repeat the above step until the end of the sequence

    • If n is present in the final sequence, return true, else return false

  • Answered by AI
  • Q14. Write the code to find inorder successor of given node in binary tree
  • Ans. 

    Code to find inorder successor of given node in binary tree

    • Check if the given node has a right subtree, if yes then find the leftmost node in the right subtree

    • If the given node does not have a right subtree, then traverse up the tree until we reach a node which is the left child of its parent

    • If we reach the root and the given node is the rightmost node, then there is no inorder successor

  • Answered by AI

Interview Preparation Tips

College Name: Veermata Jijabai Technological Institute, Mumbai [ VJTI ]

Skills evaluated in this interview

Top Microsoft Corporation Software Developer Interview Questions and Answers

Q1. Buses Origin Problem Statement You have been provided with an array where each element specifies the number of buses that can be boarded at each respective bus stop. Buses will only stop at locations that are multiples of the bus stop they ... read more
View answer (3)

Software Developer Interview Questions asked at other Companies

Q1. Maximum Subarray Sum Problem Statement Given an array of integers, determine the maximum possible sum of any contiguous subarray within the array. Example: Input: array = [34, -50, 42, 14, -5, 86] Output: 137 Explanation: The maximum sum is... read more
View answer (42)

Interview Questionnaire 

8 Questions

  • Q1. Given an integer array, find all (a,b,c) such that a^2 + b^2 = c^2 Solution is O(n^2) Write code and testcases
  • Ans. 

    Given an integer array, find all (a,b,c) such that a^2 + b^2 = c^2. Solution is O(n^2). Write code and testcases.

    • Use nested loops to iterate through all possible pairs of integers in the array

    • Check if the sum of squares of the two integers is a perfect square

    • If yes, add the triplet to the result list

    • Return the result list

  • Answered by AI
  • Q2. Find the height og a binary tree without recursion. Write code and testcases
  • Ans. 

    Find height of binary tree without recursion

    • Use a stack to keep track of nodes

    • Iteratively traverse the tree and update height

    • Testcases: empty tree, single node tree, balanced tree, unbalanced tree

  • Answered by AI
  • Q3. Given a bit pattern (in an integer INPUT), and another pattern (in an integer PATTERN, with a number n signifying the number of trailing bits to be considered as pattern - remaining bits are zero. Example:...
  • Ans. 

    Count the number of occurrences of a given bit pattern in an integer.

    • Extract the n trailing bits from the pattern and create a mask with all other bits set to zero.

    • Use a sliding window approach to compare the extracted pattern with all possible n-bit sequences in the input integer.

    • Increment a counter every time the extracted pattern matches with a sequence in the input integer.

  • Answered by AI
  • Q4. Given a pointer to the root of a binary tree, find whether the left and right subtrees are mirror images of each other
  • Ans. 

    Given a binary tree, check if left and right subtrees are mirror images of each other.

    • Traverse the tree and compare left and right subtrees recursively.

    • Use a stack or queue to traverse the tree iteratively.

    • Check if the left subtree is a mirror image of the right subtree by comparing their values and structures.

    • Consider an empty tree as a mirror image of itself.

  • Answered by AI
  • Q5. Given a string INPUT, find the longest repeating substring
  • Ans. 

    Find the longest repeating substring in a given string.

    • Create an array of all possible substrings of the given string.

    • Sort the array in lexicographic order.

    • Find the longest common prefix between adjacent strings.

    • Return the longest common prefix found.

    • If no repeating substring is found, return an empty string.

  • Answered by AI
  • Q6. 2 magnesium strips and a matchbox are given. Each burns in 60 minutes, with no relation between length burnt and time. Calculate 45 min
  • Q7. You have 3 baskets- one containing apples, one oranges and the last containing both. All baskets are incorrectly labelled.You can pick *one* fruit from *any one* basket and are supposed to correctly label ...
  • Ans. 

    Pick a fruit from the basket containing both fruits and label the baskets accordingly.

    • Pick a fruit from the basket labelled 'apples and oranges'

    • If you pick an apple, label the basket containing only apples

    • If you pick an orange, label the basket containing only oranges

    • Label the remaining basket as containing both fruits

  • Answered by AI
  • Q8. You're in the center of a circular pond, with an *intelligent* lion at the circumference - intelligent implies you can't trivially fool it. Given that, your swimming speed = x, lion's running speed on l...
  • Ans. 

    Escape from an intelligent lion at the circumference of a circular pond with given speeds.

    • Swim towards the circumference of the pond to make the lion run a longer distance.

    • Once the lion is at a considerable distance, get out of the pond and run in the opposite direction.

    • Use obstacles like trees or rocks to slow down the lion.

    • Try to confuse the lion by changing directions frequently.

  • Answered by AI

Interview Preparation Tips

Round: Technical Interview
Experience: Given a string INPUT, find the longest repeating substring.

Example: if INPUT = ababcbacabc, answer would be abc.

Write testcases.

The most important thing here is that you're supposed to ask questions to resolve ambiguities - the substrings cannot be overlappping.

Example: If INPUT = seattle, the expected answer is t, not e.

Example: If INPUT = ababa, answer = ab, not aba.

All such corner-cases must be considered.
Screening interview:

I had a single screening interview for conversion from Microsoft IDC to Redmond. It was more like a chat - in the initial 10-15 minutes atleast.

The first 10-15 minutes was about:

what i learnt at Microsoft
What was my project about
What did I learn from my project (my answer to this included both, learning in technical sense and personal development.
“Why test?” (IDC had selected me as an SDET, and that’s the profile they’d forwarded)

After that he asked what I liked to do (problem solving etc.) On saying “solving new and challenging problems”, he gave me the question:

Given 3 consecutinve numbers, and that the first and third are prime, is it always true that the middle number is divisible by 3 ? Prove your answer.
This question was majorly to check if I can think and zero in on the solution and the process.

Then, my second (and easy) question was to

Write a code for tokenizing a character stream. The stream starts and ends with a delimiter.
Example: Input: “
Here, the start of the string is denoted by ‘<’, and end by ‘>’.
The expected output is to return(or print) list of individual words. ie: “abc, def, msft, pr-st” (four words)

This is a ridiculously easy thing to code - but they weren’t interested in code. What he wanted to see was:
1. Approach
2. If the logic is sturdy enough and considers all test cases
2. Design choices and decision making (the whole Q revolved around this) - I made a list of test cases that the code should consider. In each case, there is a decision to be made - he wanted to see why I decided what I decided.
Example:
Input: “ a<efg>”
This obviously is something where a normal program would fail. My logic to this was: Discard everything before the first start delimiter, after the first end delimiter.
So my output: “abc, cd”

That was all.

Tips: Mine was a PrePlacement interview process - doesnt differ much from the normal campus, but competition is awesome.

College Name: Veermata Jijabai Technological Institute, Mumbai [ VJTI ]

Skills evaluated in this interview

Top Microsoft Corporation Software Developer Interview Questions and Answers

Q1. Buses Origin Problem Statement You have been provided with an array where each element specifies the number of buses that can be boarded at each respective bus stop. Buses will only stop at locations that are multiples of the bus stop they ... read more
View answer (3)

Software Developer Interview Questions asked at other Companies

Q1. Maximum Subarray Sum Problem Statement Given an array of integers, determine the maximum possible sum of any contiguous subarray within the array. Example: Input: array = [34, -50, 42, 14, -5, 86] Output: 137 Explanation: The maximum sum is... read more
View answer (42)

Interview Questions & Answers

user image Anonymous

posted on 21 May 2015

Interview Questionnaire 

4 Questions

  • Q1. What datastructure will you use for designing lift
  • Q2. Efficient data structure for minimsing the following operations if we have an array arr[0 . . . n-1]
  • Ans. 

    Use a min-heap data structure for efficient operations on an array.

    • Min-heap allows for constant time retrieval of the minimum element in the array.

    • Insertion and deletion of elements in a min-heap can be done in logarithmic time complexity.

    • Example: arr = [5, 2, 8, 1, 3], min-heap representation: [1, 2, 8, 5, 3]

  • Answered by AI
  • Q3. Add a value x to array from index l to r where 0 <= l <= r <= n-1
  • Q4. Find the value of a specified element of the array arr[i] where 0 <= i <= n-1

Interview Preparation Tips

Round: Test
Experience: There were 21 mcqs and 2 coding questions hosted on hackkerank.

Time: 1 hr 30 mns.

The mcqs were from c, c++, os, networks for example

1. LDAP stands for ?

2. 2^30+2^30+2^30+2^30 = ?

3. Given three process P, Q, R . P requests resources A, B, C, Q requests B, C, D and R requests C, D, A which of the following orders is deadlock free

4. Given a postfix expresion find the value of expresion

5. Which of the following is the inorder traversal for the given pre order traversal

6 Question based on the precedence order of operators
Duration: 90 minutes
Total Questions: 23

Round: TEST
Experience: 1) Given a graph. Find if a cycle exists and print the nodes in the cycle. If multiple cycles exists print the cycle starting from the lowest index2) Given a string S and a string T, count the number of distinct subsequences of T in S.

S = “rabbbit”, T = “rabbit”

Round: TECHNICAL INTERVIEW
Experience: 1) Find the diameter in given tree which can start at any node and can end

at any node and should have only single turn. 10

/

5 8

5-10-8 has two turns

10

/

45 56

/

10 20 45 10-45-10-56-45 has 1 turn

20-45-10-56 has 2 turns2) -----/

College Name: NA

Skills evaluated in this interview

Interview Questions & Answers

user image Anonymous

posted on 21 May 2015

Interview Preparation Tips

Round: Test
Experience: There were 3 questions. In all of them we were asked to write the code. As mentioned above
Duration: 30 minutes
Total Questions: 3

Round: Group Activity
Experience: After this round, 27 (From 112) were shortlisted. This second round was called “Group Activity”. The idea in this round was to solve problems in consultation with the Microsoft recruiters. Think of some idea and discuss it with the person allotted to u and then code the algorithm. This was the rule of the game. So people who preferred to solve the problems individually got thrown out in this round. In this round the following problems were thrown to us.

1. There are 3 (non-decreasing) sorted arrays, namely A, B and C. Define a triplet (a, b, c) such that a is in A, b is in B and c is in C. Also, define

dist (a, b, c) = max (|a-b|, |b-c|, |c-a|)

Now find the triplet (a_min, b_min, c_min) from A, B and C such that dist (a_min, b_min, c_min) is minimum among all possible triplets.

Hint: Brute force method: Compute all possible triplets and return the triplet with the min dist value. Smarter Approach: Use 3 pointers. Allot single pointer for single array. Initialize each one of them with the first positions of each of the array. Now compute the dist of the triplet formed by the values pointed by the pointers. Update the bestTriplet if the cost is less than bestTriplet. Next increment the pointer which points to the minimum value among the three. The philosophy is similar to the merge-sort. Only difference is that, actual merging is avoided since merged array does not guarantee three consecutive elements to be from three different arrays A, B and C. The proposed algorithm takes O(n(A)+n(B)+n(C)).2. There is a circular array which is a queue (FIFO). Several threads are trying to either insert or delete elements from the queue. Write code for insert, delete, IsFull, IsEmpty such that the functions are synchronized enabling parallel insertion and deletion.

Hint: It is simple. This problem requires smart use of semaphores

Round: Technical Interview
Experience: Round 3 (Tech Interview): Library HallIn this round I met a guy who was the most geeky kind of person. He didn’t even smile at PJs probably. His first question was to describe my project in summer training. The guy had no knowledge in VLSI and related stuffs. So I started the first class lecture of my CAD for VLSI course by Prof. PPC. I described him the basic steps of VLSI design starting from the High-level design to the fabrication. He had many doubts and it seemed that he was impressed with my explanations.

The next question was as follows:

Consider the skyline of a city shown in the picture below. You are given with the (xi, hi, wi) for n buildings. You have to give the silhouette of the city.I proposed one O(n2) algorithm by proposing a construction a graph where each building represents a vertex and there is an edge between two vertices if they are overlapping. For example ith and jth building has an edge between them then either,

xi <= xj <= xi + wi or xj <= xi <= xj + wj

However, he suggested me to optimize the data-structures. Then finally stored the data in a heap and seemed that he was happy. Lastly he said, “I was not interested in the answer actually. It was nice talking to you.”

Round: Technical Interview
Experience: Round 4 (Tech Interview):

In this round, I met a bashful person who asked me the following.

1. Code the move of a game which was pretty simple in nature. I am not describing it here. But the tips (courtesy: Chandu and Dhawan who generously contributed towards the Q&A library building during the placement of 2004 batch) that I applied here was, a) code to the detail, b) check the boundary condition c) explain each line to the recruiter, d) ask the recruiter whenever u have any doubt or before making any assumptions and e) definitely think aloud.

2. There is an array where except one number (say magic-number) all are unique. The magic-number repeats itself more than half times the size of the array. e.g. 2, 10, 10, 10, 3. Find the magic-number without using any extra-space and without sorting it.

Hint: Use the given property, “magic-number repeats itself more than half times the size of the array”. This ensures (from Pigeon Hole Principle), that there exists at least one triplet (triplet here stands for 3 consecutive elements in the array) which has the magic-number more than once. So scan the array once and search for the magic-number.3. Gave a simple ‘strcat’ code and asked for the errors in it. The errors were the following:

a) there was no ‘’ in the end.

b) returning a pointer to a character array which is locally declared in the function.

He asked me to correct the code. Simple task.

4. Asked the difference between C++ and Java.

Round: HR Interview
Experience: Round 5 (Tech-HR interview):In this round the head (Shankar Shastry, the man who came in the PPT) of the recruiting team called me. He was a nice guy. He asked me about the project in my summer training. Again I lectured him about LISA, ADL, RTL, VLSI design, automatic test pattern generator etc. Then he asked me how do the methods on semaphores are implemented. I didn’t remember anything of that part in OS. I gave a long funda on hardware bit setting, interrupt handling, atomic execution, preemption of the processes etc. I knew that I was not very sure of what I was talking to him, still I continued. Then he asked me about the favorite subject of mine. Also, he asked me to name a product which fascinates me and why? Moreover, what kind of product would I like to work upon. Last question made me apparent of the selection. He asked “Is

there any question for me?”

So this was my experience in Microsoft interview. I liked the problems they asked me. The suggestions for an aspirant would be following.

1. Come prepared with fundamental data-structures and algorithms.

2. Industry people find the “code” nearer to their heart but feel uncomfortable with “graphs”. They are real expert in the code, but theoretical abstractions are grey areas for them. This is my own realization and I may be absolutely wrong.

3. Interact, interact and interact with the recruiters during the interview. Think aloud. It helps. They are not interested in getting a correct solution but they are more interested in the effort u r putting in and moreover the line of thought that you are having. Above all, remain confident even if u do not know anything about the answer.

4. The interview might span over 7-8 hours at a stretch. So keep biscuits with you since in empty stomach u cannot think smart.
Tips: Tips :Interviews can be a jittery experience. And even if we are seasoned and confident, there are bound to be some butterflies in our stomachs right before the first interview. Once the process starts however, its usually calm, and the ball keeps rolling.Someone with a good grasp of the fundamentals of data structures and algorithms specially trees, linked lists and elementary graph algorithms has a good chance when it comes to clearing a MS interview. Also a lot of questions were typical interview problems that can be found in most books and also around on the internet. If you want a job at Microsoft then prepare well for your interview. Let me know in comments if you found this post useful.

College Name: BIT MESRA
Motivation: Microsoft was the first company I was shortlisted and reached the interview round clearing the first level test. I could remember all this as i jotted them down in from of a note back then when FB was just an infant The experience was rewarding in many sense. This is my first interview experience and I am thankful to all my batch-mates and seniors whose valuable suggestions helped me in emerging successful in this interview. Here I present my experience.[P.S I won't mention about PPt that took place in CAT hall casue you all know what Microsoft is ]''

Interview Questions & Answers

user image Anonymous

posted on 21 May 2015

Interview Questionnaire 

6 Questions

  • Q1. Interviewer had a look at my CV for about 10 minutes and asked lot of questions of my work in current job
  • Q2. Then a coding question that “Given a cartesian x-y plane and lot of points in that plane with x and y coordinates and 1 more point(say x,y) is given, so we have to find all the points in that plane which a...
  • Q3. Questions on Java :- Why synchronised block needed? and some more questions on Multithreading in Java
  • Q4. Some DB queries to write for the tables provided by interviewer
  • Q5. Implement Inorder Traversal with and without using recursion
  • Ans. 

    Inorder traversal can be implemented using recursion or stack data structure.

    • For recursive implementation, traverse left subtree, visit root node, traverse right subtree

    • For iterative implementation, use stack to traverse left subtree, visit node, then traverse right subtree

    • Inorder traversal is used to print nodes in ascending order in a binary search tree

  • Answered by AI
  • Q6. How does Stack work internally and what data it holds?
  • Ans. 

    Stack is a data structure that follows LIFO (Last In First Out) principle.

    • Stack holds a collection of elements.

    • It has two main operations: push (adds element to top) and pop (removes element from top).

    • It also has peek operation (returns top element without removing it).

    • Stack can be implemented using arrays or linked lists.

    • Examples of stack usage: undo/redo functionality, back/forward buttons in web browsers.

  • Answered by AI

Interview Preparation Tips

Round: Test
Experience: We all were required to write a code for LRU implementation with proper Locks and synchronization so as it is thread safe.

College Name: NA

Skills evaluated in this interview

Microsoft Corporation Interview FAQs

How many rounds are there in Microsoft Corporation interview?
Microsoft Corporation interview process usually has 2-3 rounds. The most common rounds in the Microsoft Corporation interview process are Technical, Coding Test and One-on-one Round.
How to prepare for Microsoft Corporation interview?
Go through your CV in detail and study all the technologies mentioned in your CV. Prepare at least two technologies or languages in depth if you are appearing for a technical interview at Microsoft Corporation. The most common topics and skills that interviewers at Microsoft Corporation expect are microsoft, Computer science, C++, Coding and Python.
What are the top questions asked in Microsoft Corporation interview?

Some of the top questions asked at the Microsoft Corporation interview -

  1. You are given infinite sequence of continuos natural numbers-1,2,3,4,5,6.........read more
  2. You have a cuboid (m*n*p) each block of the cuboid is having a metallic ball. ...read more
  3. Given a string of containing lower case letters and upper case characters. Find...read more
How long is the Microsoft Corporation interview process?

The duration of Microsoft Corporation interview process can vary, but typically it takes about less than 2 weeks to complete.

Tell us how to improve this page.

Microsoft Corporation Interview Process

based on 375 interviews

Interview experience

4.2
  
Good
View more

Interview Questions from Similar Companies

Accenture Interview Questions
3.8
 • 8.1k Interviews
IBM Interview Questions
4.0
 • 2.3k Interviews
Oracle Interview Questions
3.7
 • 846 Interviews
Google Interview Questions
4.4
 • 823 Interviews
Amdocs Interview Questions
3.7
 • 514 Interviews
Dell Interview Questions
4.0
 • 386 Interviews
Cisco Interview Questions
4.1
 • 370 Interviews
SAP Interview Questions
4.2
 • 283 Interviews
Adobe Interview Questions
3.9
 • 233 Interviews
Intel Interview Questions
4.2
 • 214 Interviews
View all

Microsoft Corporation Reviews and Ratings

based on 1.7k reviews

4.0/5

Rating in categories

3.9

Skill development

4.0

Work-life balance

3.9

Salary

3.5

Job security

4.0

Company culture

3.4

Promotions

3.7

Work satisfaction

Explore 1.7k Reviews and Ratings
Software Engineer
1.6k salaries
unlock blur

₹16 L/yr - ₹50 L/yr

Senior Software Engineer
1.1k salaries
unlock blur

₹25 L/yr - ₹96 L/yr

Software Engineer2
1k salaries
unlock blur

₹20 L/yr - ₹72 L/yr

Software Developer
762 salaries
unlock blur

₹14 L/yr - ₹50.4 L/yr

Consultant
600 salaries
unlock blur

₹13 L/yr - ₹36.7 L/yr

Explore more salaries
Compare Microsoft Corporation with

Google

4.4
Compare

Amazon

4.1
Compare

Deloitte

3.8
Compare

TCS

3.7
Compare
Did you find this page helpful?
Yes No
write
Share an Interview