InterviewLegend

Arrays, Hashing & Strings

Alex Chen22 min readUpdated 138 real interview reports

Most Amazon loops open here. Medium problems, no Run button, and an interviewer grading two things at once: did you land on the right data structure, and can you explain why it works. A hash map or a sliding window collapses an O(n²) brute force into one clean sweep. Show that collapse and you've banked most of the points on offer.

Two ideas cover almost all of it. A hash map answers "have I seen this key, and where" in constant time, which kills nested-loop scans. A sliding window keeps a stretch of the array under a rule by moving two pointers, so you re-read each element once instead of re-scanning every subarray. Learn those two. The rest is bookkeeping.

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

Premium lessonAmazon 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 Amazon interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Amazon interview guide

Know what Amazon asks before you walk in.

19 coding · 6 system design · 44 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.