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 a binary tree where the weight of a node equals the node's data multiplied by its level (root level is 1), find the node with the maximum weight.
Ans. 

Find node with maximum weight in a binary tree based on data and level of node

  • Calculate weight of each node based on data and level

  • Traverse the binary tree and keep track of node with maximum weight

  • Return the node with maximum weight

A Software Developer was asked
Q. How will you avoid a race condition on shared memory?
Ans. 

Use synchronization techniques like locks, semaphores, or mutexes to prevent multiple processes from accessing shared memory simultaneously.

  • Implementing a locking mechanism to ensure only one process can access the shared memory at a time.

  • Using semaphores to control access to the shared memory.

  • Using mutexes to ensure mutual exclusion and prevent race conditions.

  • Using atomic operations to ensure that memory operati...

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
🔥 Asked by recruiter 2 times
A Software Developer was asked
Q. Given two singly linked lists, determine if the two lists intersect. Return the intersecting node. Note that the intersection is defined based on reference, not value. That is, if the kth node of the first ...
Ans. 

Find the intersection point of two linked lists.

  • Traverse both lists and find their lengths.

  • Move the head of the longer list to make both lists equal in length.

  • Traverse both lists in parallel until the intersection point is found.

A Software Developer was asked
Q. If you have design offline browser and what will be challenges that you will face
Ans. 

Designing an offline browser poses challenges such as data storage, synchronization, and user experience.

  • Ensuring efficient data storage and retrieval

  • Implementing synchronization with online content

  • Providing a seamless user experience with limited connectivity

  • Handling updates and changes to online content

  • Managing cache and memory usage

  • Dealing with security concerns

  • Handling different file types and formats

What people are saying about Microsoft Corporation

View All
a senior analyst
2d
Microsoft Assessment coming up—any prep tips?
Hey everyone, I have a Microsoft Assessment coming up. If you have any insights or advice on how to prepare, please share!
Got a question about Microsoft Corporation?
Ask anonymously on communities.
A Software Developer was asked
Q. Suppose there are two processes P0 and P1 that want to write to shared memory. While writing, they should have an exclusive lock on the memory, and P0 should be the first to write. Write C code using semaph...
Ans. 

C code using semaphores to ensure exclusive access to shared memory for two processes.

  • Use a semaphore to control access to shared memory.

  • Initialize the semaphore to 1 to allow one process at a time.

  • P0 should wait on the semaphore before writing to memory.

  • P1 should also wait on the semaphore but will be blocked until P0 releases it.

  • After P0 finishes writing, it should signal the semaphore to allow P1 to proceed.

🔥 Asked by recruiter 2 times
A Software Developer was asked
Q. Write a program to count the number of repeated occurrences of a substring within a given string.
Ans. 

Count the number of times a substring appears in a string.

  • Use a loop to iterate through the string and check for the substring at each index.

  • Use the count() method to count the number of occurrences of the substring.

  • Consider using regular expressions to find all occurrences of the substring.

  • Handle edge cases such as empty strings or substrings.

A Software Developer was asked
Q. How can you efficiently calculate the nth power of a number?
Ans. 

Use exponentiation by squaring algorithm to find nth power of a number in shortest computational time.

  • Use recursion to divide the power by 2 and multiply the base accordingly

  • If power is odd, multiply the base with the result of recursive call

  • If power is negative, take reciprocal of base and make power positive

  • Handle edge cases like power=0 and base=0 or 1

  • Time complexity is O(log n)

Are these interview questions helpful?
A Software Developer was asked
Q. Given a binary tree, find the nth largest number in it.
Ans. 

Find the nth largest number in a binary tree

  • Traverse the tree in-order and store the values in an array

  • Return the (n-1)th index of the sorted array in descending order

  • Use a max heap to keep track of the largest n elements

A Software Developer was asked
Q. Given a string like 'aabbbccc', compress it to 'a2b3c3'. For example, 'aabcc' should become 'a2bc2' and not 'a2b1c2'. Write pseudocode, then C++ code, optimize it, and handle all test cases.
Ans. 

Compress a string by replacing consecutive characters with their count.

  • Iterate through the string and count consecutive characters.

  • Append the character and its count to a new string.

  • Handle edge cases like single characters.

A Software Developer was asked
Q. Two numbers are stored in two linked lists, with one digit in each node. Add the numbers and return the resultant sum in a linked list. For example, if LL1= 2 -> 3 -> 5, LL2= 1 -> 4 -> 5, the re...
Ans. 

Add two numbers stored in linked lists and return the sum in a linked list.

  • Traverse both linked lists and add the digits at each node while keeping track of carry.

  • Create a new linked list to store the sum digits.

  • Handle cases where one linked list is longer than the other.

  • Handle cases where the sum of the last digits results in a carry.

  • Return the new linked list with the sum digits.

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
₹15 L/yr - ₹52.7 L/yr
246% more than the average Software Developer Salary in India
View more details

Microsoft Corporation Software Developer Reviews and Ratings

based on 92 reviews

4.3/5

Rating in categories

4.1

Skill development

4.4

Work-life balance

4.0

Salary

4.1

Job security

4.2

Company culture

3.8

Promotions

3.9

Work satisfaction

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

₹15 L/yr - ₹54 L/yr

Senior Software Engineer
1.4k salaries
unlock blur

₹24.8 L/yr - ₹95 L/yr

Software Engineer2
1.2k salaries
unlock blur

₹22 L/yr - ₹72 L/yr

Software Developer
1.1k salaries
unlock blur

₹15 L/yr - ₹52.7 L/yr

Support Engineer
615 salaries
unlock blur

₹9 L/yr - ₹32 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