Upload Button Icon Add office photos

Microsoft Corporation

Compare button icon Compare button icon Compare

Filter interviews by

Microsoft Corporation Software Engineer Interview Questions and Answers for Freshers

Updated 2 Jul 2025

12 Interview questions

A Software Engineer was asked 6mo ago
Q. Given an array of integers, find two numbers that add up to a specific target. Return the indices of the two numbers.
Ans. 

The variation of the 2-sum problem involves finding pairs in an array that meet specific criteria.

  • Identify the target sum and the array of numbers.

  • Use a hash map to store numbers and their indices for quick lookup.

  • Iterate through the array, checking if the complement (target - current number) exists in the hash map.

  • Example: For array [2, 7, 11, 15] and target 9, the pair (2, 7) sums to 9.

  • Consider edge cases like d...

A Software Engineer was asked 6mo ago
Q. Describe the process of designing a REST API.
Ans. 

Design a REST API for a software engineer interview

  • Define the resources and endpoints

  • Use HTTP methods for CRUD operations (GET, POST, PUT, DELETE)

  • Implement authentication and authorization

  • Use JSON for data exchange format

  • Include error handling and status codes

Software Engineer Interview Questions Asked at Other Companies for Fresher

asked in Capgemini
Q1. In a dark room, there is a box of 18 white and 5 black gloves. Yo ... read more
asked in Capgemini
Q2. How can you cut a rectangular cake in 8 symmetric pieces in three ... read more
Q3. Split Binary String Problem Statement Chintu has a long binary st ... read more
asked in TCS
Q4. What is the reason that the Iterative Waterfall model was introdu ... read more
asked in Wipro
Q5. Knapsack Problem Statement There is a potter with a limited amoun ... read more
A Software Engineer was asked 6mo ago
Q. There is a field of length L and there are N cows. You are given the positions of the cows along the field. You need to place the cows in such a way that the minimum distance between any two cows is maximiz...
Ans. 

Use binary search to find the minimum distance to escape aggressive cows in a field.

  • Implement a function to check if cows can be placed with a minimum distance in a field.

  • Use binary search to find the minimum distance that satisfies the condition.

  • Keep track of the maximum distance found so far while performing binary search.

A Software Engineer was asked
Q. Implement a stack using a linked list.
Ans. 

Implementing stack using linked list

  • Create a Node class with data and next pointer

  • Create a Stack class with top pointer

  • Implement push() method to add element to top of stack

  • Implement pop() method to remove element from top of stack

  • Implement peek() method to return top element without removing it

What people are saying about Microsoft Corporation

View All
a software developer
2d
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 Engineer was asked
Q. Implement a priority queue.
Ans. 

Priority queue is a data structure that stores elements with priority levels and retrieves them in order of priority.

  • Elements are added with a priority level and retrieved in order of priority

  • Can be implemented using a heap data structure

  • Operations include insert, delete, and peek

  • Can be used in algorithms such as Dijkstra's shortest path algorithm

A Software Engineer was asked
Q. Write a program to store a tree in a file. Also, write code to reconstruct the tree from that file. Consider efficient techniques.
Ans. 

Program to store and reconstruct a tree from a file with efficient techniques.

  • Use a recursive approach to traverse the tree and write each node to the file

  • Include information about the node's parent and children in the file

  • Use a unique identifier for each node to reconstruct the tree from the file

  • Use a data structure like a hash table to store the nodes and their identifiers for efficient reconstruction

A Software Engineer was asked
Q. Write the backend server code for a tic tac toe game
Ans. 

Backend server code for a tic tac toe game

  • Create a RESTful API using a framework like Express.js

  • Implement game logic to check for winning conditions

  • Use a database to store game state and user information

  • Handle user authentication and authorization

  • Implement real-time updates using WebSockets

Are these interview questions helpful?
A Software Engineer was asked
Q. You have a cuboid (m*n*p) where each block contains a metallic ball. X-rays are passed from the front face, resulting in a boolean matrix1 of size m*p, where elements are set if there is a black spot. Anoth...
Ans. 

Yes, it is possible to get the accurate result from the given data.

  • The coordinates (i,j,k) where metallic balls are present can be determined by finding the set elements in both matrix1 and matrix2.

  • Additional data is not required as the given data is sufficient to determine the coordinates.

  • The coordinates can be obtained by iterating through the elements of matrix1 and matrix2 and checking for set elements.

A Software Engineer was asked
Q. Given a binary tree with non-negative numbers and a number N, print all downward paths from any node having the sum of elements equal to N.
Ans. 

Print all downward paths from any node in a binary tree with sum of elements equal to N.

  • Traverse the binary tree and keep track of the sum of elements in the path from root to current node.

  • If the sum equals N, print the path from root to current node.

  • Recursively traverse the left and right subtrees with updated sum.

  • Use a stack to keep track of the current path being traversed.

  • Example: Binary tree with root 1, left...

A Software Engineer was asked
Q. Given a string of unknown length, what is a good approach to find the n-kth element from the end?
Ans. 

To find n-k th element from last in a string of unknown length

  • Traverse the string to find its length

  • Calculate the position of n-k th element from last

  • Traverse the string again to find the element at calculated position

Microsoft Corporation Software Engineer Interview Experiences for Freshers

8 interviews found

Interview experience
3
Average
Difficulty level
Moderate
Process Duration
-
Result
No response

I appeared for an interview in Jun 2024.

Round 1 - Technical 

(2 Questions)

  • Q1. Variation of aggressive cows problem (requires binary search)
  • Q2. Variation of 2 sum problem
Round 2 - One-on-one 

(2 Questions)

  • Q1. Was told that this round would be an LLD. But it felt more like HLD or technical HM round Questions: grilled on microservice vs monolith architectures, how to migrate to microservice, when to migrate to mi...
  • Q2. Design a rest API
Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Coding Test 

2 DSA qns on codility

Round 2 - Technical 

(2 Questions)

  • Q1. Cs fundamentals
  • Q2. DSA qn on graphs
  • Ans. 

    Graphs are data structures that consist of nodes and edges connecting them.

    • Graphs can be directed or undirected.

    • Common graph traversal algorithms include BFS and DFS.

    • Examples of graphs include social networks, road networks, and computer networks.

  • Answered by AI

Skills evaluated in this interview

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 

PRACTISE CODING properly..........

Round 3 - Technical 

(3 Questions)

  • Q1. BE TECH SAVY.............................
  • Q2. WHAT IS YOUR N
  • Q3. WHO ARE YOU?...........

Interview Preparation Tips

Interview preparation tips for other job seekers - JUST GIVE YOUR INTERVIEW PROPERLY.......................
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 - Technical 

(2 Questions)

  • Q1. Implement stack using linkedlist
  • Ans. 

    Implementing stack using linked list

    • Create a Node class with data and next pointer

    • Create a Stack class with top pointer

    • Implement push() method to add element to top of stack

    • Implement pop() method to remove element from top of stack

    • Implement peek() method to return top element without removing it

  • Answered by AI
  • Q2. Implement priority queue
  • Ans. 

    Priority queue is a data structure that stores elements with priority levels and retrieves them in order of priority.

    • Elements are added with a priority level and retrieved in order of priority

    • Can be implemented using a heap data structure

    • Operations include insert, delete, and peek

    • Can be used in algorithms such as Dijkstra's shortest path algorithm

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - prepare DSA well and also prepare for behavioral round

Skills evaluated in this interview

Interview experience
5
Excellent
Difficulty level
Hard
Process Duration
Less than 2 weeks
Result
Selected Selected

I applied via Approached by Company and was interviewed before Apr 2023. There were 2 interview rounds.

Round 1 - Coding Test 

Heavy Dsa was found minimum leetcode hard

Round 2 - Technical 

(1 Question)

  • Q1. Leeetcode medium questions

Interview Preparation Tips

Interview preparation tips for other job seekers - Leetcode practoce

Software Engineer Interview Questions & Answers

user image Mohd Azharuddin

posted on 15 Nov 2015

I applied via Campus Placement

Interview Questionnaire 

2 Questions

  • Q1. You have a Binary tree having numbers>=0 and a numeber N. Print all downwards paths from any node having the sum of elements equal to N
  • Ans. 

    Print all downward paths from any node in a binary tree with sum of elements equal to N.

    • Traverse the binary tree and keep track of the sum of elements in the path from root to current node.

    • If the sum equals N, print the path from root to current node.

    • Recursively traverse the left and right subtrees with updated sum.

    • Use a stack to keep track of the current path being traversed.

    • Example: Binary tree with root 1, left chil...

  • Answered by AI
  • Q2. You have a cuboid (m*n*p) each block of the cuboid is having a metallic ball. Now we are passing X-ray from front face and getting a bool matrix1 of m*p the elements are set if there is a black spot.(as...
  • Ans. 

    Yes, it is possible to get the accurate result from the given data.

    • The coordinates (i,j,k) where metallic balls are present can be determined by finding the set elements in both matrix1 and matrix2.

    • Additional data is not required as the given data is sufficient to determine the coordinates.

    • The coordinates can be obtained by iterating through the elements of matrix1 and matrix2 and checking for set elements.

  • Answered by AI

Interview Preparation Tips

Round: Test
Experience: Output questions
Tips: focus on basics
Duration: 30 minutes
Total Questions: 15

Round: Test
Experience: Two coding problems in one hour,on Cocobues.com

1. Given two arrays of numbers. The numbers are from 0-9 you have two maximize the first array by using the elements from the second array.
the elements can be used only once.
e.g. arr1[]={5,2,3,6,7};
arr2[]={9,2,8,4,5};
You should output the modified arr1 as {9,8,5,6,7}

2.Given a matrix of characters and a word.
you have to count the number of occurences of that word in that matrix. you can move to any of the eight valid directions from current position.
e.g. word="HELLO";
matrix[][5]={ {'H','E','L','L','O'},
{'E','H','E','A','B'},
{'L','L','O','C','D'}};
output should be : 5

Tips: DO AS MUCH AS PRACTICE
Duration: 60 minutes
Total Questions: 2

Round: Test
Experience: One Coding question was given to all the students ,You have to code and explain it.
You are given an string as input which represents a path. You have to normalize that path inplace(NO EXTRA SPACE).
e.g.
input : "\a\b\c\..\..\file.txt"
output: "\a\file.txt"
Hint: Double dot(..) means you have to skip the previous parent.
It was on paper.
Duration: 40 minutes
Total Questions: 1

Round: Technical Interview
Experience: The interviewer was very nice that was an amazing experience.
Tips: Be confident and relaxed.

Round: HR Interview
Experience: Again the interviewer was very nice. Firstly he asked me what i have done in technical till that time.
After the interview was over he looks impressed.
Tips: Don't see what others are doing . Take your time and try to short out the correct solution.

General Tips: Do coding as much as you can
Skills: Algorithm, Coding Skills And Knowledge On Data Structures
Duration: 2
College Name: NIT Bhopal
Motivation: It comes to our institute, and the name Microsoft is sufficient for motivation.
Funny Moments: The journey to Microsoft IDC Hydrabad was very beautiful.

Skills evaluated in this interview

Software Engineer Interview Questions & Answers

user image Mayank Bhura

posted on 15 Nov 2015

Interview Questionnaire 

2 Questions

  • Q1. Write the backend server code for a tic tac toe game
  • Ans. 

    Backend server code for a tic tac toe game

    • Create a RESTful API using a framework like Express.js

    • Implement game logic to check for winning conditions

    • Use a database to store game state and user information

    • Handle user authentication and authorization

    • Implement real-time updates using WebSockets

  • Answered by AI
  • Q2. Write a program to store a tree on a file. Also write code to reconstruct the tree from that file. Think of efficient techniques
  • Ans. 

    Program to store and reconstruct a tree from a file with efficient techniques.

    • Use a recursive approach to traverse the tree and write each node to the file

    • Include information about the node's parent and children in the file

    • Use a unique identifier for each node to reconstruct the tree from the file

    • Use a data structure like a hash table to store the nodes and their identifiers for efficient reconstruction

  • Answered by AI

Interview Preparation Tips

Round: Test
Experience: All types of C/C++ Aptitude and I/O questions were asked.
Was not a very easy round.
Tips: Prepare from -----/ and -----/
I had done everything in these 2 links.
Other than that, you can prepare from "Test your C Skills" by Yeshwant Kanetkar. PDF available online.
Duration: 30 minutes
Total Questions: 40-50

Round: Test
Experience: Two coding questions were asked. It was hosted on CoCubes website.
Questions were pretty basic.
First one was ad-hoc, requiring to count the number of set bits of a number.
Second one was the standard, minimum cost path DP problem.
Tips: Prepare from geeksforgeeks, careercup and ambitionbox.
If you know competitive programming, you should not have much of a problem.
Duration: 90 minutes
Total Questions: 2

Round: Test
Experience: Had to write code on paper. 2 questions.
First one was to rotate a matrix by 90 degrees. Pretty standard question.
Second one was to remove all negative elements in an array to the right end. Do it without extra memory.
Tips: Apart from correctness of solution, they check for code quality. Code written must be clean, indented and with properly named variables and functions.
Keep communicating your ideas to the people who will be supervising the test. They will understand your thought process that way.
Duration: 60 minutes
Total Questions: 2

Round: Technical Interview
Experience: Wrote the class in JAVA. Explained the methods, and optimized them. Variables were named properly.
Also generalized the class for an nxn matrix tic-tac-toe game.
Interviewer was very friendly. Wrote the code on paper.
Tips: Prepare on class design beforehand. They are quite likely to ask you questions on OOP.
Write clean code.

Round: Technical Interview
Experience: Just had to write the functions. Wrote code in C++.
The interviewer tested me on edge cases. Asked me to prepare test cases.
Tips: Make sure your code is ready to tackle those dirty edge cases.
Knowing standard library functions is beneficial. Make sure you learn some important ones. They can come in handy.
Write clean code. You can choose any language you are comfortable in.

General Tips: Stay calm. Prepare well.
Focus on the data structures that Microsoft usually asks about.
Skill Tips: A good internship helps in the process. I had interned at Google, so I got selected relatively easily as compared to other candidates. Make sure your resume is as impressive as you can make it.
Stay calm in the rounds. That way you can think better.
Communicate with the company officials. They will know you and your thought process that way.
Don't stay quiet in the interview rounds. If you have doubts, ask them. I had made this mistake when they came for internships and did not get selected because I didn't clear my doubts. The interview should be ideally like a discussion, where you present your thoughts and ideas, clear your doubts, and come up with a solution.
Skills: Resume, Communication, Analytical Skills, Algorithmic Approach To Problem Solving, Coding Skills And Knowledge On Data Structures
College Name: NIT Surathkal
Motivation: It is one of the biggest tech giants in the world. I definitely wanted to be a part of it.
Funny Moments: Since I had only 2 interviews, while others had 5, I came out so early that they thought I was rejected.
They later discovered, they were wrong.

Skills evaluated in this interview

I applied via Campus Placement

Interview Questionnaire 

2 Questions

  • Q1. Given a string of unknown length, what is a good approach to find n-k th element from last
  • Ans. 

    To find n-k th element from last in a string of unknown length

    • Traverse the string to find its length

    • Calculate the position of n-k th element from last

    • Traverse the string again to find the element at calculated position

  • Answered by AI
  • Q2. Given an array of strings, count the number of unique occurrences
  • Ans. 

    Count the number of unique occurrences in an array of strings.

    • Create a hash table to store the count of each string occurrence.

    • Iterate through the array and update the count in the hash table.

    • Count the number of unique occurrences by counting the number of keys in the hash table.

  • Answered by AI

Interview Preparation Tips

Round: Resume Shortlist
Experience: They checked my CGPA and my projects worked on. They also looked at previous internship I have done
Tips: Focus on CGPA and projects done. Also mention internship experience.

Round: Test
Experience: Easier questions and good amount of time to think.
Tips: Careful with IDE.
Duration: 60min minutes
Total Questions: 2

Round: Group Discussion
Experience: Enough time to think,solve. Questions were easy and only tested basic understanding of ds and algos.
Tips: Think well. They do not expect complete optimal solution. Discuss your ideas with members there

Round: Technical Interview
Tips: They do not expect optimal solution. they want to know thought process

General Tips: Be thorough in course work being done at present.
Revise the projects you have done in your semester
Skills: Data Structures, Algorithms, Probability theory, Basics of Machine Learning
Duration: 2 months
College Name: IIT Madras
Motivation: Microsoft !

Skills evaluated in this interview

Interview questions from similar companies

I applied via Monster and was interviewed before Apr 2020. There was 1 interview round.

Interview Questionnaire 

1 Question

  • Q1. Basic java

Interview Preparation Tips

Interview preparation tips for other job seekers - Be prepared

Software Engineer Interview Questions & Answers

Adobe user image Devendra Bendkhale

posted on 4 Dec 2015

Interview Questionnaire 

8 Questions

  • Q1. WRITE A GENERIC SWAP FUNCTION
  • Ans. 

    A generic swap function swaps two values of any data type.

    • The function should take two parameters of any data type.

    • Use a temporary variable to store the value of one parameter.

    • Assign the value of the second parameter to the first parameter.

    • Assign the value of the temporary variable to the second parameter.

  • Answered by AI
  • Q2. SEARCH AN ELEMENT IN ROTATED SORTED LINKLIST .
  • Ans. 

    Search for an element in a rotated sorted linked list.

    • Find the pivot point where the list is rotated.

    • Divide the list into two sublists based on the pivot point.

    • Perform binary search on the appropriate sublist.

    • Handle edge cases such as empty list and list with only one element.

  • Answered by AI
  • Q3. SEARCH AN ELEMENT IN ROTATED SORTED ARRAY. WRITED A CODE FOR IT
  • Ans. 

    Search an element in a rotated sorted array

    • Find the pivot point where the array is rotated

    • Divide the array into two sub-arrays based on pivot point

    • Perform binary search on the appropriate sub-array

    • Repeat until element is found or sub-array size is 1

  • Answered by AI
  • Q4. In an Array of size 95 contain numbers in range 1 to 100. each number is at max once in the array. find the 5 missing numbers in array between 1-100
  • Q5. Given sudoku as id array of size . in a given empty cell find the possible numbers that could be possible. Asked me to write code for it
  • Ans. 

    Given a Sudoku board, find possible numbers for an empty cell.

    • Iterate through empty cells and check possible numbers using row, column, and box constraints.

    • Use a set to keep track of possible numbers for each empty cell.

    • Return the set of possible numbers for the given empty cell.

  • Answered by AI
  • Q6. Given 4 unsigned integers find their integer average (eg. (2,2,2,3) => (2+2+2+3)/4 = 2) consider integer division ) without typecasting
  • Ans. 

    Find integer average of 4 unsigned integers without typecasting

    • Add all the integers and divide by 4

    • Use bit shifting to divide by 4

    • Handle overflow by using long long data type

    • Use unsigned int data type for input

  • Answered by AI
  • Q7. Write a code to identify wheter given processor is of 32 bit architecture or 64 bit architecture
  • Ans. 

    Code to identify 32 bit or 64 bit architecture of a processor

    • Check if the operating system is 32 bit or 64 bit

    • If OS is 32 bit, processor is 32 bit

    • If OS is 64 bit, check if processor supports 64 bit architecture

    • Use CPUID instruction to check if processor supports 64 bit architecture

  • Answered by AI
  • Q8. Convert a binary number into base 64 integer
  • Ans. 

    Convert binary number to base 64 integer

    • Divide the binary number into groups of 6 bits

    • Convert each group of 6 bits to decimal

    • Map the decimal value to the corresponding base 64 character

    • Concatenate the base 64 characters to form the final integer

  • Answered by AI

Interview Preparation Tips

Round: Test
Experience: SIMPLE CODING QUESTIONS SPEED MATTERS.
Duration: 60 minutes
Total Questions: 3

Skills: Analytics And Coding
College Name: IIT Guwahati

Skills evaluated in this interview

Microsoft Corporation Interview FAQs

How many rounds are there in Microsoft Corporation Software Engineer interview for freshers?
Microsoft Corporation interview process for freshers usually has 2-3 rounds. The most common rounds in the Microsoft Corporation interview process for freshers are Technical, Coding Test and Resume Shortlist.
How to prepare for Microsoft Corporation Software Engineer interview for freshers?
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 Computer science, Data Structures, Design Development, Internship and Product Quality.
What are the top questions asked in Microsoft Corporation Software Engineer interview for freshers?

Some of the top questions asked at the Microsoft Corporation Software Engineer interview for freshers -

  1. You have a cuboid (m*n*p) each block of the cuboid is having a metallic ball. ...read more
  2. Write a program to store a tree on a file. Also write code to reconstruct the t...read more
  3. Given a string of unknown length, what is a good approach to find n-k th elemen...read more
How long is the Microsoft Corporation Software Engineer interview process?

The duration of Microsoft Corporation Software Engineer 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.3/5

based on 3 interview experiences

Difficulty level

Moderate 50%
Hard 50%

Duration

Less than 2 weeks 100%
View more
Microsoft Corporation Software Engineer Salary
based on 2.5k salaries
₹24.9 L/yr - ₹44.5 L/yr
270% more than the average Software Engineer Salary in India
View more details

Microsoft Corporation Software Engineer Reviews and Ratings

based on 147 reviews

4.2/5

Rating in categories

3.7

Skill development

4.3

Work-life balance

3.7

Salary

3.9

Job security

4.2

Company culture

3.4

Promotions

3.7

Work satisfaction

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

₹24.9 L/yr - ₹44.2 L/yr

Senior Software Engineer
1.4k salaries
unlock blur

₹34.8 L/yr - ₹73.5 L/yr

Software Engineer2
1.2k salaries
unlock blur

₹33 L/yr - ₹60 L/yr

Software Developer
1.1k salaries
unlock blur

₹24.7 L/yr - ₹45 L/yr

Support Engineer
607 salaries
unlock blur

₹14.4 L/yr - ₹24.5 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