Microsoft interview questions

2,029 questions from 282 candidate reports · 2015 to 2025

Online test → Technical → Technical

DSA

Showing 39 of 1,522 reported in this area

Connect nodes at the same level in a binary tree
asked 8×mediumPractice this →
Reverse a linked list in groups of size k.
asked 7×mediumPractice this →
Find the longest palindromic substring in a given string
asked 5×mediumPractice this →
Find the maximum subarray sum using Kadane’s Algorithm.
asked 5×easyPractice this →
Print a given matrix in spiral order.
asked 4×mediumPractice this →
Find the maximum product subarray in a given array.
asked 4×mediumPractice this →
Find the majority element in an array
asked 3×mediumPractice this →
Detect and remove a loop in a linked list.
asked 3×mediumPractice this →
Find the Lowest Common Ancestor (LCA) in a Binary Tree
asked 3×mediumPractice this →
Find the Longest Increasing Subsequence (LIS) in an array.
asked 3×mediumPractice this →
Check whether a given binary tree is a Binary Search Tree (BST).
asked 3×mediumPractice this →
Find the Lowest Common Ancestor (LCA) of two nodes in a Binary Tree
asked 3×mediumPractice this →
Find the length of the longest substring without repeating characters.
asked 3×mediumPractice this →
Find the minimum number of adjacent swaps required to make a given string a palindrome.
asked 3×mediumPractice this →
Clone a linked list with next and random pointer
asked 3×hardPractice this →
Add 1 to a number represented as a linked list
asked 3×easyPractice this →
Perform level order traversal of a binary tree
asked 3×easyPractice this →
Perform inorder traversal of a binary tree without using recursion.
asked 3×easyPractice this →
Reverse every k nodes in a linked list.
asked 2×mediumPractice this →
Longest Palindromic Subsequence in a string
asked 2×mediumPractice this →
Reverse a linked list in groups of given size
asked 2×mediumPractice this →
Find the median in a running stream of numbers
asked 2×mediumPractice this →
Search an element in a sorted and rotated array
asked 2×mediumPractice this →
Find the longest increasing subsequence in an array
asked 2×mediumPractice this →
Group all anagrams together from a list of strings.
asked 2×mediumPractice this →
Connect all nodes at the same level in a binary tree
asked 2×mediumPractice this →
Convert an infix expression to a postfix expression.
asked 2×mediumPractice this →
Find the kth largest element in a Binary Search Tree.
asked 2×mediumPractice this →
Swap two nodes in a doubly linked list using a hashmap.
asked 2×mediumPractice this →
Design and implement an LRU (Least Recently Used) Cache.
asked 2×mediumPractice this →
Find the number of islands in a binary matrix using DFS.
asked 2×mediumPractice this →
Construct a Binary Search Tree from its preorder traversal.
asked 2×mediumPractice this →
Design and implement an LRU Cache with optimal time complexity.
asked 2×mediumPractice this →
Given an array, find the maximum j - i such that arr[j] > arr[i]
asked 2×mediumPractice this →
Rotate a square matrix (image) by 90 degrees clockwise in-place.
asked 2×mediumPractice this →
Find the least common ancestor (LCA) of two nodes in a binary tree
asked 2×mediumPractice this →
Find all nodes at distance K from a given leaf node in a binary tree
asked 2×mediumPractice this →
Print the boundary traversal of a binary tree in clockwise direction.
asked 2×mediumPractice this →
Find the point of intersection of two line segments given their endpoints.
asked 2×mediumPractice this →

CS fundamentals

Showing 9 of 545 reported in this area

What is the difference between a process and a thread?
asked 8×easyPractice this →
Predict the output of C and Java code snippets.
asked 3×easyPractice this →
Explain the difference between mutex and semaphore
asked 3×easyPractice this →
Why would you choose NoSQL over RDBMS?
asked 2×mediumPractice this →
Implement a thread-safe Singleton class.
asked 2×mediumPractice this →
Explain how Garbage Collection works in Java
asked 2×mediumPractice this →
Explain React virtualization and why it is needed
asked 2×mediumPractice this →
Explain the concept of Virtual Memory in Operating Systems
asked 2×mediumPractice this →
How would you implement an LRU (Least Recently Used) cache?
asked 2×mediumPractice this →

System design

Showing 3 of 238 reported in this area

Design and implement an LRU cache
asked 2×mediumPractice this →
How would you handle very large data in a single reducer?
asked 2×mediumPractice this →
Design the newsfeed system of Facebook.
asked 2×hardPractice this →

Behavioural

Showing 3 of 56 reported in this area

How do you prioritize tasks and manage your time effectively?
Tell me about a time when you faced a conflict within a team and how you resolved it.
Can India go completely cashless?
asked oncemediumPractice this →

Puzzles

Showing 3 of 33 reported in this area

Three Ants and Triangle Problem
asked oncemediumPractice this →
Prove that the number between twin primes is divisible by 6
asked oncemediumPractice this →
Solve the puzzle: ABCD × 4 = DCBA. Find the 4-digit number.
asked oncemediumPractice this →

Aptitude

Showing 3 of 23 reported in this area

Given two numbers n and m, find the number closest to n that is divisible by m.
asked 2×easyPractice this →
Estimate a real-world metric using assumptions (guesstimate).
asked oncemediumPractice this →
Find the maximum number of 2×2 squares that can be fit inside a right isosceles triangle.
asked oncemediumPractice this →

Showing 60 of 2,029 questions. Ranked by how often the same question came back across reports.

Practise a Microsoft-style interview

A spoken interview built from these questions, scored when you finish; the report is yours.

Start practising

Common questions

What questions does Microsoft ask?

Candidate interview reports most often cover DSA (63%) and CS fundamentals (23%).

How many rounds does Microsoft interview have?

Candidate interview reports show an average of 4.1 rounds per experience, with a typical sequence of Online test → Technical → Technical. Individual interview paths can vary.

Is the Microsoft interview hard?

Among questions with a reported difficulty, the mix is easy 30%, medium 60%, hard 10%.

Keep reading