Microsoft Corporation
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
DSA, Graph, DP, Arrays
3 codes of medium difficulty
I applied via Referral and was interviewed in Apr 2023. There were 3 interview rounds.
2 Medium leetcode problems
2 simple coding questions on online platform
Microsoft Corporation interview questions for designations
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
Get interview-ready with Top Microsoft Corporation Interview Questions
I appeared for an interview 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.
I appeared for an interview 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 appeared for an interview 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 appeared for an interview 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 appeared for an interview in Sep 2020.
Round duration - 45 Minutes
Round difficulty - Easy
Had some small chit-chat regarding how Work from Home is going on for him and me. Later he introduced himself and asked the same.
Coming to technical questions, he asked me the algorithm and also asked me to code the questions mentioned below. Discussed the time complexities and edge cases.
You are given a N x M
matrix of integers. Your task is to return the spiral path of the matrix elements.
The first line contains an integer 'T' which denotes the nu...
The task is to return the spiral path of elements in a given matrix.
Iterate over the matrix in a spiral path by keeping track of the boundaries.
Print the elements in the spiral path as you traverse the matrix.
Handle cases where the matrix is not a square matrix separately.
Given an array or list of strings called inputStr
, your task is to return the strings grouped as anagrams. Each group should contain strings that are anagrams of one anoth...
Group anagrams in an array of strings based on character frequency.
Create a hashmap to store sorted strings as keys and corresponding anagrams as values.
Iterate through the input strings, sort each string, and add it to the hashmap.
Return the values of the hashmap as grouped anagrams.
Round duration - 45 Minutes
Round difficulty - Medium
This round started without any introduction, and he directly jumped into the question. Asked me about the algorithm, and later coded it and ran it. And then he asked me to optimize it. Finally, he asked me if I had any questions.
Design a 2-player Tic-Tac-Toe game played on an N
* N
grid where Player 1 uses ‘X’ and Player 2 uses ‘O’. A move is always valid and occupies an empty spot.
If a player places ...
Design a 2-player Tic-Tac-Toe game on an N x N grid where players take turns placing their marks, and the first player to get N marks in a row wins.
Implement a function move(row, col, player) to handle each player's move and check for a win condition.
Keep track of the board state and update it after each move.
Check for winning conditions horizontally, vertically, and diagonally after each move.
Return the result (0 for ...
Tip 1 : Solve as many questions as you can
Tip 2 : Practice Quantitate aptitude.
Tip 3 : Don't lie on your resume.
Tip 1 : Have some good projects.
Tip 2 : Don't lie on your resume.
Some of the top questions asked at the Microsoft Corporation Software Developer interview for freshers -
The duration of Microsoft Corporation Software Developer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 3 interviews
4 Interview rounds
based on 90 reviews
Rating in categories
Software Engineer
2.2k
salaries
| ₹15 L/yr - ₹51 L/yr |
Senior Software Engineer
1.2k
salaries
| ₹25 L/yr - ₹95 L/yr |
Software Engineer2
1.1k
salaries
| ₹21.1 L/yr - ₹72 L/yr |
Software Developer
880
salaries
| ₹14.3 L/yr - ₹51 L/yr |
Support Engineer
601
salaries
| ₹9 L/yr - ₹30 L/yr |
Amazon
Deloitte
TCS