Below is my MS interview experience for SE2. It's fairly long as I attended 9 rounds altogether.
Interview 1
Round 1: OA round. Two coding questions. Easy-medium and medium questions. Solved them. One C# question of LLD type (no choice of other languages). Didn't solve as I wasn't able to come up with C# code in 10 to 15 minutes.
Selected for on-site.
Round 2: Ugly numbers 1 and 2. Funny, I never practiced them. So was able to solve Ugly Number 1 well. Ugly Number 2, I was able to come up only with O(NlogN) solution.
Round 3: Modified version of Basic Calculator type problem with O(1) space constraint. Again, I lacked extensive (and previous) practice. But I was able to convince interviewer of an O(1) approach. Started coding, stuck with string manipulations, interviewer was kind enough to implement a part by himself (!!) and made me implement another part.
Another question was on BST properties (Easy Medium). We discussed approach and no time to implement it.
I thought I wouldn't make it for next round. But luckily I was called to next round.
Round 4:
It was a sort of AA round. I was asked an easy medium string question. I implemented and tested it. Then I was asked about my experience in current role etc.
Then I was thrown a vague LLD statement about a use case in a system. I was answering it in general software design terms but interviewer said he was expecting answer in a specific technology and after sometime he admitted that it's impossible for me to answer as I had no experience in that technology.
Round 5:
45 minutes of pure behavioral questions with a group director. Amazon LP prep helped me a lot here.
I was happy that I made this far but was anxious of the result.
After 2 working days, recruiter called me and said that I will be referred to another role (that I had applied earlier) without talking anything about the interview result. Assumed that I was rejected.
Interview 2: This was after 2 to 3 weeks and no OA.
This time I solved a lot of additional questions and also prepared design by going through a popular course.
Round 1:
Min/max stack and a question on prefix/suffix sum. Solved them both
Round 2:
Maintain disjoint set in a stream of numbers.
Rule: Consecutive numbers should be combined as an interval.
Example: Input to an API.
1 → {1,1}
2 → {1,2}
4 → {1,2} , {4,4}
5 → {1,2}, {4,5}
Interesting question which I never solved before. Was able to come up only with Linked List approach. I coded and tested the solution.
There is a further optimized solution based on BST that I saw afterwards.
Second question: Easy medium question on arrays (two pointers)
Round 3:
HLD discussion on URL shortening. Thorough basics of all HLD components and trade-offs that might be required for this service was discussed. No focus on algorithm but just HLD part alone.
A fairly medium question based on sorting/STL-maps/Binary Search and time complexity was discussed.
After this I had HM round after 2 weeks.
Round 4: HM round
Two behavioral questions.
A very interesting LLD type question.
Task time out manager system. It has 2 APIs
RegisterTask(Task task) UnRegisterTask(Task task)
After registering for a task, if the task's UnRegister() API is not called within n seconds, our system should evict the task else its enough if we can evict the task on UnRegister() call.
How will you handle above APIs for a million calls assuming it's a single process?
I was able to implement this with Linked list and STL unordered map immediately for a single thread case. We dry run the code and it worked.
For handling million calls part: I was asked to use locks. I brainstormed why/how and where we need locks. Explained it but didn't add the code as I also brainstormed Java's CompletableFuture for this multi-threading case. HM said he understood the case.
Later that evening received a reject mail and no feedback.
PS: All the interviewers were kind and helpful. I had a good time. Won't mind if have to attend another 9 rounds (haha) as I am now inure to interview pressures.