Microsoft interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Microsoft
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
My journey started in my 3rd year when I began preparing seriously for off-campus opportunities. I practiced DSA using Striver’s sheet and built major projects in MERN, ML, and AI. My resume was shortlisted for Microsoft, and I cleared the online assessment by solving two coding problems. Soon after, I got the chance to appear for back-to-back interviews. In the first round, conducted by a senior manager, I introduced myself and solved the given DSA problems using optimized approaches. The second round was comparatively tougher, but I stayed calm, took hints when needed, and explained my thought process clearly. This entire experience taught me the importance of consistency, clarity, and confidence in problem-solving.
Application story
I applied for the Microsoft Off-Campus SDE Intern opportunity in March 2025 through the official careers portal, and my resume was subsequently shortlisted. I first received the OA link, which I cleared successfully. Soon after, I was invited to back-to-back interviews via call and email, with the schedule and links provided in advance.
Why selected/rejected for the role?
I believe I was rejected because my performance in the second interview round was not up to the mark. While I was able to solve problems confidently and explain my thought process in the first round, I struggled a bit with tougher questions in the second round and could not provide the most optimized solutions.
Preparation
Duration: 1 year
Topics: Data Structures (Arrays, Strings, Linked List, Stacks, Queues, Trees, Graphs, Tries), Dynamic Programming, OOP Concepts, System Design Basics, Machine Learning Fundamentals, Operating Systems, Logical Reasoning
Tip
Tip

Tip 1: Be consistent with DSA practice and focus on writing optimized solutions with attention to time complexity. Solving Striver’s sheet on coding platforms will expose you to quality problems and improve problem-solving skills.

Tip 2: Revise fundamentals like OOP, Operating Systems, Machine Learning (Python), and System Design basics, as they are frequently asked in interviews and help build confidence.

Tip 3: Build strong projects for your resume, participate in hackathons, and take part in regular contests.

Application process
Where: Other
Eligibility: Above 7CGPA. (Salary Package: 1.25 lakh per month)
Resume Tip
Resume tip

Tip 1: Keep your resume concise (one page) and highlight only the most relevant experiences.

Tip 2: Include 2–3 impactful projects from different tech stacks (e.g., MERN, ML, AI) and clearly showcase the skills and technologies used.

Tip 3: Mention achievements, hackathons, and coding contests to demonstrate problem-solving ability and initiative.

Interview rounds

01
Round
Medium
Online Coding Test
Duration90 minutes
Interview date9 Mar 2025
Coding problem2

The OA had a flexible 4-hour login window on Sunday, which made it convenient to attempt from home in a comfortable environment. About a week after receiving confirmation that I was shortlisted, my interviews were scheduled.

1. Time To Burn Tree

Hard
50m average time
50% success
0/120
Asked in companies
MicrosoftThalesOLX Group

You have a binary tree of 'N' unique nodes and a Start node from where the tree will start to burn. Given that the Start node will always exist in the tree, your task is to print the time (in minutes) that it will take to burn the whole tree.


It is given that it takes 1 minute for the fire to travel from the burning node to its adjacent node and burn down the adjacent node.


For Example :
For the given binary tree: [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
Start Node: 3

    1
   / \
  2   3
     / \
    4   5

Output: 2

Explanation :
In the zeroth minute, Node 3 will start to burn.

After one minute, Nodes (1, 4, 5) that are adjacent to 3 will burn completely.

After two minutes, the only remaining Node 2 will be burnt and there will be no nodes remaining in the binary tree. 

So, the whole tree will burn in 2 minutes.
Problem approach

Traverse tree using DFS (post-order).
If node is nullptr, return 0.
Recurse left and right to get depths.
If current node == start:
Set maxDistance = max(leftDepth, rightDepth)
Return -1 (marks infection start).
If start not in subtrees (both depths ≥ 0):
Return max(leftDepth, rightDepth) + 1.
If start in one subtree (one depth < 0):
Compute distance = abs(leftDepth) + abs(rightDepth).
Update maxDistance = max(maxDistance, distance).
Return min(leftDepth, rightDepth) - 1.
After traversal, maxDistance is the infection spread time.

Try solving now

2. Find the direction from given string

Easy
0/40
Asked in company
Microsoft

You are given a string str consisting only of the characters 'L' and 'R'. Imagine a pivot on a compass that is initially pointing North (N).

Your task is to determine the final direction of the pivot after performing a series of rotations as described by the input string.

  • 'L' represents a 90-degree left (counter-clockwise) rotation.

  • 'R' represents a 90-degree right (clockwise) rotation.

  • Problem approach

    Use a counter that increments when seeing R and decrements when seeing L.
    Finally, use modulo on the counter to determine the direction.
    If the count is negative, the direction will be different. Check the code for handling negative values as well.

    Try solving now
    02
    Round
    Medium
    Video Call
    Duration45 minutes
    Interview date16 Mar 2025
    Coding problem2

    My first interview was conducted by a senior manager and began with a brief self-introduction, after which I was given two DSA problems to solve. One problem was based on a greedy approach, while the other involved dynamic programming. I was able to explain my thought process clearly and provide optimized solutions to both problems. The environment was professional and supportive, with standard questions that aligned well with common practice material. Overall, it was a smooth experience, and I felt confident about my performance in this round.

    1. Candies

    Moderate
    10m average time
    90% success
    0/80
    Asked in companies
    Goldman SachsOYOMorgan Stanley

    Prateek is a kindergarten teacher. He wants to give some candies to the children in his class. All the children stand in a line and each of them has a grade according to his or her performance in the class. Prateek wants to give at least one candy to each child. If two children are standing adjacent to each other, then the one with the higher rating must get more candies than the other. Prateek wants to minimize the total number of candies he must buy.

    Given an array 'STUDENTS' of size 'N' that contains the grades for each student, your task is to find what is the minimum number of candies Prateek must buy so that he can distribute them among his students according to the criteria given above.

    Example :

    Given students' ratings : [5, 8, 1, 5, 9, 4]. 
    He gives the students candy in the following minimal amounts : [1, 2, 1, 2, 3, 1]. He must buy a minimum of 10 candies.
    

    Note :

    1. If two students having the same grade are standing next to each other, they may receive the same number of candies.
    2. Every student must get at least a candy.
    
    Problem approach

    Initialize: Create an array candies of size n, fill with 1 (everyone gets at least one).

    Left → Right pass:
    For i from 1 to n-1, if ratings[i] > ratings[i-1], set
    candies[i] = candies[i-1] + 1.
    (This satisfies the constraint w.r.t. the left neighbor.)

    Right → Left pass:
    For i from n-2 down to 0, if ratings[i] > ratings[i+1], set
    candies[i] = max(candies[i], candies[i+1] + 1).
    (This fixes the constraint w.r.t. the right neighbor without breaking the left.)

    Sum up all values in candies — that’s the minimum total.

    Try solving now

    2. Find Minimum Number Of Coins

    Easy
    15m average time
    85% success
    0/40
    Asked in companies
    Goldman SachsMicrosoftAmazon

    Given an infinite supply of Indian currency i.e. [1, 2, 5, 10, 20, 50, 100, 500, 1000] valued coins and an amount 'N'.


    Find the minimum coins needed to make the sum equal to 'N'. You have to return the list containing the value of coins required in decreasing order.


    For Example
    For Amount = 70, the minimum number of coins required is 2 i.e an Rs. 50 coin and a Rs. 20 coin.
    
    Note
    It is always possible to find the minimum number of coins for the given amount. So, the answer will always exist.
    
    Problem approach

    Inputs: coins (int[]), amount (int).

    Sentinel: Let INF = amount + 1 (a value > any possible answer).

    DP Array: Create dp[0..amount], fill with INF.

    Base: dp[0] = 0 (0 coins to make sum 0).

    Transition: For each coin c in coins
      For x from c to amount:
      dp[x] = min(dp[x], dp[x - c] + 1)
    (reuse same coin → unbounded).

    Answer: If dp[amount] == INF, return -1; else return dp[amount].

    Try solving now
    03
    Round
    Easy
    Video Call
    Duration1 hour
    Interview date16 Mar 2025
    Coding problem2

    In my second round, the interviewer began with a brief introduction, during which I talked about my background, interests, and projects. The first technical question was a DSA problem on finding the median in a given range using a priority queue. This question took some time to solve, but I explained my thought process clearly while working through it. After that, as time was running short, the interviewer moved on to OOPs concepts, asking about the basics, such as principles, writing simple structures, and how they are implemented in C++. Overall, this round was more challenging than the first, but it tested both my problem-solving skills and OOPs fundamentals.

    1. Subarray Median Queries

    Moderate
    0/80
    Asked in company
    Microsoft

    You are given an array A of 'N' integers and 'Q' queries.

    For each query, you are given a start index L and an end index R (1-based), which define a subarray A[L...R].

    Your task is to find the median of this subarray. The median of a subarray is defined as the element that would be at the middle position if the subarray were sorted in non-decreasing order.


  • If the subarray's length is len, the median is the element at index floor((len + 1) / 2) of the sorted subarray (1-based index).

  • Problem approach

    Step 1: I initially considered a brute-force approach: for every query [L, R], extract the subarray, sort it, and then find the median. This solution works but takes O(N log N) per query, which becomes inefficient for large inputs.

    Step 2: The interviewer asked me to optimize, but at that moment, I was unable to recall the standard optimization technique using two heaps (priority queues).

    Step 3 (Later Realization): The efficient method is to use two heaps – a max-heap for the left half of the elements and a min-heap for the right half. For each query, elements of the subarray [L, R] can be inserted into these heaps, balancing their sizes. The median is then either the top of one heap (for odd-length subarrays) or the average of both tops (for even-length subarrays).

    Try solving now

    2. Object-Oriented Programming (OOPs)

    • Explain the different types of base classes in OOP.
    • What is the difference between a shallow copy and a deep copy? (Learn)
    Problem approach

    Tip 1: Always start with the four pillars of OOP – Encapsulation, Abstraction, Inheritance, Polymorphism. Provide both definitions and real-world examples (e.g., Car = Abstraction, Engine = Encapsulation, Sedan extends Car = Inheritance, Overriding = Polymorphism).

    Tip 2: Revise Access Specifiers (public, private, protected) with practical examples. Many interviewers check if you understand how inheritance behaves with different access modifiers.

    Tip 3: Be clear about Compile-time vs. Run-time polymorphism (overloading vs. overriding). Always mention virtual functions and vtable/vptr when asked about Run-time polymorphism.

    Tip 4: Understand Constructors & Destructors properly (default, parameterized, copy, destructor). Common question: What gets called first in inheritance? (Answer: Base constructor, then derived constructor. For destructors, the order is reversed).

    Here's your problem of the day

    Solving this problem will increase your chance to get selected in this company

    Skill covered: Programming

    What is recursion?

    Choose another skill to practice
    Similar interview experiences
    company logo
    SDE - Intern
    3 rounds | 8 problems
    Interviewed by Microsoft
    2275 views
    2 comments
    0 upvotes
    company logo
    SDE - Intern
    3 rounds | 6 problems
    Interviewed by Microsoft
    1326 views
    0 comments
    0 upvotes
    company logo
    SDE - Intern
    2 rounds | 5 problems
    Interviewed by Microsoft
    1961 views
    0 comments
    0 upvotes
    company logo
    SDE - Intern
    2 rounds | 4 problems
    Interviewed by Microsoft
    597 views
    0 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    SDE - Intern
    3 rounds | 6 problems
    Interviewed by Amazon
    15481 views
    4 comments
    0 upvotes
    company logo
    SDE - Intern
    2 rounds | 4 problems
    Interviewed by Amazon
    10143 views
    2 comments
    0 upvotes
    company logo
    SDE - Intern
    3 rounds | 4 problems
    Interviewed by Amazon
    6358 views
    3 comments
    0 upvotes