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."
Find the Best Connected Strength for Every Tree Node
Find the Best Connected Strength for Every Tree Node A tree contains n neurons. Each neuron is either strong or weak. Assign weight +1 to a strong neu...
Maximize a Product After a Shared XOR
Maximize a Product After a Shared XOR Given positive integers a and b and a bit width n, choose an integer x with 0 <= x < 2**n that maximizes: `text ...
Return Top K Open Businesses
This question evaluates a candidate's ability to perform filtering and multi-criteria ranking, requiring correct handling of an open-status filter and...
Solve four classic algorithm problems
You are given four independent coding tasks. For each task, implement the required function. --- Problem 1: Zigzag level-order traversal of a binary t...
Implement greedy decoding and beam search
You are given access to an auto-regressive language model that can score the next token based on a prefix. Assume: - next_logprobs(prefix_tokens) -> M...
Stream output until stop token appears
This question evaluates streaming string processing and pattern-matching skills, specifically handling token detection across chunk boundaries, bounda...
Implement concurrent structures and debug queue code
The coding rounds covered several implementation and debugging tasks: 1. Implement an LRU cache that supports get(key) and put(key, value) in constant...
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...
Implement four data-structure/string geometry tasks
This multi-part question evaluates manual big-integer string multiplication, robust parsing and tokenization of complex log formats, computational geo...
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 ...
Identify the Extra Directed Edge
You are given a list of directed edges edges, where each edge is represented as [parent, child]. The graph contains nodes labeled from 1 to n, and it ...
Solve Throughput, Rate Limiting, and LFU
This set of tasks evaluates algorithmic problem-solving, data structure design, and systems-oriented reasoning by testing throughput calculation, roll...
In-Memory URL Shortener: Encode and Decode
This question evaluates a candidate's ability to design a class-based data structure with paired encode and decode operations that maintain a consiste...
Rotate a 3×3 digit grid by 180°
This question evaluates understanding of grid and string manipulation, coordinate transformations, spatial reasoning, and character validation in cons...
Minimum Moves on a Grid with k-Cell Jumps
You are given an m x n grid. Each cell is either open or blocked: - grid[i][j] = 0 means the cell is open. - grid[i][j] = 1 means the cell is blocked....
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...
Find minimum cycle cost per node
This question evaluates proficiency in graph algorithms and algorithmic optimization, specifically reasoning about weighted directed graphs, cycle cos...
Return Top K Relevant Apps
This question evaluates algorithmic problem-solving around aggregation and ranking, testing skills in computing aggregated relevance scores, determini...
Find minimum moves to solve the 15-puzzle
This question evaluates understanding of state-space search, heuristic reasoning, and solvability analysis for combinatorial sliding puzzles, testing ...
Implement a sliding-window rate limiter allow()
This question evaluates understanding of sliding-window rate limiting, time-windowed counting, and per-user state management for high-throughput servi...