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. We've analyzed 250 software engineer interview questions reported by Microsoft candidates, in order to determine the most frequently asked types of questions. Below, we've provided a curated list of real example questions, including free solutions.
In addition, you'll find preparation tips and links to the best resources, so that you can prepare more strategically and maximize your chances of landing that software engineer job at Microsoft.
Here's an overview of what we will cover:
- 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!
As a side note, this is quite similar (but slightly different) to the software engineer interviews at LinkedIn (which is a Microsoft subsidiary). If you're interviewing for a management role, take a a look at our Microsoft engineering manager interview guide.
1.1 What interviews to expect
Now, let's drill down further into the different stages of your software development engineer interview process with Microsoft. Specifically, this will take us deeper into steps 2-4 above, which are:
- HR Recruiter email or call
- First round: phone screen, on-campus or online test
- Second round: 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 with the recruiter, then you'll move on 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 collaborative text editor. The text editor won't have syntax highlighting or autocomplete features, so you'll need to get used to not having those features during your interview preparation. As an additional note, 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 that you'll need to solve on a whiteboard. In some cases, you'll also have more than one interview on campus.
Online coding assessment
Microsoft also sometimes uses online coding tests before passing a candidate through to the onsite interviews. 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.2 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 on-site 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 will apply the feedback.
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 we linked to a free solution on Leetcode.
As you prepare, we also recommend watching this video that was put together by Microsoft (from 2:47mins onwards), to learn more about the step-by-step approach you should use to solve coding questions (more on that later in this article). Now let's jump into the example questions.
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 nums and an integer target, return indices of the two numbers such that they add up to 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 chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: If the group's length is 1, append the character to s. Otherwise, append the character followed by the group's length. The compressed string s should not be returned separately, but instead be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars. After you are done modifying the input array, 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)
- "You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it." (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)
- "Given the head of a linked list, return the list after sorting it in ascending order. Follow up: Can you sort the linked list in O(n logn) time and O(1) memory (i.e. constant space)?" (Solution)
3. Graphs / Trees (20%)
- "Given preorder and inorder traversal of a tree, construct the binary tree. Note: 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)." (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. Follow up: can you solve it with time complexity 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
- "Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays." (Solution)
"Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:  Integers in each row are sorted from left to right.  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. Therefore, the company's engineers 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.
Below we've listed some common system design questions which can be found in the Microsoft interview reports on Glassdoor or on relevant forums (like the Leetcode forum). For more information, we recommend reading the following guide on how to answer system design questions and we recommend 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 particularly 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?", and "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 prepare for your Microsoft software development engineer interviews.
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 this step completely, but the prestige of the company, 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), 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
- Talk through your ideas for solving 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 into 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. You can also access Microsoft-specific questions using the Premium tier if you'd like. 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 through any assumptions you're making out loud
- Step 2: Design at a 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 detail
- 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
We'd also recommend studying our system design interview guide, which digs into this method in more detail. It also provides several example questions with solutions.
3.2.3 Behavioral interview preparation
For behavioral interviews, we recommend learning our step-by-step method for answering this type of question. You'll find the method in our Facebook-specific guide, but it's applicable to any company.
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 can significantly improve the way you communicate your answers during a real interview. 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 communicating what you are doing as you are doing it. As a result, we strongly recommend practicing live coding interviews with a peer interviewing you.
If possible, a great place to start is to practice with friends. This can be especially helpful if your friend has experience with software engineer interviews, or is at least familiar with the process. If you don't have anyone in your network who can interview you, you can find peers to practice with on our mock interview platform.
3.4 Practice with ex-interviewers
Practicing with peers can be a great help, and it's usually 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.
Here's the good news. We've already made the connections for you. We’ve created a coaching service where you can practice 1-on-1 with ex-interviewers from leading tech companies like Microsoft. Learn more and start scheduling sessions today.
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!