Microsoft Corporation
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Clear (1)
I was interviewed before May 2021.
Round duration - 60 Minutes
Round difficulty - Easy
Given a binary tree with 'N' nodes, your task is to print the nodes in spiral order traversal.
The binary tree is represented i...
Print nodes of a binary tree in spiral order traversal.
Use a queue to perform level order traversal of the binary tree.
Alternate between printing nodes from left to right and right to left at each level.
Handle null nodes represented by '-1' appropriately.
Example: For input '1 2 3 -1 -1 4 5 -1 -1 -1 -1', the output should be '1 3 2 4 5'.
Round duration - 60 Minutes
Round difficulty - Easy
You are given a list of N
strings called A
. Your task is to determine whether you can form a given target string by combining one or more strings from A
.
The strings from A
c...
Given a list of strings, determine if a target string can be formed by combining one or more strings from the list.
Iterate through all possible combinations of strings from the list to form the target string.
Use recursion to try different combinations of strings.
Check if the current combination forms the target string.
Return true if a valid combination is found, otherwise return false.
Round duration - 60 Minutes
Round difficulty - Easy
Design an elevator system for efficient vertical transportation.
Divide building into zones to optimize elevator usage.
Implement algorithms for efficient elevator scheduling.
Include safety features like emergency stop buttons and overload sensors.
Consider user interface for passengers to select floors and monitor elevator status.
Tip 1 : Never give up
Tip 2 : Practice
Tip 3 : Be positive
Tip 1 : Keep it short
Tip 2 : Highlight skills and achievements
I was interviewed before Sep 2020.
Round duration - 90 minutes
Round difficulty - Easy
Pretty easy questions.
You are provided with an array of integers ARR
of size N
and an integer K
. Your task is to find and return the K
-th smallest value present in the array. All elements...
Find the K-th smallest element in an array of distinct integers.
Sort the array and return the element at index K-1.
Use a min-heap to find the K-th smallest element efficiently.
Implement quickselect algorithm for optimal performance.
Round duration - 20 Minutes
Round difficulty - Easy
1 coding question
Given a string S
consisting only of digits from 0 to 9, your task is to find all potential IP addresses that can be formed from S
and list them in lexicographical order. I...
Given a string of digits, find all potential valid IP addresses that can be formed from it.
Split the string into four parts and check if each part is a valid IP segment (0-255).
Use backtracking to generate all possible combinations of valid IP addresses.
Ensure that the IP address does not contain leading zeroes.
Return the valid IP addresses in lexicographical order.
Round duration - 45 Minutes
Round difficulty - Easy
Total Discussion on OS concepts
Memory management in operating systems involves allocation, deallocation, and optimization of memory usage.
Memory allocation: OS allocates memory to processes based on their requirements.
Memory deallocation: OS frees up memory when it is no longer needed by a process.
Memory optimization: OS optimizes memory usage through techniques like paging, segmentation, and virtual memory.
Examples: Paging in which memory is divide...
Round duration - 45 Minutes
Round difficulty - Easy
Easy in office environment
Your task is to identify the position of the only '1' bit in the binary representation of a given non-negative integer N
. The representation contains exactly one '1' and the rest are...
Find the position of the lone '1' bit in the binary representation of a given non-negative integer.
Iterate through the bits of the integer to find the position of the lone '1'.
Use bitwise operations to check if there is exactly one '1' bit in the binary representation.
Return the position of the lone '1' or -1 if there isn't exactly one '1'.
Tip 1 : Do a good project.
Tip 2 : Master the topics you are preparing.
Tip 1 : Avoid writing things you do not know
Tip 2 : Follow a proper format for Resume.
I was interviewed before Sep 2020.
Round duration - 45 minutes
Round difficulty - Medium
It was an online round hosted on cocubes. It consisted of 3 coding questions only and the duration of the test was 45 mins.
The test link with a unique id and password was sent to the email 1 day prior to the test day. It consisted to platform specification, sample test etc.
On the day of test, we were given a time slot of 5pm - 11pm. We could attempt the test as per our comfort.
The instructions were pretty straightforward and we could attempt it from anywhere.
There were only 2 requirements. A webcam must be available. And a decent internet.
About the Platform.
In all of the problems base classes and code were disabled, we needed to implement only certain classes/ functions. Clipboard copy was blocked, tab switching was not allowed and rest the platform is very basic and simple.
Given two singly linked lists, each representing a positive number without leading zeros, your task is to add these two numbers. The result should be returned a...
Add two numbers represented by linked lists and return the sum as a linked list.
Traverse both linked lists simultaneously while keeping track of carry.
Create a new linked list to store the sum.
Handle cases where one linked list is longer than the other.
Update the next pointer of the current node to point to the new node with the sum.
Handle the carry if it exists after reaching the end of both linked lists.
Given an array 'ARR' of integers with length 'N', the task is to determine the sum of the subarray (including an empty subarray) that yields the maximum sum among al...
Find the maximum sum of a subarray in an array of integers.
Iterate through the array and keep track of the maximum sum subarray ending at each index.
Use Kadane's algorithm to efficiently find the maximum subarray sum.
Consider the case where all elements are negative, in which case the maximum sum would be the largest negative number.
Given a binary tree of integers, your task is to calculate the sum of all the leaf nodes which are present at the deepest level of the binary tree. If ...
Calculate the sum of leaf nodes at the deepest level of a binary tree.
Traverse the binary tree to find the deepest level.
Keep track of leaf nodes at the deepest level and calculate their sum.
Handle null nodes represented by -1.
Ensure the sum fits in a 32-bit integer.
Round duration - 60 minutes
Round difficulty - Hard
This round is known as the group fly round. After clearing the first round, we were called at the Microsoft Gurgaon office for the face to face interviews. Approximately, 60 students were there on the day I was called. I guess there were multiple days for multiple slots.
We all were divided into groups of 6-8 people and were called inside a round table room with 1 interviewer. This round consisted of 1 problem only to be discussed over with the interviewer. And the solutions to be written on pen paper.
The key here is to walk through the thought process and the steps with the interviewer. He will go around the table and will have discussion with each one of us and discuss about the pros, cons of the solutions.
It is advisable to ask as many questions as possible, to gather requirements and to be sure what are the expectations.
Round duration - 60 minutes
Round difficulty - Medium
This was the first face to face round.
It was held just after the group fly. From my group fly slot, 2/7 were selected.
The interviewer made me comfortable, we started informal talks about college and hobbies.
It kicked off with some basic discussion of the previous round problems, he had some questions about the encryption and security related stuff from payment scenario.
Then there were some behavioral questions and lastly there were a couple of whitepaper coding questions.
Given an integer N
, your task is to position N
queens on an N x N
chessboard in such a way that no two queens threaten each other.
A queen can attack other queens that are in t...
Position N queens on an N x N chessboard so that no two queens threaten each other.
Use backtracking to explore all possible configurations.
Keep track of rows, columns, and diagonals to ensure no two queens threaten each other.
Display all valid configurations found.
Given a binary tree, your task is to print the left view of the tree.
The input will be in level order form, with node values separated by a...
Print the left view of a binary tree given in level order form.
Traverse the tree level by level and print the first node of each level (leftmost node).
Use a queue to keep track of nodes at each level.
Time complexity should be O(n) where n is the number of nodes in the tree.
Round duration - 45 minutes
Round difficulty - Easy
This was the second face to face. Almost 50% students were selected from the first face to face round.
This was very straightforward round, a hectic day and it was already late by now.
The interviewer started with formal introduction and gave me 2 very basic problems to code.
This code consists of writing the entire code from scratch on whitepaper, with unit tests that can cover almost all scenarios. Some sample test cases were given by the interviewer at the end, to validate and dry run my solution.
Determine if a given Singly Linked List of integers forms a cycle or not.
A cycle occurs when a node's next
points back to a previous node in the list. This...
Detect if a singly linked list forms a cycle by checking if a node's next pointer points back to a previous node.
Traverse the linked list using two pointers, one moving one step at a time and the other moving two steps at a time.
If the two pointers meet at any point, there is a cycle in the linked list.
If one of the pointers reaches the end of the list (null), there is no cycle.
You are provided with a non-empty binary tree where each node has a non-negative integer value. Compute and return the maximum possib...
Find the maximum path sum between two leaves in a binary tree.
Traverse the binary tree to find the maximum path sum between two leaves.
Keep track of the maximum sum encountered during traversal.
Consider all possible paths that include leaf nodes.
Handle cases where there is only one leaf node or no leaf nodes.
Implement a recursive function to calculate the maximum path sum.
Round duration - 30 minutes
Round difficulty - Easy
This was the final round.
It was very late in the evening, around 10pm.
The interviewer here was one of the senior manager in the org (M2).
This kicked off with very informal conversations and introductions.
The interviewer was very engaging.
Tip 1 : Be solid with the basics of Ds, Algo. Good to have end to end projects which are hosted on cloud.
Tip 2 : Its always good to be presentable and have good communications skills
Tip 3 : Be honest, clear in approach and always walkthrough your thought process to the interviewer
Tip 1 : Mention your projects and experience at the top. Be clear on what was done, a brief on how it was done, language /tech stack involved. If possible try to host and make it accessible. You never know if you can present it with just one click.
Tip 2 : Choose a balance between, white spaces and text, it should be well indented, no grammatical errors.
Tip 3 : It takes less than 2 min to scan a resume. Don't mention things which are irrelevant.
What people are saying about Microsoft Corporation
I was interviewed before Sep 2020.
Round duration - 90 minutes
Round difficulty - Hard
Online coding contest, focus on DP and trees
In Ninjaland, a chess tournament is being organized with C
chess players attending. They will all stay in a hotel that has N
available rooms. Each player will choose one...
Assign rooms to chess players to maximize overall focus level by minimizing distance between rooms.
Sort the positions of rooms in ascending order.
Calculate the distances between adjacent rooms.
Select rooms with minimum distances to maximize overall focus level.
Round duration - 45 minutes
Round difficulty - Hard
It was conducted on the GHCI conference itself. It was held in a Microsoft interview room at the career fair of the conference. This was primarily based on my coding abilities and understanding how to optimise a solution
Given a string S
and a list wordList
containing N
distinct words, determine if each word in wordList
is present in S
. Return a boolean array where the value at index 'i' indi...
Given a string and a list of words, check if each word in the list is present in the string and return a boolean array.
Iterate through each word in the wordList and check if it is present in the string S.
Use a boolean array to store the presence of each word in the string.
Remember that the presence of a word is case sensitive.
Do not use built-in string-matching methods.
Return the boolean array without printing it.
Round duration - 30 minutes
Round difficulty - Medium
This was a system design round.
Round duration - 20 minutes
Round difficulty - Easy
This was the HR round and only typical HR questions were asked.
Tip 1 : Practice implementation of code end to end
Tip 2 : CV should have many projects and published paper to be shortlisted
Tip 3 : Focus on optimization
Tip 1 : Include projects in your resume.
Tip 2 : Keep resume of one page, but utilize the entire page efficiently
Microsoft Corporation interview questions for designations
The code inserts a given string at the specified position in a compact data structure that stores strings sequentially.
To insert the string at the ith place, we need to shift all the strings after the ith position by the length of the new string.
We can use a loop to iterate through the data structure and find the ith position.
After finding the ith position, we can calculate the new length of the data structure and allo...
Constructing parse tree for ((a+b)*c)/d using data structures.
Use stack data structure to keep track of operators and operands.
Start with the innermost parentheses and work outwards.
Create a node for each operator and operand and link them together.
The root node will be the final result of the expression.
Example: ((a+b)*c)/d can be represented as / -> * -> + -> a, b, c, d.
Merge 'n' identical linked lists from 'n' salespersons to handle insertions, deletions, and updates.
Iterate through each linked list and merge them into a single linked list
Handle insertions, deletions, and updates by traversing the merged list and making necessary changes
Repeat the process for the next day by resetting the merged list
Get interview-ready with Top Microsoft Corporation Interview Questions
Some of the top questions asked at the Microsoft Corporation Software Developer interview -
The duration of Microsoft Corporation Software Developer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 29 interviews
4 Interview rounds
based on 78 reviews
Rating in categories
Software Engineer
2k
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Engineer
1.1k
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer2
1k
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Developer
698
salaries
| ₹0 L/yr - ₹0 L/yr |
Consultant
602
salaries
| ₹0 L/yr - ₹0 L/yr |
Amazon
Deloitte
TCS