Skip to main content

Microsoft Coding Interview Questions

20 Microsoft coding interview problems with full optimal solutions — 5 easy, 13 medium, 2 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Microsoft interviewer values, and a FAQ section.

Showing 5 problems of 20

  • #20easyfoundational

    20. Valid Parentheses

    Valid Parentheses is the Microsoft warm-up that tests whether you can pick the right data structure on the first try. The answer is always a stack — explain why before writing code, and use a closing-to-opening hash map so the matching logic is a single comparison.

    4 free resourcesSolve →
  • #168easyfrequently asked

    168. Excel Sheet Column Title

    Excel Sheet Column Title is Microsoft's deliberately-off-by-one base-26 puzzle. Excel columns A..Z, AA..AZ, BA.. are 1-indexed with no zero digit, so a vanilla base-26 conversion is wrong. The fix is subtracting one before every modulo.

    4 free resourcesSolve →
  • #202easyfrequently asked

    202. Happy Number

    Happy Number is Microsoft's favorite cycle-detection question disguised as math. The trick is recognizing the digit-square sum sequence either reaches 1 or enters a cycle — so Floyd's tortoise-and-hare applies and the space drops to O(1).

    4 free resourcesSolve →
  • #206easyfoundational

    206. Reverse Linked List

    Reverse Linked List is Microsoft's go-to pointer-manipulation warm-up. Interviewers want you to talk through the three-pointer dance (prev, curr, next) without losing the rest of the list and to mention the recursive variant before they ask.

    4 free resourcesSolve →
  • #703easyfrequently asked

    703. Kth Largest Element in a Stream

    Kth Largest Element in a Stream is Microsoft's go-to question for whether you reach for the right data structure when 'streaming' enters the problem. The answer is a min-heap of size k — anything else (sorted list, max-heap) has the wrong asymptotic cost.

    4 free resourcesSolve →

Related interview-prep guides

Interview Platforms

HireVue Tech Interview Guide: The 2026 Playbook for Async Video Rounds

HireVue is the category-leading async video interview platform. Candidates record answers solo, on the clock, and a combined AI-plus-human review layer scores the recording days later. For 2026 tech jobseekers, the format is different enough from live interviews to need its own playbook. This guide is that playbook.

Interview Platforms

Codility for Tech Interviews in 2026: The Complete Guide for Candidates

Codility is the dominant algorithmic-assessment platform across European tech hiring. Heavy in the UK, Germany, Netherlands, Nordics, and Poland where the company was founded. It scores candidates on both correctness and time complexity, runs 60-to-120-minute timed tests, and ships three products: Tests, CodeCheck, and CodeLive. This guide is what 2026 candidates need to know.

Interview Platforms

LeetCode Assessments: The 2026 Tech Interview Guide

LeetCode Assessments is the enterprise tier of the LeetCode platform: a separate product from the public site candidates know from grinding problems. Companies pay LeetCode to build custom timed assessments that draw from the 3,000-problem public catalog plus optional private variations, and the catalog asymmetry is the whole story for prep.

Microsoft Coding Interview Questions — Full Solutions — InterviewChamp.AI