Microsoft Office India Interview experience | Set 170 (2 Years Exp)
Round 1:
Validate an infix arithmetic expression string (braces and brackets are similar to parentheses): (1+2)*{[90*3]-[67+8-9]}
Proposed Ans: Djikstra’s Shunting yard
Interviewer’s Ans: Parser Tree
Round 2:
Given a shelf of books, categorise those books according to any particular property of a book e.g. Alphabetic increasing author’s name, category, date of publish etc. The value of the property of the book has to be fetched from an external service and the call is expensive.
Constraints: O(1) space, the calls to get the priority of a book should be as minimized as possible.
Proposed Ans: Quick sort with a priority map associated with the property of the book, a modified partitioning scheme where every element’s priority is fetched once, total of nlogn calls.
Constraint variation: Minimum swaps.
Proposed Ans:
1. Selection sort with O(n^2) time and O(1) space. – n swaps
2. Bucket sort with O(n) space and time. – 0 swaps
Round 3:
Given a very long string and a transformation map, replace all the occurrences of any needle strings with their resultant transformations e.g.
input_string = “abcd;lt;qwer;gt;asd;” map = {";lt;" : "<", ";gt;" : ">"} transform(input_string, map) // should equal “abcd<qwer>asd;” |
Proposed Ans: Naive solution by processing character by character and replacing the suffix if it matches with any of the needles.
Recommended Posts:
- Interview with Microsoft (office 365 Hyderabad team) at their Bengaluru office.
- Microsoft Interview Experience (Full Time 2018 Washington DC - with 2.5 years of experience)
- Microsoft Interview experience for SDE-2 (5+ years)
- Microsoft Interview Experience | (SDE-2 for 3 Years Experienced)
- Microsoft Interview Experience | Set 111 (For 1.5 Years Experienced)
- Microsoft Interview Experience (3 years Experienced)
- Microsoft Interview Experience | Set 154 (For 1.5 Years Experienced)
- Microsoft interview experience: | Set 167 (7 Years Experienced)
- Microsoft Interview Experience | Set 109 (2 years experienced)
- Microsoft Interview experience | Set 115 (4 Years Experienced for IDC)
- Microsoft Interview Experience | Set 112 (For 4.5 Years Experienced)
- Microsoft interview Experience | Set 48 (For 1.5 Years Experienced)
- Microsoft IDC interview Experience | Set 47 (For 1.7 Years Experienced)
- Microsoft Interview Experience | Set 169 (SDE 2 for 3.5 years experience)
- Microsoft Interview Experience | Set 151 (SDE-2 3.5 years experience)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



