Microsoft Software Engineer Coding & Algorithms Interview Questions
Practice 79 real Coding & Algorithms interview questions for Software Engineer roles at Microsoft.

"I got asked a hardcore MCM DP question and I saw it on PracHub as well. Solved that question in 5 minutes. Without PracHub I doubt I could solve it in 5 hours. Though somehow didn't get hired, perhaps I guess I solved it too fast? /s"

"Believe me i'm a student here jn US. Recently interviewed for MSFT. They asked me exact question from PracHub. I saw it the night before and ignored it cause why waste time on random sites. I legit wanna go back and redo this whole thing if I had chance. Not saying will work for everyone but there is certainly some merit to that website. And i'm gonna use it in future prep from now on like lc tagged"

"10 years of experience but never worked at a top company. PracHub's senior-level questions helped me break into FAANG at 35. Age is just a number."

"I was skeptical about the 'real questions' claim, so I put it to the test. I searched for the exact question I got grilled on at my last Meta onsite... and it was right there. Word for word."

"Got a Google recruiter call on Monday, interview on Friday. Crammed PracHub for 4 days. Passed every round. This platform is a miracle worker."

"I've used LC, Glassdoor, and random Discords. Nothing comes close to the accuracy here. The questions are actually current — that's what got me. Felt like I had a cheat sheet during the interview."

"The solution quality is insane. It covers approach, edge cases, time complexity, follow-ups. Nothing else comes close."

"Legit the only resource you need. TC went from 180k -> 350k. Just memorize the top 50 for your target company and you're golden."

"PracHub Premium for one month cost me the price of two coffees a week. It landed me a $280K+ starting offer."

"Literally just signed a $600k offer. I only had 2 weeks to prep, so I focused entirely on the company-tagged lists here. If you're targeting L5+, don't overthink it."

"Coaches and bootcamp prep courses cost around $200-300 but PracHub Premium is actually less than a Netflix subscription. And it landed me a $178K offer."

"I honestly don't know how you guys gather so many real interview questions. It's almost scary. I walked into my Amazon loop and recognized 3 out of 4 problems from your database."

"Discovered PracHub 10 days before my interview. By day 5, I stopped being nervous. By interview day, I was actually excited to show what I knew."

"I recently cleared Uber interviews (strong hire in the design round) and all the questions were present in prachub."
"The search is what sold me. I typed in a really niche DP problem I got asked last year and it actually came up, full breakdown and everything. These guys are clearly updating it constantly."
Group GPUs by node and partition by links
This question evaluates understanding of graph algorithms and combinatorial optimization, specifically skills in graph traversal, grouping by node att...
Implement a rate limiter at scale
This question evaluates understanding of algorithmic and system-level design for per-key rate limiting, including data structures, time/space complexi...
Count k for consecutive-sum generator
An array generator service produces a consecutive-integers array starting at a positive integer k: [k, k+1, ..., k+m−1] for some m ≥ 1. The service re...
Implement tree traversals, BFS, and subsets generation
1) Define a TreeNode class for a binary tree with an integer value and left/right pointers. Implement preorder, inorder, and postorder traversals: (a)...
Solve binary-search knapsack & graph shortest path
Question Given a sorted list of items, design an efficient solution (using binary search) to achieve the target objective instead of a dynamic-program...
Solve budget queries and shortest path
1) Budgeted purchases with sorted array: You are given an array prices of n positive integers and q budget queries. For each budget B, you may buy ite...
Find longest substring without repeating characters
Problem Given a string s, return the length of the longest contiguous substring that contains no repeated characters. Input - s: a string (may contain...
Find lowest common ancestor in tree
You are given the root of a binary search tree (BST) and two distinct nodes p and q that are guaranteed to exist in the tree. Task (BST case): - Find ...
Find max consecutive elements with sum below target
You are given: - An integer array nums of length n, sorted in non-decreasing order. - An integer index such that 0 ≤ index < n. - An integer target. S...
Find shortest substring with n unique letters
Problem You are given a string s consisting of lowercase English letters and an integer n (1 ≤ n ≤ 26). Find the length of the shortest contiguous sub...
Implement a Tic-Tac-Toe game class
Problem Implement a class that supports playing an n × n Tic-Tac-Toe game. Requirements Create a class TicTacToe(n) with: - move(row, col, player) -> ...
Count non-decreasing arrays by digit sums
You are given an array required_sums of length n. Count how many non-decreasing arrays result[1..n] of integers satisfy all of the following: ( 1) for...
Compute sum of longest positive subarray
Compute sum of longest positive subarray Given an integer array that may contain positive and negative numbers, find the sum of the longest contiguous...
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...
Solve Three Coding Interview Problems
This set of problems evaluates competency in algorithmic problem-solving, including merging sorted arrays with duplicate elimination, reasoning about ...
Populate next pointers in a perfect binary tree
You are given a perfect binary tree (all leaves at the same level; every internal node has two children). Each node has fields left, right, and next. ...
Return a topological ordering of a graph
This question evaluates understanding of graph algorithms—particularly topological sorting and cycle detection—and competency in ordering dependencies...
Implement a calendar with non-overlapping bookings
Problem Design a calendar booking system that stores half-open time intervals [start, end) (inclusive of start, exclusive of end). Implement a class w...
Solve load balancing and perfect pairs
1) Contiguous load balancing: You have n identical resources (servers) and m ordered tasks with processing times burstTime[0..m-1]. Each server must b...