Microsoft Corporation
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Clear (1)
I was interviewed in Aug 2022.
Round duration - 60 minutes
Round difficulty - Medium
A problem solving round with 1 problem on DP. It was on a platform with a text editor provided. Was expected to solve the problem and write the code. Post initial discussion on the solution approaches came up with an optimized solution using Dynamic Programming and wrote the solution. Then some discussion on the Time and Space complexity of the solution.
Interviewer was satisfied with the solution and also dry ran with 1 test case.
Given a string S
composed of digits ranging from 2 to 9, determine all possible strings that can be created by mapping these digits to their correspon...
Given a phone number string, generate all possible words by mapping digits to letters on a T9 keypad.
Create a mapping of digits to corresponding letters on a T9 keypad
Use recursion to generate all possible combinations of letters for the input phone number
Sort the generated strings in lexicographical order
Round duration - 60 minutes
Round difficulty - Hard
This round happened on the same day after 1st round. It was a Low level design round with one problem to be solved in 60 minutes.
Round duration - 60 minutes
Round difficulty - Medium
This round happened on the same day after 2nd round. The platform used was codility. It was a System design/ Low level design round with one problem to be solved in 60min.
Round duration - 30 minutes
Round difficulty - Easy
It was an HR round with focus on the work ethics, culture and my prior experiences. The recruiter was trying to test my situation handling capability by asking different scenario based questions.
Tip 1 : Practice problems with consistency
Tip 2 : Learn and try to up solve
Tip 3 : Enjoy each problem and try different ways of solving it
Tip 4 : Brush up OOP concepts
Tip 5 : Practice hands on for Low level design by white board coding
Tip 1 : Have 1-2 good quality projects.
Tip 2 : Try to maintain 1 page resume.
Tip 3 : Put things which you have in depth knowledge about in resume.
I applied via LinkedIn and was interviewed in Feb 2022. There were 5 interview rounds.
Interview was around 1.15 hrs. Initially it was self introduction for both sides. Then a string manipulation related question was posted and asked to solve. At last it was queries to interviewer.
Total time 1hr. Self introduction for both parties.
Questions on CICD process in my project and automation ideas to handle errors with different scenarios. Then queries if any.
Total time 1.15hr.
Self introduction and coding question related to linked list in codility. The question was enhanced depending on splving techniques. Finally queries.
I was interviewed before May 2021.
Round duration - 60 Minutes
Round difficulty - Medium
Given a string ‘S’, your task is to rearrange its characters so that no two adjacent characters are the same. If it's possible, return any such arrangement, otherwise re...
Given a string, rearrange its characters so that no two adjacent characters are the same.
Iterate through the string and count the frequency of each character.
Use a priority queue to rearrange the characters based on their frequency.
Check if it's possible to rearrange the string without any two adjacent characters being the same.
Return 'Yes' if possible, 'No' otherwise.
Your task is to find all nodes that are exactly a distance K from a given node in an arbitrary binary tree. The distance is defined as the number of edges between ...
Find all nodes at distance K from a given node in a binary tree.
Perform a depth-first search starting from the target node to find nodes at distance K.
Use a recursive function to traverse the tree and keep track of the distance from the target node.
Maintain a set to store visited nodes to avoid revisiting them.
Return the list of nodes found at distance K from the target node.
Example: If the target node is 5 and K is 2 ...
Round duration - 60 Minutes
Round difficulty - Medium
Given N
events, each represented with a start
and end
time as intervals, i.e., booking on the half-open interval [start, end). Initially, the calendar is empty. A new event c...
Given N events with start and end times, determine if each event can be added to the calendar without causing a triple booking.
Iterate through each event and check if adding it causes a triple booking by comparing its interval with previous events
Use a data structure like a list or dictionary to keep track of booked intervals
Return 'True' if the event can be added without causing a triple booking, 'False' otherwise
Round duration - 45 minutes
Round difficulty - Easy
Tip 1 : Focus on fundamentals
Tip 2 : Focus on problem solving skills
Tip 3 : Be consistent
Tip 1 : Do not bloat your resume with non-sense, add only what you have done and only major projects.
Tip 2 : Be crisp - adding 10 programming languages in your resume won't take you anywhere but understanding 1 language with heart is definitely a major plus.
What people are saying about Microsoft Corporation
I applied via Referral and was interviewed in Nov 2020. There was 1 interview round.
Get Excel column address based on number given.
Divide the number by 26 and get the remainder and quotient.
Convert the remainder to a character and add it to the result string.
Repeat until quotient is zero.
Find if a given string exists in a given matrix of characters
Iterate through each character in the matrix and check if it matches the first character of the given string. If it does, perform a depth-first search to check if the rest of the string can be formed from adjacent characters in the matrix.
Use a trie data structure to store all possible substrings of the matrix and check if the given string is present in the t...
Designing a video feed API
Define endpoints for accessing video feeds
Include authentication and authorization mechanisms
Consider scalability and performance
Support different video formats and resolutions
Provide error handling and logging
Ensure data privacy and security
Microsoft Corporation interview questions for designations
I was interviewed before May 2021.
Round duration - 60 Minutes
Round difficulty - Easy
Given a list of integers of size N
, your task is to determine the Next Greater Element (NGE) for every element. The Next Greater Element for an element X
is the firs...
Find the Next Greater Element for each element in a list of integers.
Iterate through the list of integers from right to left.
Use a stack to keep track of elements for which the Next Greater Element is not yet found.
Pop elements from the stack until a greater element is found or the stack is empty.
Assign the Next Greater Element as the top element of the stack or -1 if the stack is empty.
Your task is to create a deep copy of a linked list, where each node has two pointers: one that points to the next node in the list, and a 'random' pointer which can ...
Create a deep copy of a linked list with random pointers.
Iterate through the original linked list and create a new node for each node in the list.
Store the mapping of original nodes to their corresponding new nodes.
Update the next and random pointers of the new nodes based on the mapping.
Return the head of the newly created deep copied linked list.
Round duration - 60 Minutes
Round difficulty - Medium
Given two strings S
and X
containing random characters, the task is to find the smallest substring in S
which contains all the characters present in X
.
The first...
The task is to find the smallest substring in string S which contains all the characters present in string X.
Iterate through string S and keep track of characters in X using a hashmap
Use two pointers to maintain a sliding window with all characters from X
Update the window size and start index when a valid window is found
Given a binary tree, connect all adjacent nodes at the same level by populating each node's 'next' pointer to point to its next right node. If there is no nex...
Connect adjacent nodes at the same level in a binary tree by populating each node's 'next' pointer.
Traverse the tree level by level using a queue.
For each node, connect it to the next node in the queue.
Set the 'next' pointer of the last node in each level to NULL.
Use constant extra space and do not alter the node structure.
Round duration - 60 Minutes
Round difficulty - Easy
You are given a string 'S' that represents a number. Your task is to find the closest palindromic number to this integer represented by 'S'. The closest number is defi...
Find the closest palindromic number to a given integer represented by a string.
Convert the string to an integer and iterate to find the closest palindromic number.
Check for palindromic numbers by reversing the digits and comparing with the original number.
Handle cases where multiple closest palindromic numbers exist by choosing the smaller one.
Round duration - 60 Minutes
Round difficulty - Medium
You are given two strings str1
and str2
. Determine the minimum number of operations required to transform str1
into str2
.
An operatio...
Determine the minimum number of operations needed to transform one string into another by moving characters to the end.
Iterate through each character in str1 and check if it matches the first character in str2. If it does, calculate the number of operations needed to move it to the end.
If no match is found for the first character in str2, return -1 as transformation is not possible.
Repeat the process for each test case...
Given a Snake and Ladder Board with 'N' rows and 'N' columns filled with numbers from 1 to N*N starting from the bottom left of the board, and alternating direction each...
Find the minimum number of dice throws required to reach the last cell on a Snake and Ladder board.
Use Breadth First Search (BFS) to explore all possible paths with minimum dice throws.
Keep track of visited cells and the number of dice throws needed to reach each cell.
Consider the effect of snakes and ladders on the next position.
Return the minimum number of dice throws needed to reach the last cell.
If it is impossible
A web crawler is a program that systematically browses the internet to index and collect information from websites.
Start by identifying the target websites to crawl
Implement a queue to manage the URLs to be crawled
Use a crawler algorithm to visit and extract data from web pages
Implement a mechanism to handle duplicate URLs and avoid infinite loops
Consider implementing a robots.txt parser to respect website crawling rul
Round duration - 70 Minutes
Round difficulty - Medium
Design a system to handle millions of requests for key-value operations efficiently.
Use a distributed key-value store like Redis or Cassandra for storing data.
Implement sharding to distribute data across multiple nodes for scalability.
Use caching mechanisms like Memcached to reduce read latency.
Implement load balancing to evenly distribute incoming requests.
Use asynchronous processing for write operations to improve pe...
Tip 1 : Solve atleast 1 DS/Algo problem everyday
Tip 2 : Learn high level designs and low level designs
Tip 1 : Have your skills defined in bold like worked on scaling the system which takes 100 million traffic per day etc, have experience in BigData, kafka, AWS/Azure erc
Tip2 : Show your achievements separately like Won ABC Hackathon, ICPC Regional finalist, etc
Get interview-ready with Top Microsoft Corporation Interview Questions
I was interviewed before Mar 2021.
Round duration - 60 minutes
Round difficulty - Medium
2 coding question both and 15 MCQ
Only C , Java , Python are allowed
Given a square chessboard of size 'N x N', determine the minimum number of moves a Knight requires to reach a specified target position from its initial position...
Calculate the minimum number of moves a Knight requires to reach a specified target position on a chessboard.
Use breadth-first search (BFS) algorithm to find the shortest path for the Knight.
Consider all possible moves of the Knight on the chessboard.
Keep track of visited positions to avoid revisiting them.
Return the minimum number of moves required to reach the target position.
You are provided with an N * M
sized binary matrix 'MAT' where 'N' denotes the number of rows and 'M' denotes the number of columns. Your t...
Find the maximum area of a submatrix with all 1's in a binary matrix.
Iterate over the matrix and calculate the maximum area of submatrices with all 1's.
Use dynamic programming to efficiently solve the problem.
Consider the current cell and its top, left, and top-left diagonal neighbors to calculate the area.
Round duration - 45 minutes
Round difficulty - Easy
Around 6 am morning
2 interviewers
Given a Singly Linked List of integers, your task is to reverse the Linked List by altering the links between the nodes.
The first line of input is an intege...
Reverse a singly linked list by altering the links between nodes.
Iterate through the linked list and reverse the links between nodes
Use three pointers to keep track of the previous, current, and next nodes
Update the links between nodes to reverse the list
Return the head of the reversed linked list
Synchronization in operating systems ensures proper coordination and communication between multiple processes or threads.
Synchronization is necessary to prevent race conditions and ensure data consistency.
Common synchronization mechanisms include mutexes, semaphores, and monitors.
Mutexes allow only one thread to access a resource at a time, preventing concurrent access.
Semaphores control access to a shared resource by ...
The OSI model is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven layers.
Physical Layer: Transmits raw data bits over a physical medium (e.g. Ethernet cable)
Data Link Layer: Provides error detection and correction (e.g. MAC addresses in Ethernet)
Network Layer: Routes data packets between networks (e.g. IP addresses in Internet)
Transport Layer: Ensures reliable...
A NAT router is a device that allows multiple devices on a local network to share a single public IP address for internet access.
NAT stands for Network Address Translation, which allows private IP addresses to be translated to a public IP address for communication over the internet.
NAT routers provide an added layer of security by hiding the internal IP addresses of devices on the network from external sources.
NAT rout...
To compete with Google in search engine, focus on niche markets, improve user experience, and leverage AI technology.
Focus on niche markets where Google may not have as strong of a presence
Improve user experience by providing more relevant search results and faster load times
Leverage AI technology to personalize search results and enhance user experience
Invest in marketing and partnerships to increase visibility and us...
The total amount of water on Earth is approximately 1.386 billion cubic kilometers.
The majority of Earth's water is in the form of saltwater in the oceans, accounting for about 97.5% of the total water volume.
Only about 2.5% of Earth's water is freshwater, with the majority of that being stored in glaciers and ice caps.
The total amount of water on Earth is constantly cycling through the atmosphere, oceans, rivers, and
Round duration - 30 minutes
Round difficulty - Easy
Manager Round
I faced challenges in data collection, analysis, and time management during my master's thesis.
Difficulty in finding relevant research papers and data sources
Struggling with complex statistical analysis techniques
Managing time effectively to meet deadlines
Dealing with unexpected setbacks and technical issues
Balancing thesis work with other academic and personal commitments
Round duration - 10 Minutes
Round difficulty - Easy
Salary breakdown and Location preference
Tip 1 : Computer Network should be strong
Tip 2 : Exposure to system programming also helps
Tip 3 : At least 150 problems and C++ was not allowed so prepare accordingly
Tip 1 : Project should be really good
Tip 2 : Write Computer Network and Operating System Courses in resume as course taken
To determine if a point is inside a polygon, use the ray casting algorithm.
Create a line from the point to a point outside the polygon
Count the number of times the line intersects with the polygon edges
If the count is odd, the point is inside the polygon; otherwise, it is outside
The four storage classes in C are auto, register, static, and extern.
Auto: default storage class for all local variables
Register: used to define local variables that should be stored in a register instead of RAM
Static: used to define local variables that retain their value between function calls
Extern: used to declare a global variable that is defined in another file
i is stored in global data segment, j is stored in stack, k is stored in heap.
i is a global variable and is stored in the global data segment
j is a local variable and is stored in the stack
k is a pointer variable and is stored in the stack, while the memory it points to is allocated on the heap using malloc()
Use a hash table to store the words and check for existence in constant time.
Create a hash table with the words as keys and a boolean value as the value.
For each new word, check if it exists in the hash table. If it does, it has appeared before. If not, add it to the hash table.
Alternatively, use a set data structure to store only the unique words and check for existence in the set.
I was interviewed before Jan 2021.
Round duration - 60 Minutes
Round difficulty - Medium
The interviewer asked me 2 questions related to DS/Algo in this round . Both the questions were of Easy-Medium difficulty and I was also required to code them in a production ready manner.
You are provided with a binary tree consisting of N
nodes where each node has an integer value. The task is to determine the maximum sum achievable by a...
Find the maximum sum achievable by a simple path between any two nodes in a binary tree.
Traverse the binary tree to find all possible paths and calculate their sums.
Keep track of the maximum sum encountered during traversal.
Consider paths that may include the same node twice.
Implement a recursive function to explore all possible paths.
Handle cases where nodes have negative values.
Given two arrays A
and B
with sizes N
and M
respectively, both sorted in non-decreasing order, determine their intersection.
The intersection of two arrays in...
The problem involves finding the intersection of two sorted arrays efficiently.
Use two pointers to iterate through both arrays simultaneously.
Compare elements at the pointers and move the pointers accordingly.
Handle cases where elements are equal, and update the intersection array.
Return the intersection array as the result.
Round duration - 50 Minutes
Round difficulty - Medium
This round had 2 questions of DS/Algo to solve under 50 minutes and one question related to Operating Systems.
You are provided with an array or list ARR
containing N
positive integers. Your task is to determine the Next Greater Element (NGE) for each element in the array.
T...
Find the Next Greater Element for each element in an array.
Iterate through the array from right to left
Use a stack to keep track of elements with no greater element to the right
Pop elements from the stack until finding a greater element or stack is empty
Given three integers X
, C
, and Y
, where X
is the first term of an arithmetic sequence with a common difference of C
, determine if Y
is part of this arithmetic sequ...
Check if a given number is part of an arithmetic sequence with a given first term and common difference.
Calculate the arithmetic sequence using the formula: nth term = X + (n-1) * C
Check if Y is equal to any term in the sequence to determine if it belongs to the sequence
Return 'True' if Y belongs to the sequence, otherwise return 'False'
Processes are instances of programs in execution, while threads are smaller units within a process that can execute independently.
A process is a program in execution, consisting of code, data, and resources.
Threads are smaller units within a process that can execute independently.
Processes have their own memory space, while threads share the same memory space within a process.
Processes are heavyweight, while threads ar...
Round duration - 50 Minutes
Round difficulty - Medium
This round had 2 questions of DSA of Easy-Medium difficulty and at the end I was asked a Puzzle to check my general problem solving ability.
Given an array/list arr
of size n
, determine the maximum product possible by taking any subset of the array/list arr
. Return the result modulo 10^9+7
since the product ...
Find the maximum product of a subset of an array modulo 10^9+7.
Iterate through the array and keep track of the maximum positive product and minimum negative product encountered so far.
Handle cases where the array contains zeros separately.
Return the maximum product modulo 10^9+7.
Given a complete binary tree with 'N' nodes, your task is to determine the 'next' node immediately to the right in level order for each node in the given tree.
...Implement a function to update 'next' pointers in a complete binary tree.
Iterate level by level using a queue
Connect nodes at each level using 'next' pointers
Handle null nodes appropriately
Ensure the tree is a complete binary tree
Round duration - 50 Minutes
Round difficulty - Medium
This round consisted of 2 questions from DSA where I was first asked to explain my approach to the interviewer with proper complexity analysis and then code the problems. The interviewer was quite friendly and also provided me some hints when I was stuck.
Create a stack data structure that supports not only the usual push and pop operations but also getMin(), which retrieves the minimum element, all in O(1) time complexity witho...
Implement a stack with push, pop, top, isEmpty, and getMin operations in O(1) time complexity without using extra space.
Use two stacks - one to store the actual elements and another to store the minimum element at each level.
When pushing an element, check if it is smaller than the current minimum and update the minimum stack accordingly.
When popping an element, also pop from the minimum stack if the popped element is t...
You are given an integer array arr
of size N
. Your task is to split the array into the maximum number of subarrays such that the first and last occurre...
Given an array, split it into maximum subarrays with first and last occurrence of each element in a single subarray.
Iterate through the array and keep track of the first and last occurrence of each element.
Use a hashmap to store the indices of each element.
Split the array whenever the last occurrence of an element is found.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Return all root to leaf node paths in a binary tree with row, col and value.
Traverse the binary tree recursively and keep track of the current path.
When a leaf node is reached, add the path to the result array.
Include row, col and value of each node in the path.
Use an array of strings to store the paths.
To get max value from a stack in O(1), maintain a separate stack to keep track of maximum values.
Create a separate stack to keep track of maximum values
Push the maximum value onto the stack whenever a new maximum is encountered
Pop the maximum value stack whenever the top element of the main stack is popped
Return the top element of the maximum value stack to get the maximum value in O(1)
To get max element from a queue in O(1) time complexity
Maintain a separate variable to keep track of the maximum element in the queue
Update the maximum element variable whenever a new element is added or removed from the queue
Return the maximum element variable when getMax() function is called
Find the Next Greatest Element to the right for each element in an array of strings.
Iterate through the array from right to left
Use a stack to keep track of elements
Pop elements from stack until a greater element is found
If no greater element is found, assign -1
Return the result array
To remove unnecessary parenthesis from an expression, we need to apply a set of rules to identify and eliminate them.
Identify and remove parenthesis around single variables or constants
Identify and remove parenthesis around expressions with only one operator
Identify and remove parenthesis around expressions with operators of equal precedence
Identify and remove parenthesis around expressions with operators of different ...
Find the maximum product of three integers in an array.
Sort the array in descending order.
Check the product of the first three numbers and the product of the first and last two numbers.
Return the maximum of the two products.
Find length of longest consecutive sub array forming an AP from given array of integers.
Sort the array in ascending order
Iterate through the array and find the longest consecutive sub array forming an AP
Use a variable to keep track of the length of the current consecutive sub array forming an AP
Use another variable to keep track of the length of the longest consecutive sub array forming an AP seen so far
based on 9 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