Upload Button Icon Add office photos

Microsoft Corporation

Compare button icon Compare button icon Compare

Filter interviews by

Microsoft Corporation Software Developer Interview Questions and Answers

Updated 19 Mar 2025

146 Interview questions

A Software Developer was asked
Q. Given an integer array, find all triplets (a, b, c) such that a^2 + b^2 = c^2. Provide an O(n^2) solution with code and test cases.
Ans. 

Given an integer array, find all (a,b,c) such that a^2 + b^2 = c^2. Solution is O(n^2). Write code and testcases.

  • Use nested loops to iterate through all possible pairs of integers in the array

  • Check if the sum of squares of the two integers is a perfect square

  • If yes, add the triplet to the result list

  • Return the result list

A Software Developer was asked
Q. Given a pointer to the root of a binary tree, determine whether the left and right subtrees are mirror images of each other.
Ans. 

Given a binary tree, check if left and right subtrees are mirror images of each other.

  • Traverse the tree and compare left and right subtrees recursively.

  • Use a stack or queue to traverse the tree iteratively.

  • Check if the left subtree is a mirror image of the right subtree by comparing their values and structures.

  • Consider an empty tree as a mirror image of itself.

Software Developer Interview Questions Asked at Other Companies

asked in Amazon
Q1. Maximum Subarray Sum Problem Statement Given an array of integers ... read more
asked in Rakuten
Q2. Merge Two Sorted Arrays Problem Statement Given two sorted intege ... read more
asked in Amazon
Q3. Minimum Number of Platforms Needed Problem Statement You are give ... read more
asked in Cognizant
Q4. Nth Fibonacci Number Problem Statement Calculate the Nth term in ... read more
asked in PhonePe
Q5. Form a Triangle Problem Statement You are given an array of integ ... read more
A Software Developer was asked
Q. Given a bit pattern (in an integer INPUT), and another pattern (in an integer PATTERN, with a number n signifying the number of trailing bits to be considered as pattern - remaining bits are zero. Example: ...
Ans. 

Count the number of occurrences of a given bit pattern in an integer.

  • Extract the n trailing bits from the pattern and create a mask with all other bits set to zero.

  • Use a sliding window approach to compare the extracted pattern with all possible n-bit sequences in the input integer.

  • Increment a counter every time the extracted pattern matches with a sequence in the input integer.

A Software Developer was asked
Q. Given a string INPUT, find the longest repeating substring.
Ans. 

Find the longest repeating substring in a given string.

  • Create an array of all possible substrings of the given string.

  • Sort the array in lexicographic order.

  • Find the longest common prefix between adjacent strings.

  • Return the longest common prefix found.

  • If no repeating substring is found, return an empty string.

What people are saying about Microsoft Corporation

View All
a software developer
1w
Just Microsoft things!
Offer sleeping pods in office Employees turn unproductive Revenue drops Fire Thousands of employees in the name of "AI Revolution"!
FeedCard Image
Got a question about Microsoft Corporation?
Ask anonymously on communities.
A Software Developer was asked
Q. Write a program to check if a binary tree is height-balanced and write test cases.
Ans. 

WAP to check if binary tree is height-balanced and write testcases

  • A binary tree is height-balanced if the difference between the heights of its left and right subtrees is not more than 1

  • Use recursion to check if each subtree is height-balanced

  • Write testcases to cover all possible scenarios, including empty tree, single node tree, and unbalanced trees

A Software Developer was asked
Q. You are given a file pointer and an integer n. Write C code to print the last 'n' lines of that file.
Ans. 

C code to print last n lines of a file given file pointer and integer n.

  • Use fseek() to move the file pointer to the end of the file

  • Count the number of newline characters encountered from the end of the file until n lines are found

  • Use fgets() to read and print the last n lines

A Software Developer was asked
Q. What data structure would you use to represent an N-ary tree, and can you provide code for its BFS traversal?
Ans. 

Data structure and code for BFS of N-ary tree

  • N-ary tree can be represented using a node class with a list of child nodes

  • BFS can be implemented using a queue data structure

  • Iterate through the queue and add child nodes to the queue

  • Pop the node from the queue and process it

  • Repeat until the queue is empty

Are these interview questions helpful?
A Software Developer was asked
Q. Write the code to find the inorder successor of a given node in a binary tree.
Ans. 

Code to find inorder successor of given node in binary tree

  • Check if the given node has a right subtree, if yes then find the leftmost node in the right subtree

  • If the given node does not have a right subtree, then traverse up the tree until we reach a node which is the left child of its parent

  • If we reach the root and the given node is the rightmost node, then there is no inorder successor

A Software Developer was asked
Q. Given two sorted linked lists, merge them into a single sorted linked list. Write test cases for your solution.
Ans. 

Merging two sorted linked lists and writing test cases.

  • Create a new linked list to store the merged list

  • Compare the first nodes of both lists and add the smaller one to the new list

  • Repeat until one of the lists is empty, then add the remaining nodes to the new list

  • Write test cases to cover all possible scenarios, including empty lists and lists of different lengths

A Software Developer was asked
Q. Given an infinite sequence of continuous natural numbers 1, 2, 3, 4, 5, 6, ..., initially you delete every 2nd element, so the sequence will be 1, 3, 5, 7, 9, 11, 13, .... Now, in the resultant sequence, yo...
Ans. 

Program to check if a given number is a lucky number or not.

  • Create a function that takes an integer n as input

  • Initialize a variable count to 2

  • Loop through the sequence and delete every count-th element

  • Repeat the above step until the end of the sequence

  • If n is present in the final sequence, return true, else return false

Microsoft Corporation Software Developer Interview Experiences

63 interviews found

Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Coding Test 

LeetCode , hard questions on dynamic programming, graphs, and more.

Round 2 - Coding Test 

DSA, Cn, os, DBMS, ML

Round 3 - One-on-one 

(2 Questions)

  • Q1. Is relocation a possibility for this position?
  • Q2. Senior role is there
Interview experience
5
Excellent
Difficulty level
Hard
Process Duration
4-6 weeks
Result
Selected Selected

I applied via LinkedIn and was interviewed in Jul 2024. There were 3 interview rounds.

Round 1 - Coding Test 

It was bsed on DP, Trees and Graphs

Round 2 - Technical 

(2 Questions)

  • Q1. DSA based question
  • Q2. Code optimization problem with reduced time complexity
  • Ans. 

    Optimizing code for reduced time complexity by using efficient algorithms and data structures.

    • Use efficient data structures like hash tables, binary search trees, or priority queues.

    • Avoid nested loops and try to reduce the number of iterations.

    • Utilize dynamic programming or memoization to store and reuse intermediate results.

    • Consider using bitwise operations for certain calculations.

    • Optimize recursive functions by elim...

  • Answered by AI
Round 3 - One-on-one 

(2 Questions)

  • Q1. Questions about projects
  • Q2. Topics like dbms, os, cn

Interview Preparation Tips

Interview preparation tips for other job seekers - Study core topics and do hard level problems on leetcode

Skills evaluated in this interview

Interview experience
4
Good
Difficulty level
Hard
Process Duration
Less than 2 weeks
Result
Selected Selected

I appeared for an interview in Feb 2025, where I was asked the following questions.

  • Q1. Tell me about yourself.
  • Q2. Hello world this is just a mandatory question to put in this dont take this seriously

Interview Preparation Tips

Interview preparation tips for other job seekers - nothing this is just for accessing the ambitionbox website dont take it seriously guys

Software Developer Interview Questions & Answers

user image Tarun Jaiswal

posted on 30 Nov 2024

Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Coding Test 

DSA, Graph, DP, Arrays

Interview experience
4
Good
Difficulty level
Moderate
Process Duration
2-4 weeks
Result
Not Selected

I applied via Referral and was interviewed in Apr 2024. There were 4 interview rounds.

Round 1 - Coding Test 

OA Test with 2 medium level questions

Round 2 - Technical 

(2 Questions)

  • Q1. Similar to kth largest element in array
  • Ans. 

    Find the kth largest element in an array of integers using efficient algorithms.

    • Use a max-heap to extract the largest elements efficiently. Example: For array [3, 2, 1, 5, 6, 4] and k=2, return 5.

    • Alternatively, use quickselect algorithm for average O(n) time complexity. Example: In the same array, quickselect can find the 2nd largest.

    • Sorting the array and accessing the kth largest directly is simple but O(n log n). Exa...

  • Answered by AI
  • Q2. Similar to no. of islands of leetcode
  • Ans. 

    Count distinct islands in a grid of '1's (land) and '0's (water) using DFS or BFS.

    • Use Depth-First Search (DFS) or Breadth-First Search (BFS) to explore the grid.

    • Mark visited land cells to avoid counting them multiple times.

    • Each time you start a new DFS/BFS from an unvisited land cell, increment the island count.

    • Example: For grid [['1', '1', '0'], ['0', '1', '0'], ['0', '0', '1']], there are 2 islands.

  • Answered by AI
Round 3 - Technical 

(1 Question)

  • Q1. Machine Coding Round on your domain
Round 4 - HR 

(1 Question)

  • Q1. General HR questions were asked
Interview experience
5
Excellent
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
Not Selected

I applied via Referral and was interviewed in Apr 2024. There were 2 interview rounds.

Round 1 - Coding Test 

2 problem related to graphs and dynamic programming 45min I was given to solve I was able to solve both of them and got shortlisted for the next round.

Round 2 - Technical 

(1 Question)

  • Q1. Started with Basic introduction about myself and my experiences then moved directly to a problem from leetcode based on hashing + sliding window I was able to provide the solution.

Interview Preparation Tips

Interview preparation tips for other job seekers - Prepare well for Data structures and algorithms prepare well for you role and responsibility .

Software Developer Interview Questions & Answers

user image Pranav Chaudhary

posted on 28 Nov 2024

Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - HR 

(1 Question)

  • Q1. Why should we hire you
  • Ans. 

    I have a strong technical background, excellent problem-solving skills, and a passion for software development.

    • I have a Bachelor's degree in Computer Science and 5 years of experience in software development.

    • I have successfully completed multiple projects using various programming languages such as Java, Python, and JavaScript.

    • I am a quick learner and always eager to expand my knowledge and skills in the field of softw...

  • Answered by AI

Software Developer Interview Questions & Answers

user image Shubham Singh

posted on 23 Sep 2024

Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-

I applied via Campus Placement and was interviewed in Aug 2024. There was 1 interview round.

Round 1 - HR 

(2 Questions)

  • Q1. Tell me about yourself
  • Ans. 

    I am a passionate software developer with experience in Java, Python, and web development.

    • Experienced in Java, Python, and web development technologies

    • Strong problem-solving skills

    • Team player with excellent communication skills

  • Answered by AI
  • Q2. About dsa and opps

Interview Preparation Tips

Interview preparation tips for other job seekers - good preparation of dsa
Interview experience
4
Good
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Coding Test 

1 hr wide varitey of question

Round 2 - Technical 

(1 Question)

  • Q1. Tell me about graph
  • Ans. 

    A graph is a data structure that consists of nodes (vertices) connected by edges.

    • Nodes represent entities and edges represent relationships between entities

    • Graphs can be directed or undirected

    • Common graph algorithms include depth-first search and breadth-first search

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - be prepared

Skills evaluated in this interview

Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Resume Shortlist 
Pro Tip by AmbitionBox:
Keep your resume crisp and to the point. A recruiter looks at your resume for an average of 6 seconds, make sure to leave the best impression.
View all tips
Round 2 - Coding Test 

2 easy level machine coding round.

Round 3 - One-on-one 

(1 Question)

  • Q1. 2 coding questions, one dp and another linked list.
Round 4 - One-on-one 

(1 Question)

  • Q1. 1 coding question on graph
Round 5 - One-on-one 

(1 Question)

  • Q1. Design question. Design a logger.
  • Ans. 

    A logger captures and stores application events for debugging and monitoring purposes.

    • Log Levels: Define levels like DEBUG, INFO, WARN, ERROR, and FATAL for categorizing logs.

    • Output Formats: Support multiple formats (e.g., JSON, plain text) for flexibility.

    • Log Rotation: Implement log rotation to manage file sizes and prevent disk overflow.

    • Asynchronous Logging: Use asynchronous methods to avoid blocking application perf...

  • Answered by AI
Round 6 - Technical 

(1 Question)

  • Q1. Techno managerial round.

Microsoft Corporation Interview FAQs

How many rounds are there in Microsoft Corporation Software Developer interview?
Microsoft Corporation interview process usually has 2-3 rounds. The most common rounds in the Microsoft Corporation interview process are Coding Test, One-on-one Round and Technical.
How to prepare for Microsoft Corporation Software Developer interview?
Go through your CV in detail and study all the technologies mentioned in your CV. Prepare at least two technologies or languages in depth if you are appearing for a technical interview at Microsoft Corporation. The most common topics and skills that interviewers at Microsoft Corporation expect are AWS, Cloud, Compliance, Computer science and Infrastructure.
What are the top questions asked in Microsoft Corporation Software Developer interview?

Some of the top questions asked at the Microsoft Corporation Software Developer interview -

  1. A file or a directory can be represented as a node. The node has properties lik...read more
  2. You are given infinite sequence of continuos natural numbers-1,2,3,4,5,6.........read more
  3. Which of the following numbers cannot be represented accurately in > binary? > ...read more
How long is the Microsoft Corporation Software Developer interview process?

The duration of Microsoft Corporation Software Developer interview process can vary, but typically it takes about less than 2 weeks to complete.

Tell us how to improve this page.

Overall Interview Experience Rating

4.4/5

based on 30 interview experiences

Difficulty level

Easy 14%
Moderate 50%
Hard 36%

Duration

Less than 2 weeks 71%
2-4 weeks 21%
4-6 weeks 7%
View more
Microsoft Corporation Software Developer Salary
based on 1.1k salaries
₹23.9 L/yr - ₹40 L/yr
219% more than the average Software Developer Salary in India
View more details

Microsoft Corporation Software Developer Reviews and Ratings

based on 92 reviews

4.2/5

Rating in categories

4.1

Skill development

4.3

Work-life balance

4.1

Salary

4.1

Job security

4.2

Company culture

3.9

Promotions

3.9

Work satisfaction

Explore 92 Reviews and Ratings
Software Engineer
2.5k salaries
unlock blur

₹24.9 L/yr - ₹44 L/yr

Senior Software Engineer
1.4k salaries
unlock blur

₹37.5 L/yr - ₹75.7 L/yr

Software Engineer2
1.2k salaries
unlock blur

₹33 L/yr - ₹60 L/yr

Software Developer
1.1k salaries
unlock blur

₹23.9 L/yr - ₹40 L/yr

Support Engineer
608 salaries
unlock blur

₹14.4 L/yr - ₹24.7 L/yr

Explore more salaries
Compare Microsoft Corporation with

Google

4.4
Compare

Amazon

4.0
Compare

Deloitte

3.7
Compare

TCS

3.6
Compare
write
Share an Interview