Microsoft coding interviews are really challenging. The questions are difficult, specific to Microsoft, and cover a wide range of topics.
The good news is that the right preparation can make a big difference and help you land a Software Engineer job at Microsoft. We have put together the ultimate guide to help you maximize your chances of success.
- Process and timeline
- Example questions
- Preparation tips
What's the Microsoft software development engineer (SDE) interview process and timeline? It takes four to eight weeks on average and follows these steps:
- Resume, cover letter, and referrals
- HR Recruiter email or call
- First round: phone screen, on-campus or online test
- Second round: onsite (four interviews)
- Hiring committee review
- You get an offer!
1.1 What interviews to expect
First, it's important that you understand the different stages of your software development engineer interview process with Microsoft. Here’s what you can expect:
- HR Recruiter email or call
- First round: phone screen, on-campus or online test
- Second roud: onsite, four interviews
In most cases, the interview process starts with an HR recruiter call to discuss your interests and to see what group or team would be best for you. Your recruiter will also use this conversation to confirm that you've got a chance of getting the job at all. You should be prepared to explain your background and why you’re a good fit for Microsoft.
1.1.1 Microsoft's first round
If things go well the recruiter will take you to the next step of the process. What happens at this stage varies depending on what team and role you're applying for. But you can usually expect a phone screen if you're an industry hire, an on-campus interview if you're a new graduate, or an online test instead of an actual interview in some cases. We'll review each format below.
Technical phone screens
This step is called the "phone screen", but it can also sometimes happen over video using Skype. Each interview will last 45 to 60 minutes. You'll speak to a peer or a potential manager and they'll ask you a mix of technical and behavioral questions.
For the technical part of the interview, you can expect typical data structure and algorithm questions which you'll have to solve in an online collarborative text editor. The editor won't have syntax highlighting or autocomplete features which you need to get used to during your interview preparation. In our experience, you're very unlikely to be asked system design questions during your phone screen.
For the behavioral part you can expect questions like, "Tell me about yourself," "Why Microsoft?", or "What's your favorite Microsoft product? And why?" In our experience, Microsoft interviewers spend more time on behavioral questions than their counterparts at Facebook or Google. So, it's worth making sure you're ready for common behavioral questions (more on that later).
If you're a student then you'll usually have an on-campus interview instead of a phone screen. You'll be asked a mix of behavioral questions and technical questions which you'll need to solve on a whiteboard. In some cases, you'll also have more than one interview on campus before being moved onsite.
Online coding assessment
Microsoft also sometimes uses online coding tests before taking a candidate onsite. The company uses a variety of tests, but the most common one is a three-question test which you need to solve in 60 to 90 minutes and is administered by Codility.
The questions are typical data structure and algorithm questions for which you need to submit a solution in an online editor. Leetcode maintains a helpful thread of the types of questions that have recently been asked in the test.
1.1.3 Onsite interviews
If you crack the first round, the next step is to spend a full day at one of Microsoft’s offices and participate in four interviews. These interviews will last about 60 minutes and be a one-on-one with a mix of people from the team you’re applying to join, including peers, the hiring manager, and sometimes a senior executive.
Three or four of your interviews will include coding questions (i.e. data structure and algorithm questions) which you'll need to solve on a whiteboard. The other one or two interviews will cover system design questions. You'll be asked behavioral questions in all your interviews.
All candidates are expected to do extremely well in coding and behavioral questions. If you're relatively junior (e.g. SDE II or below) you might not be asked system design questions. And if you do then the bar will be lower than for mid-level or senior engineers (e.g. Senior SDE or above).
The "as appropriate", AA or ASAPP interview
Finally, your last interview will be with a senior executive from Microsoft (e.g. your hiring manager or possibly their boss). This interview is often referred to as the "as appropriate", AA or ASAPP interview because you will only be asked to do that interview if your first three interviews go well. If you don't do well in the first three, then you won't get an AA interview and you won't get an offer.
AA interviewers have two roles. The first one is to ensure that there's no blind spot in your assessment. For instance, if your first three interviewers have established that you meet the technical hiring standards but aren't sure about culture fit, then your AA interview will mainly focus on behavioral questions. The second role of an AA interviewer is to "sell" the company to you if you did well in previous interviews. The idea here is that Microsoft wants to make sure you'll accept the offer if they decide to make you one.
1.2 What exactly is Microsoft looking for
At the end of each interview your interviewer will grade your performance using a standardized feedback form. Here is some of the information that's contained in the form.
Your interviewer will then grade you on different competencies.They will be trying to determine if you meet the bar or not for each competency they are interested in. In other words, you'll need to convince them that you are at least as good as
The exact list of competencies Microsoft looks for varies depending on groups, roles and levels. But here are some of the main ones that are usually discussed by Microsoft recruiters:
- Passion for technology
- Problem solving
- Analytical ability
C) Hiring recommendation
Each interviewer will give a hiring recommendation at the end of the interview. The different options are along the lines of: "Strong hire", "Hire", "No hire", "Strong no hire".
D) Suggested follow-ups
The feedback forms are accessible by all the interviewers in your loop. And each interviewer can suggest a follow-up topic for your next interview. For instance, if you didn't check edge cases in your first coding question, then your interviewer might flag that with you and also with your next interviewer so they can see if you are taking feedback onboard.
1.3 What happens behind the scenes
Your recruiter is leading the process and taking you from one stage to the next. Here's what happens at each of the stages described above:
- After the first round, your recruiter and hiring manager decide to move you to the onsite interviews or not, depending on how well you've done.
- After the onsite, each interviewer files their notes into the internal system, grades you and makes a hiring recommendation (e.g. "Strong hire", "Hire", "No hire", "Strong no hire"). You usually need to receive a "Hire" grade from all interviewers to get an offer. But in some cases, the AA interviewer and / or hiring manager can decide to hire you even if you got one "No hire".
- You get an offer. If everything goes well, the recruiter will be in touch with an offer, usually within a week of the onsite but it can sometimes take longer
It's also important to note that recruiters and people who refer you have little influence on the overall process. They can help you get an interview at the beginning but that's about it.
Here at IGotAnOffer, we believe in data-driven interview preparation and have used Glassdoor data to identify the types of questions which are most frequently asked at Microsoft.
For coding interviews, we've broken down the questions you'll be asked by subcategories (e.g. Arrays / Strings, Graphs / Trees, etc.) so that you can prioritize what to study and practice first. For system design and behavioral questions, we've listed questions that were frequently reported on Glassdoor and other resources.
Microsoft software development engineers solve some of the most difficult problems the company faces with code. It's therefore essential that they have strong problem-solving skills. This is the part of the interview where you want to show that you think in a structured way and write code that's accurate, bug-free and fast.
Here are the most common question types asked in Microsoft coding interviews and their frequency. Please note the list below excludes system design and behavioral questions which we cover in the next sections.
- Arrays / Strings (36% of questions, most frequent)
- Linked lists (29%)
- Graphs / Trees (20%)
- Search / Sort (6%)
- Dynamic programming (5%)
- Bit manipulation / Maths (4% of questions, least frequent)
We've also listed common examples used at Microsoft for these different question types below. For each example, we modified the phrasing of the question to match the closest Leetcode problem and linked to a free solution on Leetcode.
Finally, we recommend watching this video (from 2:47mins onwards) put together by Microsoft to understand more about the step-by-step approach you should use to solve coding questions (more on that later in this article).
Example coding questions asked by Microsoft
1. Arrays / Strings (36% of questions, most frequent)
- Given an input string, reverse the string word by word. (Solution)
- Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. (Solution)
- Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once. (Solution)
- Given an unsorted integer array, find the smallest missing positive integer. Your algorithm should run in O(n) time and uses constant extra space. (Solution)
- Given a C++ program, remove comments from it. The program
sourceis an array where
i-th line of the source code. This represents the result of splitting the original source code string by the newline character
- Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. (Solution)
- Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every element of the array should be a character (not int) of length 1. After you are done modifying the input array in-place, return the new length of the array. (Solution)
- Given a string, find the length of the longest substring T that contains at most k distinct characters. (Solution)
2. Linked lists (29%)
- Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. (Solution)
- A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. (Solution)
- Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. (Solution)
- Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes, only nodes itself may be changed. (Solution)
- Sort a linked list in O(n log n) time using constant space complexity. (Solution)
3. Graphs / Trees (20%)
- Given preorder and inorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree. (Solution)
- Serialize and deserialize N-ary tree. (Solution)
- Given a
nodein a binary search tree, find the in-order successor of that node in the BST. (Solution)
- Given a binary tree, determine if it is a valid binary search tree (BST). Definition provided. (Solution)
- Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion can be divided into two stages: 1) Search for a node to remove. 2) If the node is found, delete the node. Note: Time complexity should be O(height of tree). (Solution)
- Given a directed, acyclic graph of
Nnodes. Find all possible paths from node
N-1, and return them in any order. The graph is given as follows: the nodes are 0, 1, ..., graph.length - 1. graph[i] is a list of all nodes j for which the edge (i, j) exists. (Solution)
4. Search / Sort (6%)
- Given a 2d grid map of
'1's (land) and
'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. (Solution)
- You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to
NULL. Initially, all next pointers are set to
NULL. The binary tree definition is provided. (Solution)
- There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). You may assume nums1 and nums2 cannot be both empty. (Solution)
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: 1) Integers in each row are sorted from left to right. 2) The first integer of each row is greater than the last integer of the previous row. (Solution)
5. Dynamic programming (5%)
- Given an integer array
nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. (Solution)
- Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. (Solution)
- Given an input string (
s) and a pattern (
p), implement regular expression matching with support for
'*'. The matching should cover the entire input string (not partial). (Solution)
6. Bit manipulation / Maths (4% of questions, least frequent)
Microsoft products have millions of monthly active users. The company's engineers therefore need to be able to design systems that are scalable. The coding questions we've covered above usually have a single optimal solution. But the system design questions you'll be asked are typically more open-ended and feel more like a discussion.
This is the part of the interview where you want to show that you can both be creative and structured at the same time. In most cases, your interviewer will adapt the question to your background. For instance, if you've worked on an API product they'll ask you to design an API. But that won't always be the case so you should be ready to design any type of product or system at a high level.
As mentioned previously, if you're a junior developer the expectations will be lower for you than if you're mid-level or senior. In addition, for certain roles (e.g. infrastructure, security, etc.) you will likely have several system design interviews instead of just one.
We've listed some common system design questions asked in the Microsoft interview reports which can be found on Glassdoor and other sources. For more information, we recommend reading the following guide on how to answer system design questions, and practicing system design questions in this course.
Example system design questions asked at Microsoft
- How would you design an IDE like Visual Studio
- How would you design Instagram
- How would you design Uber
- How would you design OpenTable
- How would you design Dropbox / iCloud
- How would you design a shopping cart for Amazon.com
- How would you design the photo gallery app on iOS
- How would you design a distributed cache
- How would you design an API for a running app
- How would you design an API for a tic tac toe game
You'll be asked typical behavioral interview questions such as "Tell me about a difficult project you worked on" in all your interviews. Yet it's common to fail a Microsoft interview because of a lack of preparation for the behavioral section. Fortunately these questions can be easy to prepare for if you know what to expect (see the list below).
In addition, one of the things that sets the company apart is that interviewers are particulalry keen to understand why you want to work at Microsoft and not another place. You should therefore be ready to answer questions such "Why Microsoft?", "What's your favorite Microsoft product? And why?"
Finally, it's worth noting that Microsoft has recently changed its culture to focus on the growth mindset. Showing that you embrace challenges, persist in the face of setbacks, and learn from criticism are therefore all good ways to show you're a good fit for the company.
Example behavioral questions asked at Microsoft
- Tell me about yourself
- Why Microsoft?
- What's you favorite Microsoft product? And why?
- Why are you / do you want to be a software engineer?
- Tell me about a recent / favorite project and some of the difficulties you faced
- Tell me about the greatest accomplishment / failure of your career
- Tell me about a time you struggled to work with one of your colleagues
- Tell me about a time you led a team
- Tell me about some of the biggest lessons you've learned in life
- Tell me about your values and the kind of environments you thrive in
Now that you know what questions to expect, let's focus on how to prepare. Here are the four most important things you can do to get an offer as a Microsoft software development engineer.
3.1 Learn about Microsoft's culture
Most candidates fail to do this. But before investing tens of hours preparing for an interview at Microsoft, you should take some time to make sure it's actually the right company for you.
Microsoft is prestigious and it's therefore tempting to ignore that step completely. But in our experience the prestige in itself won't make you happy day to day. It's the type of work and the people you work with that will.
If you know engineers who work at Microsoft or used to work there talk to them to understand what the culture is like. In addition, we would also recommend reading the following resources:
- Microsoft's growth mindset culture (by Microsoft)
- Microsoft strategy teardown (by CB Insights)
- Microsoft vision and mission analysis (by Panmore Institute)
- Microsoft annual reports (by Microsoft)
3.2 Practice by yourself
As mentioned above, you'll have to answer three types of questions at Microsoft: coding, system design and behavioral. The first step of your preparation should be to brush up on these different types of questions and to practice answering them by yourself.
3.2.1 Coding interview preparation
For coding interviews, we recommend getting used to the step-by-step approach recommended by Microsoft in the video below.
Here is a summary of the STAR approach recommended by Microsoft:
- Step 1: Situation, make sure you understand the problem correctly
- Write down the problem provided by the interviewer
- Ask clarification questions
- Agree on inputs and outputs
- Step 2: Task, outline how you are going to solve the problem
- Run your ideas of how to solve the problem out loud
- Start with a simple case and work toward a solution, without coding
- Think about different test cases which you'll use for testing later
- Step 3: Action, write clean code to solve the problem
- Start writing clean code with clear variable and function names
- Modularize your code with helper functions
- Check with your interviewer before using a library
- Bugs and forgotten variables are ok as long as you catch them early
- Step 4: Result, test your solution and suggest improvements
- Run through the different test cases you've developed in step 2
- Incorporate any feedback from the interviewer in your approach
- Analyze the time and space complexity of your code and suggest improvements
To practice questions we recommend using Leetcode where you can get a lot done with the Free tier, and also access Microsoft-specific questions using the Premium tier. Don't forget to practice questions on a whiteboard or simple text editor instead of an IDE.
3.2.2 System design interview preparation
For system design interviews, Microsoft does not give specific recommendations. But Amazon does, and the approach they outline in the video below is quite helpful.
Here is a summary of what you should do:
- Step 1: Ask clarification questions
- Understand the goal of the system (e.g. sell ebooks)
- Establish the scope of the exercise (e.g. end-to-end experience, or just API?)
- Gather scale and performance requirements (e.g. 500 transactions per second)
- Talk any assumptions you're making out loud
- Step 2: Design at high level then drill down
- Lay out the high level components (e.g. front-end, web servers, database)
- Drill down and design each component (e.g. front-end first)
- Start with the components you're most comfortable with (e.g. front-end if you're a front-end engineer)
- Work with your interviewer to provide the right level of details
- Step 3: Bring it all together
- Refer back to the requirements to make sure your approach meets them
- Discuss any tradeoffs in the decisions you've made
- Summarize how the system would work end-to-end
To practice system design interviews, we recommend using Grokking the System Design Interview. You can both study system design basics using the course and practice interview questions.
3.2.3 Behavioral interview preparation
For behavioral interviews, we recommend learning our step-by-step method to answer this type of questions. In addition, you'll want to write down your answers to the common behavioral questions we have listed in the previous section.
Finally, a great way to practice coding, system design and behavioral questions, is to interview yourself out loud. This may sound strange, but it will significantly improve the way you communicate your answers during an interview and really makes a difference in our experience. Play the role of both the candidate and the interviewer, asking questions and answering them, just like two people would in an interview.
3.3 Practice with peers
Practicing by yourself will only take you so far. One of the main challenges of coding interviews is to have to communicate what you are doing as you are doing it. As a result, we strongly recommend practicing live coding interviews with a peer interviewing you.
A great place to start is to practice with friends if you can. If you don't have anyone in your network who can interview you, then you can also find peers to practice with on platforms such as Pramp.
3.4 Practice with ex-interviewers
The main benefit of practicing with peers is that it's free. But at some point you'll start noticing that the feedback you are getting from peers isn't helping you that much anymore. Once you reach that stage, we recommend practicing with ex-interviewers from top tech companies.
If you know a Software Engineer who has experience running interviews at Microsoft or another Big tech company, then that's fantastic. But for most of us, it's tough to find the right connections to make this happen. And it might also be difficult to practice multiple hours with that person unless you know them really well. If that's your situation, then you should be able to find a good coach on Codementor.io.
If you have any questions about Microsoft coding interviews, do not hesitate to ask them below and we will be more than happy to answer them. All questions are good questions, so go ahead!