Microsoft Corporation
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
I applied via Campus Placement and was interviewed in Mar 2022. There were 2 interview rounds.
I'm sorry, could you please clarify what type of program you are referring to?
Ask for more information about the program in question
Provide examples of different types of programs
Clarify the context of the question
I applied via Campus Placement and was interviewed in Dec 2021. There were 6 interview rounds.
Work from home & work from office
I was interviewed in Jul 2021.
Round duration - 120 minutes
Round difficulty - Easy
Given an integer N
, find all possible placements of N
queens on an N x N
chessboard such that no two queens threaten each other.
A queen can attack another queen if they ar...
The N Queens Problem involves finding all possible placements of N queens on an N x N chessboard without threatening each other.
Use backtracking algorithm to explore all possible configurations.
Keep track of rows, columns, and diagonals to ensure queens do not threaten each other.
Generate all valid configurations and print them as output.
You are given the arrival and departure times of N trains at a railway station for a particular day. Your task is to determine the minimum number of pl...
Determine the minimum number of platforms needed at a railway station based on arrival and departure times of trains.
Sort the arrival and departure times in ascending order.
Use two pointers to keep track of overlapping schedules.
Increment the platform count when a new train arrives before the previous one departs.
Return the maximum platform count needed.
You are given a long type array/list ARR
of size N
, representing an elevation map. The value ARR[i]
denotes the elevation of the ith
bar. Your task is to determine th...
Calculate the total amount of rainwater that can be trapped between given elevations in an array.
Iterate through the array and calculate the maximum height on the left and right of each bar.
Calculate the amount of water that can be trapped at each bar by taking the minimum of the maximum heights on the left and right.
Sum up the trapped water at each bar to get the total trapped water for the entire array.
Example: For i...
Tip 1 : Never never try to cheat in online interview the interviewer will definitely get to know.
Tip 2 : Psuedo code presentation matters a lot so name Your variable properly and with proper indentation.
Tip 3 : Keep on trying even if You feel that's not the right answer so at least put that idea forward.
Tip 4 : Do Leetcode medium questions as much as possible As they are mostly asked in Interviews.
Tip 1 : Avoid unnecessary details on Resume
Tip 2 : Make It look clean and also keep it of one page
What people are saying about Microsoft Corporation
I applied via Naukri.com and was interviewed in Jun 2022. There were 2 interview rounds.
Ds questions asked in the round
Microsoft Corporation interview questions for designations
I was interviewed in Apr 2021.
Round duration - 90 minutes
Round difficulty - Hard
Given an array of stock prices where each element represents the stock price for a given day, determine the maximum profit you can achieve from buying and sellin...
Determine maximum profit from buying and selling stocks on different days.
Iterate through the array of stock prices and calculate the profit for each pair of days.
Keep track of the maximum profit obtained by selling and buying stocks on different days.
Return the maximum profit achieved.
Round duration - 40 Minutes
Round difficulty - Medium
You are given a binary tree consisting of 'N' unique nodes and a start node where the burning will commence. The task is to calculate the time in minutes required to completely b...
Calculate the time in minutes required to completely burn a binary tree starting from a given node.
Perform a depth-first search (DFS) to calculate the time taken to burn the entire tree.
Track the time taken for each node to catch fire and burn the tree accordingly.
Consider the adjacency of nodes to determine the spread of fire.
Handle cases where the start node is at different levels in the tree.
Optimize the solution to
Round duration - 40 minutes
Round difficulty - Easy
Given a binary tree consisting of integer values, your task is to convert the binary tree into a linked list where the nodes of the linked list follow the same order ...
Convert a binary tree into a linked list following pre-order traversal order.
Perform pre-order traversal of the binary tree and convert it into a linked list.
Use the right pointer of the binary tree as the 'next' pointer for the linked list.
Set the left pointer to NULL for each node in the linked list.
Example: Input - 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1, Output - 1 2 4 7 3 5 6
Round duration - 25 Minutes
Round difficulty - Hard
Demonstrate communication between two processes using inter-process communication (IPC) methods.
Use sockets for communication between two processes running on the same or different machines.
Implement message passing using shared memory or message queues.
Utilize pipes for communication between parent and child processes.
You are given a number grayNumber
. Your task is to find and return the Gray code sequence.
The Gray code sequence should satisfy the following conditions:
1. Inc...
Find and return the Gray code sequence for a given number.
Generate Gray code sequence by following the conditions provided in the problem statement.
Ensure that consecutive numbers in the sequence differ by exactly 1 bit.
Start the sequence with 0 and include numbers up to 2^grayNumber - 1.
Return the sequence in decimal form as a list/vector.
If multiple valid sequences exist, return any of them.
Tip 1 : Never leave any topic from any chapter / Subject
Tip 2 : Learn to explain your thoughts well
Tip 3 : Learn from previous experiences / interviews / problems asked.
Tip 4 : Atleast 4 projects in Resume
Tip 1 : Atleast 4 projects on Resume
Tip 2 : Do not write false things. You always get caught. Be genuine.
Get interview-ready with Top Microsoft Corporation Interview Questions
I applied via Job Portal and was interviewed before Oct 2022. There were 3 interview rounds.
Coding test had 3 questions
I was interviewed in Jan 2021.
Round duration - 90 minutes
Round difficulty - Medium
it was around 9 :30 am interviewer was friendly
Given an array Arr
consisting of N
integers, find all distinct triplets in the array that sum up to zero.
An array is said to have a triplet {Arr[i], Arr[j],...
Find all distinct triplets in an array that sum up to zero.
Use a nested loop to iterate through all possible combinations of triplets.
Sort the array to easily identify duplicates and skip unnecessary calculations.
Use two-pointer technique to find the remaining element for each pair of elements.
Round duration - 60 Minutes
Round difficulty - Medium
morning 11 am
interviewer was friendly
Given a string STR
containing '0', '1', and '?' special characters, generate all possible strings by replacing each '?' with either '0' or '1'.
The first line...
Generate all possible binary strings by replacing '?' with '0' or '1'.
Iterate through the input string and replace '?' with '0' and '1' recursively to generate all possible strings.
Use backtracking to explore all possible combinations.
Sort the generated strings lexicographically before returning the final result.
You are given an arbitrary binary tree consisting of N nodes, each associated with an integer value from 1 to 9. Each root-to-leaf path can be considered a number formed by concat...
Calculate the total sum of all root to leaf paths in an arbitrary binary tree.
Traverse the tree in a depth-first manner to calculate the sum of each root to leaf path.
Keep track of the current path sum and update it as you traverse the tree.
Return the total sum modulo (10^9 + 7) as the final result.
Round duration - 45 Minutes
Round difficulty - Hard
it was around 3
good recieving of interviewer
Imagine there are 'N' people at a party, each assigned a unique ID from 0 to N-1. A celebrity at the party is a person who is known by everyone but knows no one else.
Identify the celebrity at a party where one person knows everyone but is not known by anyone.
Use a two-pointer approach to eliminate non-celebrity candidates.
Start with two pointers at the beginning and end of the party.
If A knows B, A cannot be the celebrity; move A to the right.
If A does not know B, B cannot be the celebrity; move B to the left.
Repeat until only one person remains, check if this person is known by ev...
Round duration - 50 Minutes
Round difficulty - Easy
it was arround 2 afternoon
Tip 1 : Prepare for common interview questions
Tip 2 : Practice, practice, practice.
It's one thing to come prepared with a mental answer to a question like, "Why should we hire you?" It's another challenge entirely to say it out loud in a confident and convincing way. The first time you try it, you'll sound garbled and confused, no matter how clear your thoughts are in your own mind! Do it another 10 times, and you'll sound a lot smoother and more articulate.
But you shouldn't do your practicing when you're "on stage" with a recruiter; rehearse before you go to the interview. The best way to rehearse? Get two friends and practice interviewing each other in a "round robin": one person acts as the observer and the "interviewee" gets feedback from both the observer and the "interviewer." Go for four or five rounds, switching roles as you go. Another idea (but definitely second-best) is to tape record your answer and then play it back to see where you need to improve. Whatever you do, make sure your practice consists of speaking aloud. Rehearsing your answer in your mind won't cut it.
Tip 1 : Should have different projects
Tip 2 : Internships in good companies
I was interviewed in May 2021.
Round duration - 60 Minutes
Round difficulty - Medium
2 coding questions were asked
Given a matrix of size N * M, your task is to count the number of squares present within it.
Since the count can be extremely large, the result should be computed modulo 109 + 7...
Count the number of squares in a given matrix modulo 10^9 + 7.
Iterate through all possible square sizes from 1 to min(N, M)
For each square size, count the number of squares that can fit in the matrix
Return the total count modulo 10^9 + 7
You are provided with an integer array ARR
of length 'N'. Your objective is to determine the first missing positive integer using linear time and constant space. T...
Find the smallest positive integer missing from an array of integers.
Iterate through the array and mark positive integers as visited by changing the sign of the corresponding index.
After marking all positive integers, iterate again to find the first positive integer with a positive value.
Return the index of the first positive integer found plus one as the answer.
Round duration - 100 Minutes
Round difficulty - Medium
There was 1 coding question, and questions on CN, DBMS, OS and system design and also my resume.
You are given a non-negative integer represented as a string num
and an integer k
. Your task is to determine the smallest possible integer by removing exactly k
digits fr...
Given a non-negative integer as a string and an integer k, find the smallest possible integer after removing k digits.
Use a stack to keep track of the digits in non-decreasing order from left to right.
Pop elements from the stack if the current digit is smaller than the top of the stack and k is greater than 0.
Handle edge cases like leading zeros and ensuring the final result is not an empty string.
Example: For num = "1...
Round duration - 40 Minutes
Round difficulty - Medium
Interviewer was quite experienced he asked me 1 coding question and asked questions about college and resume
You are provided with a string 'S'. The task is to determine the length of the longest duplicate substring within this string. Note that duplicate substrings ...
Find the length of the longest duplicate substring in a given string.
Use binary search to find the length of the longest duplicate substring.
Implement Rabin-Karp algorithm for efficient substring search.
Consider using a rolling hash function for substring comparisons.
Tip 1 : Try to cover all most common questions of all topics(atleast 300+ questions)
Tip 2 : Try to see as many interview experience as possible of the company you are applying.
Tip 3 : Try to give atleast 2-3 mock interview before main interview
Tip 1 : Try to put competitive programming ranks if possible or Coding Ninjas Certificate, or any proof that you do programming regularly.
Tip 2 : Try to add atleast 2 projects, and study about those projects well.
I was interviewed in Nov 2020.
Round duration - 100 minutes
Round difficulty - Easy
3 coding Questions:
1st : Easy question based on simple loop iteration
2nd : Medium level Data structure question
3rd : Medium level tree question(where we were not just required to complete the tree function but to build whole best from
scratch)
It was conducted from 1:30 - 3:00 pm.
The coding platform was very good (as auto indentation and auto completion of brackets were there) having camera on.
Ninja is eager to listen to stories from the renowned Storyteller of Ninjaland. The storyteller charges 'Y' coins per story. However, for every set of 'X' stories told, N...
Calculate the total number of stories a ninja can hear from a storyteller based on given conditions and constraints.
Calculate the number of stories Ninja can buy with available coins and without free stories.
Calculate the number of free stories Ninja can get based on the number of stories bought.
Add the total number of bought and free stories to get the final result.
You are tasked to help a friend with stock trading for the next 'N' days. He can either buy or sell a stock, with the condition that he can complete at most 2 transact...
Determine maximum profit from at most 2 stock transactions over 'N' days.
Iterate through the prices array to find the maximum profit from 2 transactions.
Keep track of the maximum profit by buying and selling stocks at the right times.
Consider edge cases like when there are no profitable transactions.
Round duration - 90 minutes
Round difficulty - Easy
This was a completely technical coding round where I was asked to solve the problems of data structures.
Given an integer matrix with dimensions m x n
, determine the minimum cost required to reach from the cell (0, 0) to the cell (m-1, n-1).
You are allowed to move from a...
The problem involves finding the minimum cost path in a matrix by moving right, down, or diagonally down-right.
Use dynamic programming to keep track of the minimum cost at each cell
Consider the three possible directions for movement and calculate the cost accordingly
Start from the top-left cell and iterate through the matrix to find the minimum cost path
You are given a binary tree consisting of 'N' unique nodes and a start node where the burning will commence. The task is to calculate the time in minutes required to completely b...
Calculate the time in minutes required to completely burn a binary tree starting from a given node.
Traverse the tree to find the start node and calculate the time for fire to spread to all nodes
Use a queue to keep track of nodes to be burned next
Increment time for each level of nodes burned until the entire tree is burnt
Round duration - 20 minutes
Round difficulty - Easy
It was held on Google meet platform
The interviewer was very experienced person and was very nice too.
He made me comfortable by first introducing himself in a very detailed way and then asking me mine introduction
Since I feel that his internet connection was not very good so he turned off his camera but I decided not to turn off mine as in online interviews your face reviles your confidence
the interviewer mostly asked me questions about my interests in technical field and the project that I have done
Tip 1 : Practice atleast(easy and medium questions from leetcode under(Top Interview Questions)) and all the questions from Gfg under(must to do coding questions for interviews))
Tip 2 : Don't learn each and every question you solved but try to solve question in a way that you can solve its variation during interviews
Tip 3 : Do one project(one is enough) which you can explain with full technical details (why you used this technology, and all logics you applied in implementation)
Tip 1 : Have at least one project which you have made yourself and you should know all the technical questions related to that project (I feel project domain hardly matters like web development or android or ML/AI)
Tip 2 : You should Put only those skills in resume :
1. Which the company requires (eg if you know company doesn't require Networking domain knowledge so
don't include it unnecessary if you are not much confident in it)
2. For on campus internships resume shortlisting is very easy so don't add anything unnecessary which might cause you pain during interview.
I was interviewed before May 2021.
Round duration - 60 Minutes
Round difficulty - Medium
It was a hiring drive for women. Interviewer was experienced person.
Given the preorder and inorder traversal sequences of a binary tree, your task is to construct the binary tree using these traversals.
Th...
Yes, it is possible to achieve a solution with O(N) time complexity using a hashmap to store the indices of elements in the inorder traversal.
Use a hashmap to store the indices of elements in the inorder traversal for quick lookup.
Recursively build the binary tree by selecting the root node from the preorder traversal and finding its index in the inorder traversal.
Divide the inorder traversal into left and right subtre...
Round duration - 60 Minutes
Round difficulty - Medium
You are presented with a list of financial transactions among ‘n’ friends, where each transaction specifies who pays whom and how much. The objective is to minimize the cash...
The problem involves minimizing cash flow among friends by reorganizing debts through direct transfers or reducing total transactions.
Given a list of financial transactions among 'n' friends, where each transaction specifies who pays whom and how much.
Objective is to minimize the cash flow among the friends by reorganizing debts through direct transfers or reducing total transactions.
Output a 2-D matrix showing the opt...
Round duration - 60 Minutes
Round difficulty - Medium
Given a positive integer N
, your task is to determine the number of strings of length N
that can be created using only the characters 'a', 'b', and 'c'. The strings must a...
The problem involves determining the number of strings of length N that can be created using only the characters 'a', 'b', and 'c', with constraints on the number of 'b' and 'c' allowed.
Use dynamic programming to count the number of valid strings for each length N.
Consider the constraints on the number of 'b' and 'c' allowed in each string.
Implement a function to calculate the result modulo 1000000007.
For N = 2, valid ...
Round duration - 60 Minutes
Round difficulty - Medium
Ninja is exploring the data structure of trees and while learning about Binary Search Trees (BST), she created her own. However, she unknowingl...
Identify and reverse the swap in a Binary Search Tree to recover the original structure.
Identify the two nodes that are swapped in the Binary Search Tree.
Swap the two nodes to restore the Binary Search Tree integrity.
Ensure that the left subtree of a node contains only nodes with data less than the node's data, and the right subtree contains only nodes with data greater than the node's data.
Round duration - 60 Minutes
Round difficulty - Medium
Hiring manager round
Given the schedule of N meetings with their start time Start[i]
and end time End[i]
, you need to determine which meetings can be organized in a single meeting room such ...
Given N meetings with start and end times, find the maximum number of meetings that can be organized in a single room without overlap.
Sort the meetings based on their end times.
Iterate through the sorted meetings and select the first meeting that doesn't overlap with the previous one.
Repeat the process until all meetings are considered.
Return the selected meetings in the order they are organized.
Tip 1 : Practice leetcode
Tip 2 : Study low level and high level design properly by working on some real examples
Tip 1 : Be concrete on the projects and experience
Tip 2 : Mention all languages and frameworks you have worked on so far
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 |
Consultant
599
salaries
| ₹0 L/yr - ₹0 L/yr |
Support Engineer
552
salaries
| ₹0 L/yr - ₹0 L/yr |
Amazon
Deloitte
TCS