← Microsoft questions

Spiral Matrix, Remove Duplicates, and Memoization

Filed under Microsoft

Write functions to: 1) Fill an n x n matrix spirally with numbers from 1 to n^2. 2) Remove duplicates from a string in-place. 3) Optimize a recursive function using memoization.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.