Add office photos
Employer?
Claim Account for FREE

Microsoft Corporation

4.1
based on 1.6k Reviews
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

10+ Interview Questions and Answers

Updated 26 Sep 2024
Popular Designations

Q1. Reverse the order of words in a given sentence(an array of characters)

Ans.

To reverse the order of words in a given sentence, we need to split the sentence into words and then reverse the order of the resulting array.

  • Split the sentence into words using a delimiter like space or comma

  • Reverse the resulting array of words

  • Join the reversed array of words using a delimiter to form the reversed sentence

Add your answer

Q2. How are you fetching data through api in your project.And how machine learning is working in your project

Ans.

Data is fetched through RESTful APIs using Python requests library. Machine learning is used for predictive analysis.

  • API data is retrieved using HTTP GET requests

  • Python requests library is used to handle API requests and responses

  • Data is parsed using JSON library

  • Machine learning models are trained on historical data to predict future outcomes

  • Scikit-learn library is used for machine learning tasks

Add your answer

Q3. Given N people of an M*M grid, find the point that requires the least total distance by all people to meet at that point.

Ans.

Given N people on an M*M grid, find the point with the least total distance for all to meet.

  • Calculate the Manhattan distance for each point on the grid

  • Find the point with the minimum total distance

  • Use dynamic programming to optimize the solution

  • Consider edge cases such as when N=1 or M=1

Add your answer

Q4. remove duplicates in unsorted linked list

Ans.

Remove duplicates in unsorted linked list

  • Create a hash table to keep track of visited nodes

  • Traverse the linked list and check if the node is already visited

  • If visited, remove the node from the linked list

  • Time complexity: O(n)

  • Example: 1 -> 2 -> 3 -> 2 -> 4 -> 1 -> null

  • Output: 1 -> 2 -> 3 -> 4 -> null

Add your answer
Discover null interview dos and don'ts from real experiences

Q5. Number of islands problem

Ans.

The number of islands problem involves counting the number of connected islands in a grid.

  • An island is a group of connected 1s in a grid of 0s and 1s.

  • Use depth-first search or breadth-first search to traverse the grid and count the islands.

  • Keep track of visited cells to avoid counting the same island multiple times.

View 1 answer

Q6. find intersection point of two linked list

Ans.

Find intersection point of two linked lists.

  • Traverse both lists and find their lengths

  • Move the head of the longer list by the difference in lengths

  • Traverse both lists in parallel until they meet at the intersection point

Add your answer
Are these interview questions helpful?

Q7. Given a target and a binary tree, return true if there is a path to target

Ans.

Check if there is a path in a binary tree to a given target

  • Start from the root node and traverse the tree using depth-first search (DFS)

  • Keep track of the current path sum and compare it with the target value

  • Return true if a path with the target sum is found, otherwise return false

Add your answer

Q8. Scope resolution program

Ans.

Scope resolution program is used to determine the scope of a variable in a program.

  • It helps in identifying the location of a variable in a program

  • It helps in avoiding naming conflicts between variables

  • It can be done using the dot operator or the arrow operator in object-oriented programming

  • It can also be done using the scope resolution operator (::) in C++

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Delete a node from Singly and doubly linked list

Ans.

To delete a node from a singly or doubly linked list, update the pointers of the previous and next nodes.

  • For a singly linked list, update the next pointer of the previous node to skip the node to be deleted.

  • For a doubly linked list, update the next pointer of the previous node and the previous pointer of the next node to skip the node to be deleted.

Add your answer

Q10. find the depth of the tree

Ans.

The depth of a tree is the length of the longest path from the root node to a leaf node.

  • The depth of a tree can be calculated by traversing the tree and keeping track of the depth at each node.

  • The depth of a tree with only one node (the root) is 0.

  • For example, in a binary tree, the depth of the tree is the maximum depth of the left and right subtrees plus 1.

Add your answer

Q11. validate an email using regex pattern

Ans.

Use regex pattern to validate an email address

  • Use regex pattern /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/

  • Ensure email has valid format with username, @ symbol, domain, and top-level domain

  • Test regex pattern against different email addresses for validation

Add your answer

Q12. BFS implementation on a tree

Ans.

BFS (Breadth First Search) is a traversal algorithm used to visit all nodes of a tree level by level.

  • Start by visiting the root node, then visit all its children before moving on to the next level

  • Use a queue data structure to keep track of nodes to visit next

  • Repeat the process until all nodes have been visited

Add your answer

Q13. Two sum Water tank problem

Ans.

Two sum problem involves finding two numbers in an array that add up to a specific target. Water tank problem involves calculating the amount of water that can be trapped between the bars.

  • For Two sum problem, use a hashmap to store the difference between the target and each element in the array. Check if the current element exists in the hashmap.

  • For Water tank problem, use two pointers approach to calculate the maximum water that can be trapped between the bars.

  • Example for Tw...read more

Add your answer

Q14. Square root of N

Ans.

The square root of a number N is a value that, when multiplied by itself, gives N.

  • The square root of 9 is 3, because 3 * 3 = 9

  • The square root of 16 is 4, because 4 * 4 = 16

  • The square root of 25 is 5, because 5 * 5 = 25

Add your answer

Q15. project on ai-ml

Ans.

AI-ML project involves using artificial intelligence and machine learning algorithms to analyze data and make predictions.

  • Collecting and cleaning data for training the AI model

  • Choosing the appropriate machine learning algorithm for the task

  • Evaluating the performance of the model using metrics like accuracy and precision

  • Implementing the model in a real-world application

  • Continuously improving the model through feedback and retraining

Add your answer

More about working at Microsoft Corporation

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

Interview Process at null

based on 9 interviews in the last 1 year
2 Interview rounds
Coding Test Round
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Intern Interview Questions from Similar Companies

3.8
 • 25 Interview Questions
3.9
 • 19 Interview Questions
4.0
 • 16 Interview Questions
3.8
 • 13 Interview Questions
4.3
 • 11 Interview Questions
4.4
 • 11 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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