Microsoft Coding & Algorithms Interview Questions

Microsoft Coding & Algorithms interview questions are centered on algorithmic problem solving, clear coding, and the ability to reason about complexity under time pressure. At Microsoft you’ll typically be evaluated on problem decomposition, correctness, time/space complexity, edge-case handling, and communication: interviewers want to see that you can produce a correct solution, explain your approach, and iterate when given feedback. Expect online assessments and phone screens that use collaborative coding editors, followed by a loop of focused technical interviews that mix coding problems with occasional system or design-style questions depending on level. For effective interview preparation, prioritize pattern recognition and timed practice: master arrays and strings, trees and graphs, hashing, dynamic programming, and complexity analysis, and practice explaining tradeoffs aloud. Simulate the coding environment you’ll face, write and test complete solutions, and rehearse concise, structured explanations of your thought process. Balance breadth with depth so you can move quickly between easy and medium problems while still handling harder algorithmic puzzles when required.

100 Questions 1 Company08.03.2026
Showing 20 results
Role
Microsoft logo
Microsoft
Medium
Software Engineer Locked

Implement Memory Allocation and In-Memory Records

This question evaluates implementation skills in memory management and in-memory data modeling, covering first-fit allocation semantics, free/merge be...

Coding & Algorithms
1
0
15 people solved
May 7, 2026
Microsoft logo
Microsoft
Medium
Software Engineer

Sort Three Categories In Place

You are given an array items containing only the values 0, 1, and 2, where each value represents a category. Rearrange the array in-place so that all ...

Coding & Algorithms
0
0
8 people solved
Apr 18, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer

Implement K-Means and Detect Divisible Subarrays

Solve both coding tasks. Part A: Implement K-Means Clustering Implement K-means clustering for a set of points. Given: - points: a list of n points, w...

Coding & Algorithms
1
0
16 people solved
Apr 18, 2026
Microsoft logo
Microsoft
Medium
Software Engineer

Retain Top K Elements

Given a list of integers nums and an integer k, return a new list formed from the original list after removing every element except the k largest elem...

Coding & Algorithms
1
0
12 people solved
Apr 17, 2026
Microsoft logo
Microsoft
Medium
Software EngineerSenior+

Implement SQL Table and DNA Ordering

Two independent coding exercises were asked. Solve both. Problem A: CSV-backed in-memory table Build a tiny in-memory relational table initialized fro...

Coding & Algorithms
2
0
27 people solved
Apr 10, 2026
Microsoft logo
Microsoft
Hard
Software Engineer Locked

Solve power jumps and graph tour

This pair of problems evaluates algorithmic problem-solving in number representation and combinatorial graph optimization, focusing on competencies in...

Coding & Algorithms
7
0
62 people solved
Apr 8, 2026
Microsoft logo
Microsoft
Easy
Machine Learning Engineer Locked

Find Top K Largest Numbers

This question evaluates proficiency with heap/priority-queue data structures, selection algorithms, and the ability to analyze time and space complexi...

Coding & Algorithms
2
0
30 people solved
Apr 1, 2026
Microsoft logo
Microsoft
Easy
Data ScientistSenior+ Locked

Write an average-income function

This question evaluates proficiency in data manipulation and basic statistical aggregation, particularly handling missing values and computing average...

Coding & Algorithms
12
0
102 people solved
Apr 1, 2026
Microsoft logo
Microsoft
Hard
Software Engineer

Compute discounted prices and full-price indices

You are given an array prices of length \(n\). Items are sold from left to right, and each item’s final selling price is computed as follows: For item...

Coding & Algorithms
17
0
117 people solved
Mar 1, 2026
Microsoft logo
Microsoft
Medium
Software Engineer Locked

Reconstruct DNA from tagged fragments

This question evaluates understanding of sequence reconstruction, graph modeling, and traversal/orientation constraints, focusing on ordering labeled ...

Coding & Algorithms
7
0
128 people solved
Mar 1, 2026
Microsoft logo
Microsoft
Medium
Data Scientist

Traverse an Org Chart by Level

You are given an organization's reporting structure as a flat list of employee-manager relationships. Exactly one employee is the root (the CEO) and h...

Coding & Algorithms
15
1
138 people solved
Feb 25, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Implement cache and merge intervals

This question evaluates proficiency in designing and implementing efficient data structures (a fixed-capacity LRU key-value cache) and interval-proces...

Coding & Algorithms
3
0
33 people solved
Feb 23, 2026
Microsoft logo
Microsoft
Medium
Software Engineer Locked

Implement Matrix Move and Logger

This question evaluates array manipulation and in-place algorithm design for handling overlapping submatrix moves, along with data-structure and time-...

Coding & Algorithms
4
0
41 people solved
Feb 22, 2026
Microsoft logo
Microsoft
Medium
Software Engineer Locked

Implement Calendar, Tokenizer, and Meeting Optimizer

This question evaluates competencies in interval scheduling and overlap detection, custom string tokenization and parsing rules, and combinatorial opt...

Coding & Algorithms
4
0
76 people solved
Feb 22, 2026
Microsoft logo
Microsoft
Medium
Software Engineer Locked

Remove duplicates in-place from unsorted array

This question evaluates understanding of in-place array manipulation, duplicate removal, and algorithmic analysis under strict extra-space constraints...

Coding & Algorithms
8
0
86 people solved
Feb 12, 2026
Microsoft logo
Microsoft
Hard
Software Engineer Locked

Compute product of array except self

This question evaluates understanding of array manipulation, modular arithmetic, and algorithmic optimization by requiring computation of per-element ...

Coding & Algorithms
2
0
42 people solved
Feb 11, 2026
Microsoft logo
Microsoft
Hard
Software Engineer Locked

Implement idempotent request handling with idempotency keys

This question evaluates understanding of idempotency semantics, idempotency-key handling, concurrency control, synchronization, and in-memory TTL-base...

Coding & Algorithms
5
0
43 people solved
Feb 11, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Implement a resumable data loader

This question evaluates a candidate's ability to design stateful, resumable data iteration with deterministic shuffling and compact serializable check...

Coding & Algorithms
5
0
56 people solved
Feb 11, 2026
Microsoft logo
Microsoft
Easy
Data Scientist Locked

Traverse org chart level by level

This question evaluates understanding of hierarchical data modeling and tree traversal, specifically breadth-first (level-order) traversal and reconst...

Coding & Algorithms
6
0
45 people solved
Feb 9, 2026
Microsoft logo
Microsoft
Medium
Software Engineer

Fill rooms with nearest-gate distance

You are given an m×n grid representing a building floor plan: - -1 = wall/blocked cell - 0 = gate - A large positive number (e.g., INF = 2^31-1) = emp...

Coding & Algorithms
6
0
58 people solved
Feb 7, 2026

Frequently Asked Questions

How difficult are Microsoft Coding & Algorithms interview questions?
Microsoft Coding & Algorithms questions typically span easy to hard difficulty, with most technical rounds focusing on medium-to-hard problems that test algorithmic thinking under time pressure. Interviewers expect clear reasoning, correct edge-case handling, and reasonably optimized solutions; for mid-level roles you’ll often see medium problems emphasizing arrays, strings, trees, and hashing, while senior candidates face harder dynamic programming, graph, and design-of-algorithm challenges. The difficulty also depends on role level and domain: applied research or specialized teams may ask deeper algorithmic proofs or complexity trade-offs. Expect to demonstrate both correctness and thoughtfulness about performance.
Where in the Microsoft interview process do Coding & Algorithms questions appear, and how is the process structured?
Coding & Algorithms questions appear throughout Microsoft’s screening pipeline: they commonly show up in the online assessment and technical phone screen, and they dominate multiple rounds of the onsite or virtual onsite loop. A typical structure begins with a recruiter screen, then an online coding assessment or technical phone interview that evaluates problem solving in a shared editor, followed by a series of one-hour interviews where 2–4 coding rounds are interleaved with design and behavioral conversations. For senior roles, expect algorithmic depth in coding rounds and algorithmic reasoning to surface during system or design discussions.
How long should I prepare for Microsoft Coding & Algorithms interviews — what timeline works best?
A practical preparation timeline is usually 6–12 weeks of focused practice for most mid‑level candidates, with adjustments based on background and target level. Start with a diagnostic week to identify weak areas, then spend 4–6 weeks building breadth across arrays, strings, trees, graphs, and DP, followed by 1–2 weeks of timed mock interviews and editor practice to simulate real sessions. If you’re aiming for senior roles, add several weeks for advanced algorithmic problems and technical communication drills. Consistent daily practice with explanation and review beats last‑minute cramming.
What key subtopics within Coding & Algorithms should I focus on for Microsoft interviews?
Concentrate on data structures and algorithmic patterns that Microsoft interviewers commonly evaluate: arrays and strings, two‑pointer and sliding window techniques, hash maps and sets, linked lists, recursion and trees (including traversals), graph traversal and shortest paths, heaps, sorting and binary search, and dynamic programming. Equally important are complexity analysis, handling NULLs and corner cases, and writing clean, testable code in a collaborative editor without IDE aids. Practicing problem classification and translating requirements into efficient data models will help you move from a correct solution to an optimal, interview‑ready answer.
What standout tips and common pitfalls should I know when preparing for Coding & Algorithms at Microsoft?
Standout tips include always clarifying requirements and constraints before coding, proposing multiple solutions with trade‑offs, and communicating your thought process clearly while writing concise, readable code. Practice in a plain collaborative editor to mimic interview conditions and time yourself on medium and hard problems. Common pitfalls are diving into implementation without confirming edge cases, failing to analyze time and space complexity, not testing with representative inputs, and overcomplicating solutions when a simpler approach suffices. Remember to verbalize assumptions and to iterate when you get feedback from the interviewer.

Explore more Microsoft Coding & Algorithms interview questions

Real questions from candidate reports, grouped by role, topic and company.

By role
Other categories at Microsoft
Coding & Algorithms questions at other companies
Browse all