← Microsoft Interview Insights

Microsoft·Software Engineer·Onsite - Multi Round·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Microsoft SWE onsite with two parts back to back: behavioral first, then a coding problem. Nothing too wild but the combo of both in one sitting kept me on my toes.

Questions Asked (2)

Q1

Walk us through your background and a past project you're proud of.

Adaptability & Ambiguity
Author's notes

Pretty standard opener.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start with a concise chronological summary of your technical journey, then dive deep into one project that showcases your engineering skills and ability to navigate ambiguity. Use the STAR method to structure the project story, emphasizing the problem, your actions, and measurable outcomes.

Pro tip: Choose a project where you had to make decisions with incomplete information or shifting requirements, and explicitly highlight how you adapted—this directly addresses Microsoft's 'Adaptability & Ambiguity' competency.

1. Brief Background Overview

Summarize your education, key roles, and technical areas in 30-60 seconds, focusing on experiences that led you to this role.

2. Introduce the Project

State the project's purpose, your role, and why it was challenging or meaningful, setting the stage for the story.

3. Describe the Ambiguity and Challenge

Explain the unclear requirements, constraints, or unexpected obstacles you faced, and how you navigated them.

4. Detail Your Actions and Technical Decisions

Walk through the steps you took, the technologies you used, and how you collaborated with others to overcome the ambiguity.

5. Highlight Results and Learnings

Quantify the impact (e.g., performance improvements, user adoption) and reflect on what you learned about handling uncertainty.

Key Points to Mention

  • Specific technologies and tools used (e.g., C#, Azure, .NET)
  • How you gathered information or made assumptions to proceed despite ambiguity
  • Collaboration with cross-functional teams or stakeholders
  • Measurable outcomes (e.g., reduced latency by X%, increased user engagement)
  • Personal growth or lessons learned in adaptability
  • Alignment with Microsoft's culture and values (e.g., growth mindset, customer obsession)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Given a grid where cells are either walls (-1), gates (0), or empty rooms (a large max integer), fill each empty room with the distance to its nearest gate. If a room can't reach any gate, leave it as-is.

Algorithms & Data Structures
Author's notes

BFS from all gates simultaneously.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use a multi-source BFS starting from all gates simultaneously, updating each empty room with the shortest distance as you expand. This avoids redundant searches from each room and efficiently fills distances in O(m*n) time.

Pro tip: Mention that multi-source BFS is optimal because it processes each cell once, and clarify that you'd mutate the grid in-place to save space, but be prepared to discuss trade-offs if the input shouldn't be modified.

1. Clarify problem and constraints

Confirm grid dimensions, movement directions (usually 4-directional), and whether modifying the input grid is acceptable. Ask about edge cases like no gates or unreachable rooms.

2. Initialize BFS queue with all gates

Scan the grid to enqueue all gate coordinates (value 0) and mark them as visited (or rely on their value). This sets up the multi-source BFS.

3. Perform BFS level by level

While the queue is not empty, pop a cell, explore its 4 neighbors. If a neighbor is an empty room (INF), update its distance to current distance + 1 and enqueue it.

4. Handle unreachable rooms

After BFS, any room still marked INF remains unchanged, as it cannot reach any gate. Return or print the updated grid.

5. Analyze complexity and optimizations

State time complexity O(m*n) since each cell is processed once, and space O(m*n) for the queue in worst case. Mention potential optimization: use a two-pass DP if movement is only in certain directions, but BFS is general.

Key Points to Mention

  • Multi-source BFS treats all gates as sources to find shortest paths simultaneously.
  • Time complexity is O(m*n) because each cell is enqueued and dequeued at most once.
  • Space complexity is O(m*n) for the queue in the worst case (e.g., all gates).
  • In-place modification of the grid avoids extra space for distance storage.
  • Unreachable rooms remain as INF, which is correct per problem statement.
  • Alternative approaches like DFS or BFS from each room are less efficient (O(m*n*gates) or O(m*n*rooms)).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.