These are Algorithms questions of the kind Microsoft actually asks — the patterns reported from Microsoft's AI-engineering rounds, where design trade-offs, scale and failure modes matter as much as definitions. Treat this page as a mock interview: say every answer out loud before revealing it. If one surprises you, the lesson behind it is linked at the bottom.
Microsoft Algorithms concept questions
Detect whether a DIRECTED graph contains a cycle. Why doesn't a plain visited set suffice, and what replaces it?
Asked in
Microsoft Algorithms applied & hands-on questions
Find the longest palindromic substring of "babad". Give the O(n²) expand-around-centre solution and say why there are 2n−1 centres.
Asked in
If a matrix cell is 0, set its whole row and column to 0 — in place. The O(m+n) extra-space version is easy; achieve O(1) extra space.
Asked in
How to use this page: Microsoft rarely asks something you've never seen — they ask a standard Algorithms concept and then push one level deeper ("why?", "what would you do if..."). Master the concept in the Algorithms course lessons, and the follow-up stops being scary.
Keep practising: Binary Search, Dynamic Programming, BFS & DFS and Patterns & Strategy cover what most Microsoft Algorithms rounds test.

