Microsoft Interview Questions: 75 You Can Expect In Your Interview

January 20, 2021
Blog
Microsoft-Questions" alt="" />
There’s never been a better time to be a Canadian business owner thanks to the American Express® Aeroplan®* Business Reserve Card, a premium card that offers incredible value. For a limited time, earn up to 150,000 Aeroplan points*. Offer ends August 3, 2021.

The American Express® Aeroplan®* Business Reserve Card is made from precision cut and engraved 13 g metal. Enjoy access to select Maple Leaf Lounges™* and the Air Canada Café™*. If you’re a business owner that travels at least once per year, we highly recommend the American Express® Aeroplan®* Business Reserve Card.

*Conditions and caps apply.

Microsoft is perhaps the most well-known and longest-standing of the big tech companies still around. In this post, we’ll mention 75 of the most common questions in technical interviews from Microsoft, as well as how you can use Tech Interview Pro, a proven program offering hundreds of coding walk-throughs that also prepares you for the soft side of the interview, to easily get through these questions and the interviewing process as a whole.

Microsoft is perhaps the most well-known and longest-standing of the big tech companies still around, being founded in 1975 and with plenty of astounding innovations in technology under its belt.

But being part of this innovation is no easy task: especially considering how difficult Microsoft's interviewing questions can be.

However, this is no longer the mid-70s and 80s: you have the Internet on your side, which can lead you to this post with 75 of the most common questions you can expect to see in your interview.

Quite the headstart, don't you think?

Microsoft Technical Questions

  1. Design a database scheme with entities and relations to store the family tree of a person.
  2. Write a program that prints the last 10 lines of a very large file.
  3. Given a list of sorted lists (each of a maximum size M), implement an iterator.
  4. Explain the difference between ORM and JDBC and provide some examples of when to use one over the other.
  5. Given a positive integer N, write a function that finds out the smallest integer M such that all digits in M equal to N when multiplied.
  6. Write a function that reverses any string inputted.
  7. Write a function that finds the longest substring palindrome in a string.
  8. Write a function that checks if the number inputted is a super-prime.
  9. Design a system that can calculate the average duration of a Skype call per day.
  10. Write a program that prints the last 10 lines of 1,000 files.
  11. Given a pre-order traversal, construct a binary search tree in O(n) time.
  12. Given a very large binary number that cannot be stored in a variable, determine the remainder of the decimal equivalent of the binary number when divided by N.
  13. Given a very large text file, write an algorithm that finds the distance (measured in number of words) between any two given words.
  14. Given a text file, write a function that returns the starting index of a given word in it.
  15. Write a function that implements a queue using only one stack.
  16. Design a stock market system.
  17. Write a function that prints elements of a matrix in spiral form.
  18. Given a string, write a function that prints every unique character as well as the number of times each one appeared in the string.
  19. Write a function that merges two binary search trees.
  20. Given a matrix that is sorted in spiral form, write a function that removes and reinserts another element while maintaining the sorted order.
  21. Given a string with a succession of characters (For example, “ABCDAABCD”), write a function that shuffles the string so that there are no similar characters beside each other.
  22. Given a DNA sequence, find all duplicates with a length of 10 characters.
  23. What is the best sorting algorithm complexity wise, and why?
  24. Write an algorithm that efficiently sorts 1TB of unsorted long integers in 1GB of memory.
  25. Given a list of integers, write a function that returns true if the list can be split into two lists that have an equal sum.
  26. Given an array of integers, write a function that finds out the index that balances the array. If no such index exists, return the index that minimizes the difference.
  27. Write a function that inserts an integer into a circular single linked list.
  28. Given a number as a string, write a function that converts the string into its integer equivalent.
  29. Given a single connected linked list, write a function that finds the largest palindrome in the list.
  30. Given a tree and a pointer to one node in the tree, print the leftmost element in the same level as that node.
  31. Given a linked list of strings, write a function that finds the sequence where the last character is equal to the first character.
  32. Write a function that determines how many numbers between 1 and 100,000 contain an even number of odd digits.
  33. Given an array where each element is a maximum +/- index away from its sorted position, write an algorithm that sorts the array.
  34. Write a function that traverses a binary tree and outputs the nodes in order and in O(1) space.
  35. Write a function that takes a string with numbers as an input and outputs an integer.
  36. Write a function that removes duplicates in an array of numbers.
  37. You have 9 spheres: 8 of them weigh the same, but one of them weighs more than the others. How can we find the heaviest weighted sphere in no more than 2 operations?
  38. Write a program to find the minimum value in an unsorted array of integers.
  39. Write a function that gives the length of the largest palindrome within a string.
  40. Given a BST, write a function that finds out the minimum length from root to leaf with sum S.
  41. Given a linked list with next and high pointers, populate high pointers to the next higher node in place, and O(n).
  42. Given a string, write a function that determines which character appears the most and the number of times that character appeared.
  43. Given an integer as an input, write a function that outputs that integer in string form. (Example: 9 = “Nine”)
  44. Write a function that prints the diagonals of a matrix.
  45. Write a function that finds the maximum sum subarray of an array.
  46. Write a function that validates the integrity of a binary search tree.
  47. Given an integer array, write a function that performs a circular right shift by N.
  48. Write a function that finds the maximum height of a binary tree.
  49. Given two arrays, write a function that finds the intersection of those two arrays.
  50. Write a function that rotates a N * M matrix by 90 degrees.

Microsoft Coding Answer Examples

All coding examples written in C++.

Coding Example 1: Write a function that takes a string with numbers as an input and outputs an integer

#include <iostream> 
#include <boost/lexical_cast.hpp>// for lexical_cast() 
#include <string> // for string 
using namespace std; 

int main() 
{ 
   string str = "5"; 
   string str1 = "6.5"; 
  
   // Initializing f_value with casted float 
   // f_value is 6.5 
   float f_value = boost::lexical_cast<float>(str1); 
  
   // Initializing i_value with casted int 
   // i_value is 5 
   int i_value = boost::lexical_cast<int>(str); 
  
   //Displaying casted values 
   cout << "The float value after casting is : "; 
   cout << f_value <<endl; 
   cout << "The int value after casting is : "; 
   cout << i_value <<endl; 
  
   return 0;
}

Coding Example #2: Write a function that gives the length of the largest palindrome within a string

#include <bits/stdc++.h>
using namespace std;
 
// Function to print a substring str[low..high]
void printSubStr(string str, int low, int high)
{
    for (int i = low; i <= high; ++i)
        cout << str[i];
}
 
// This function prints the
// longest palindrome substring
// It also returns the length
// of the longest palindrome
int longestPalSubstr(string str)
{
    // get length of input string
    int n = str.size();
 
    // All substrings of length 1
    // are palindromes
    int maxLength = 1, start = 0;
 
    // Nested loop to mark start and end index
    for (int i = 0; i < str.length(); i++) {
        for (int j = i; j < str.length(); j++) {
            int flag = 1;
 
            // Check palindrome
            for (int k = 0; k < (j - i + 1) / 2; k++)
                if (str[i + k] != str[j - k])
                    flag = 0;
 
            // Palindrome
            if (flag && (j - i + 1) > maxLength) {
                start = i;
                maxLength = j - i + 1;
            }
        }
    }
 
    cout << "Longest palindrome substring is: ";
    printSubStr(str, start, start + maxLength - 1);
 
    // return length of LPS
    return maxLength;
}
 
// Driver Code
int main()
{
    string str = "forgeeksskeegfor";
    cout << "\nLength is: "
         << longestPalSubstr(str);
    return 0;
}
Earn more in 2021 than you did in 2020

Yore Oyster has partnered with Prehired to help you level up your skills and start earning the money what you deserve. Apply today to hear from a member of the Prehired team in as little as 2 business days.

Microsoft Behavioral Questions

  1. If you could change one thing about [Microsoft product or service], what would it be and why?
  2. What is your favorite piece of technology? Why do you enjoy it?
  3. Name a product or service that you believe was marketed well. What about the campaign stands out to you?
  4. What motivates you to excel in a role?
  5. Name something unique that you bring to the table.
  6. If you only had 90 seconds, how would you explain the cloud to someone?
  7. Do you use Microsoft products or services? If so, which is your favorite, and why?
  8. Explain recursion in a way that a non-technical person could understand.
  9. Why do you want to work for Microsoft?
  10. What do you hope to find in your next position?
  11. If Microsoft wanted to introduce a data analytics product to small businesses, how would you market it to drive interest and highlight its virtues?
  12. When you conduct user research, how do you account for your own biases?
  13. How do you build and maintain functional relationships with colleagues working in other locations?
  14. How do you go about securing buy-in from stakeholders?
  15. Name an application with a UI you admire. What about it do you appreciate?
  16. What steps would you take to correct a slow startup issue on a computer running Windows 10?
  17. What steps do you take to keep your skills current?
  18. Have you worked with a coworker who was not shouldering fair share of the workload? 
  19. What are the qualities you look for in your immediate boss/supervisor?
  20. What steps do you take to improve yourself?
  21. What are your hobbies/interests outside work?
  22. How would you deal with the work that is criticized by your boss or supervisor?
  23. Tell me about a time you had a difficult relationship with a colleague. What steps did you take to ensure any challenges were resolved or, at a minimum, did not interfere with your ability to perform?
  24. Tell me about a project where your initial assumptions ended up being incorrect. What steps did you take that revealed this? How did you ensure you moved forward properly after?
  25. If a sales rep in your department gave a valued client an incorrect sales quote, how would you remedy the issue?

Microsoft Behavioral Answer Examples

Behavioral Example #1: What steps do you take to keep your skills current?

Technology evolves at an astounding rate, and even if companies like Microsoft offer training to their employees to help them sharpen their skills, they can’t fully handle this evolution.

This is the reason hiring managers favor candidates who are motivated to learn on their own. They ask questions like these because they're trying to find out whether you're in charge of your own learning destiny, or if you’re happy to sit back and wait for your employer to do that for you.

Behavioral Example #2: Do you use Microsoft products or services? If so, which is your favorite, and why?

This question is very straightforward: it allows the hiring manager to gauge your familiarity with Microsoft’s product or service lines.

However, since the question is rather broad, you can steer your answer in nearly any direction, which means that you can use it as a chance to highlight relevant skills or traits that you want to showcase that you may not be able to work in otherwise. Additionally, you can tweak your approach based on which of the Microsoft jobs you are trying to land, allowing you to discuss a product or service that aligns with the nature of the role.

Behavioral Example #3: How do you build and maintain functional relationships with colleagues working in other locations?

Microsoft is an international company with employees scattered all around the globe. Not only that, but many Microsoft jobs are remote, allowing the person in the position to work without ever setting foot in the office.

Hiring managers want to know that the candidates they choose can coordinate effectively with colleagues with ease, including those they may never meet in person. That makes this question incredibly important for a surprising number of positions.

Why Tech Interview Pro?

So, some of these technical questions might seem like child's play to you, and that's understandable.

But others can be pretty challenging to tackle, and considering you'll have the pressure of having an interviewer beside you as well as limited time to solve these questions, even simple questions can become more difficult than they seem.

And if that weren't enough, you'll also have to deal with behavioral questions: software engineers seldom prepare for those.

So, if you want to make sure you have the best chance at succeeding on your interview, you'll need something that helps you study both things at the same time.

For this reason, I recommend you use Tech Interview Pro, an interview prep program designed by a former Google and Facebook software engineer who has compressed the knowledge he gathered from conducting over 100 interviews during his time into a single course.

Here are a few reasons why I recommend it.

#1 A Comprehensive Approach

Tech Interview Pro takes a thorough approach to its teaching, taking both the technical and behavioral aspects into consideration in its 20+ hours of video lessons.

Here’s TIP’s course outline:

  1. Understanding The Interview Process
  2. Four Axes of the Interview
    1. Coding
    2. Data Structures & Algorithms
    3. Systems Design
    4. Communication
  3. Interviewing Masterclass
  4. Data Structures & Algorithms
  5. 100+ Coding Sessions
  6. The Mock Interview
  7. Systems Design
  8. Transitioning Careers
  9. Negotiating & Accepting Your Offer

As you can see, TIP has a balance of both the technical and the behavioral, which is definitely more coverage than most of the tech interview prep courses out there.

#2 Private Facebook Group

Another neat feature that Tech Interview Pro grants its students is access to a private Facebook group with 1,500+ former students of the course.

Here are some of their success stories:

Tech Interview Pro Review - Success Stories
Tech Interview Pro Review - Success Stories
Tech Interview Pro Review - Success Stories

When you consider how many TIP students have landed jobs at FAANG companies thanks to the course, as well as how active and supportive the Facebook group is day to day, it’s really an invaluable resource to have.

#3 Created By An Industry Insider

Tech Interview Pro is run by an industry veteran who has reverse-engineered the hiring process to give you the best chance of success.

TechLead (Patrick Shyu) has grown his own websites to millions of users, spent his recent years working at Facebook and Google, and has conducted over 100 technical interviews for Google.

So if there’s anyone who can teach you how to ace your technical interviews, it’s this guy.

#4 Bi-Weekly Q&A Sessions

Every two weeks, TIP students can engage in Q&A sessions with the course’s founder, TechLead.

Tech Interview Pro Review

This is a huge advantage: after all, nothing’s stopping you from asking any of the questions featured on the list above, whether it’s a technical question or a behavioral one, and you can expect a thorough answer in return.

Another thing to keep in mind is that every Q&A session is recorded and ready to be accessed at any time, so there’s nothing stopping you from checking previous Q&A sessions too.

#5 Resume Reviews

Your resume will be the first thing a recruiter will see coming from your end, and making it look pretty won’t be enough: you need to make sure it knocks them out when they see it so that you can have a headstart into the interviewing process.

Considering this, TechLead will also personally review your resume and help you tailor it for the position and the company you seek to apply for.

#6 Lifetime Access

Lastly, TIP grants lifetime access to the entire course and private Facebook group, which means that you’ll be able to see new video lessons as they’re added, grow alongside the Facebook group, watch all of future Q&A sessions, and everything else.

TIP’s got your back, whether you want to land a job now or in the future.

In Summary

Being part of Microsoft as a software engineer is a dream that requires a metric ton of hard work, but it's certainly not impossible to achieve.

As long as you give yourself enough time to prepare for every pitfall along the way, you should have a pretty good chance of leaving the interviewing process with a job in hand. To give yourself the best possible chance of success, we recommend you prepare with a more comprehensive, battle-tested solution like Tech Interview Pro.

Canada's Best Credit Cards

Our #1-Rated Card Of 2021

Earn up to 75,000 Aeroplan Miles (valued at $1,500 - $2,250) with the American Express Aeroplan Card, our #1-rated card in Canada in 2021.

Offer expires August 3, 2021.

For Business Owners

Earn up to 150,000 Aeroplan Miles (valued at $3,000 - $4,500) with the American Express Aeroplan Business Reserve Card, plus 10x the points on gas and restaurant spending.

Offer expires August 3, 2021.

Low Fee, High Value

Earn up to 50,000 MR points (valued at $1,000 - $1,500) with the American Express Cobalt Card, a low-fee card that offers 5x the points on all food and drinks.

Offer expires August 16, 2021.