InterviewLegend

Arrays & Strings

Alex Chen28 min readUpdated 1,382 real interview reports

Clear these cleanly and you have cleared most of a Microsoft coding round. The same handful of names recur loop after loop. A Premium question Characters is the most recurring string problem in the loop. Group Anagrams, Two Sum, and Valid Parentheses show up as warm-ups. A Premium question and the two hard ones, a Premium question and Trapping Rain Water, come out when an interviewer wants a real signal. Microsoft leans easier and more classic than Google or Meta, so the bar is bug-free tested code on a problem you have probably seen before, not an exotic trick.

Two skeletons carry almost the whole family. The first is opposing pointers: start at the two ends of an array and walk inward, letting a simple comparison decide which side to retire. A sliding window walks a right edge across a string while a left edge follows behind. A small map tracks what is currently inside the window, so you know when to grow it and when to shrink it. Both replace an O(n^2) scan of every pair or every substring with a single linear pass. The map is what makes the window pass correct.

What's inside
  • 3 problems, worked step by step
  • about 28 min

Premium lessonMicrosoft interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · 30-day money-back guarantee

Had your Microsoft interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Microsoft interview guide

Know what Microsoft asks before you walk in.

21 coding · 3 system design · 24 behavioral questions

Get Premium$49 a year · 30-day money-back guarantee
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.