Add office photos
Microsoft Corporation logo
Employer?
Claim Account for FREE

Microsoft Corporation

4.0
based on 1.7k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Software Engineer
Fresher
Experienced
Skills
Clear (2)

10+ Microsoft Corporation Software Engineer Interview Questions and Answers for Freshers

Updated 16 Dec 2024

Q1. 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 we are...

read more
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.

Add your answer
right arrow

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

Add your answer
right arrow

Q3. 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

Add your answer
right arrow

Q4. 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 child 2, right child 3, and N=3. Output: [1,2], [1,3].

Add your answer
right arrow
Discover Microsoft Corporation interview dos and don'ts from real experiences

Q5. 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

Add your answer
right arrow

Q6. 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.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Variation of aggressive cows problem (requires binary search)

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.

Add your answer
right arrow

Q8. 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

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. variation of 2 sum problem

Ans.

Find two numbers in an array that add up to a target sum.

  • Use a hash map to store the difference between the target sum and each element.

  • Iterate through the array and check if the current element's complement exists in the hash map.

  • Return the indices of the two numbers that add up to the target sum.

Add your answer
right arrow

Q10. 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

Add your answer
right arrow

Q11. design 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

Add your answer
right arrow

Q12. 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.

Add your answer
right arrow

More about working at Microsoft Corporation

Back
Awards Leaf
AmbitionBox Logo
Top Rated Internet/Product Company - 2024
Awards Leaf
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Microsoft Corporation Software Engineer for Freshers

based on 3 interviews
2 Interview rounds
Technical Round - 1
Technical Round - 2
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

Info Edge Logo
3.9
 • 50 Interview Questions
View all
Recently Viewed
SALARIES
Automatic Data Processing (ADP)
SALARIES
Automatic Data Processing (ADP)
SALARIES
Automatic Data Processing (ADP)
SALARIES
Oracle Financial Services Software
INTERVIEWS
Microsoft Corporation
100 top interview questions
INTERVIEWS
St.Joseph's Institute Of Technology
No Interviews
SALARIES
Automatic Data Processing (ADP)
INTERVIEWS
Sutherland Global Services
No Interviews
LIST OF COMPANIES
Discover companies
Find best workplace
LIST OF COMPANIES
Discover companies
Find best workplace
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter