Microsoft Corporation
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
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 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 - 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...
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...
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
What people are saying about Microsoft Corporation
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.
Microsoft Corporation interview questions for designations
I applied via campus placement at Indian Institute of Technology (IIT), Chennai and was interviewed in Dec 2016. There were 6 interview rounds.
Get interview-ready with Top Microsoft Corporation Interview Questions
I applied via campus placement at Indian Institute of Technology (IIT), Chennai
I applied via Referral
Find A-B of two sorted arrays A and B in O(m+n) time complexity.
Create two pointers, one for each array, and compare the elements at those pointers.
If the element in A is smaller, add it to the result array and move the A pointer forward.
If the element in B is smaller, move the B pointer forward.
Repeat until one of the pointers reaches the end of its array.
Add any remaining elements in A to the result array.
Time comple...
The routine should output the elements of the inorder traversal of a binary tree one by one in each call.
Implement an inorder traversal algorithm recursively
Use a global variable or pass a reference to keep track of the current element
Call the routine repeatedly to get the next element in each call
Program to find minimum semesters required to complete courses with prerequisites
Create a graph with courses as nodes and prerequisites as edges
Use topological sorting to find the order of courses to be taken
Calculate the minimum number of semesters based on the order obtained
Handle cases where there are cycles in the graph
I applied via campus placement at Indian Institute of Technology (IIT), Chennai
I applied via campus placement at Indian Institute of Technology (IIT), Chennai
Determining the result of string reversal and rotation operations using a reverse function.
The first operation reverses the first half and second operation reverses the second half of the string, resulting in a rotation of the string left k positions.
The third operation reverses the entire string, resulting in a reversal of the string.
Therefore, the correct answer is (b) Rotates the String left k positions.
Example: s =...
Relation between num and len in a given code snippet
The code recursively calls the function abc() twice for each character in the string
The printf() statement prints each character once
The number of '>' characters printed on the screen is equal to num
The length of the string is equal to len
The relation between num and len is num = 2^len - 1
Identifying which numbers cannot be accurately represented in binary.
Binary cannot accurately represent decimal fractions that do not have a power of 2 as their denominator.
Option a (0.1) and option e (0.590625) cannot be accurately represented in binary.
Option b (6.5) and option d (1.32) can be accurately represented in binary.
Option c (1/16) can be accurately represented in binary as 0.0001.
Additional processors required to execute a process in 150s with 40% sequential execution.
Process takes 300s on a single processor
40% of the process is sequential and doesn't require additional processors
Calculate the time taken by the remaining 60% of the process
Determine the speedup required to execute the remaining 60% in 150s
Calculate the number of additional processors required based on the speedup
Determining worst case time complexity of a code snippet with given time complexity of a function and array
The time complexity of the given code snippet is O(n)
The function f(m) is called only when a 0 is encountered in the array
The worst case time complexity is O(n)
The code snippet iterates through the entire array once
Increasing RAM improves CPU efficiency due to virtual memory and reduced page faults.
Increasing RAM allows for more data to be stored in memory, reducing the need for frequent access to slower storage devices.
Virtual memory allows the operating system to use hard disk space as if it were RAM, increasing the effective amount of memory available to the CPU.
Reducing page faults, which occur when the CPU needs to access da...
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
1.9k
salaries
| ₹13 L/yr - ₹50 L/yr |
Senior Software Engineer
1.1k
salaries
| ₹25 L/yr - ₹85 L/yr |
Software Engineer2
1k
salaries
| ₹20 L/yr - ₹72 L/yr |
Consultant
599
salaries
| ₹13 L/yr - ₹36.7 L/yr |
Support Engineer
578
salaries
| ₹7.7 L/yr - ₹30 L/yr |
Amazon
Deloitte
TCS