Two problems, one pair of concepts: LC 349 asks for the unique intersection (HashSet), LC 350 asks for the frequency-aware intersection (HashMap). Master all three approaches for LC 349 — HashSet, sort+two pointers, binary search — then learn why the follow-up questions on LC 350 are what Google and Amazon actually care about: sorted input, skewed sizes, and data that does not fit in memory.
LeetCode 387 is deceptively simple — but the way you solve it, explain it, and handle its follow-ups separates candidates who get the offer from those who do not. Master the two-pass frequency map, understand why O(1) space is possible, and be ready for every streaming and ordering twist Amazon throws at you.
Group strings that are anagrams of each other using two canonical approaches: sorted string key O(n·k·log k) and character frequency tuple key O(n·k). Understand when the difference matters, trace through a dry run, dodge the common traps, and leave any interview with both solutions ready to go.
Master LeetCode 3 — the canonical sliding window problem. Understand the "shrink from left" insight, the critical stale-index bug with max(), and both set-based and hashmap-optimized solutions in Python and JavaScript. Includes a full step-by-step dry run and follow-up problems LC 340 and LC 159.
LeetCode 560 is one of the most-asked FAANG problems because it teaches the prefix sum + hashmap pattern — a technique that handles negative numbers, generalizes to a dozen follow-ups, and cannot be replaced by sliding window. Learn the insight, the dry run, the common mistakes, and the O(n) solution in Python and JavaScript.
LeetCode 347 asks for k most frequent elements with a constraint: beat O(n log n). Learn why naive sort fails, how a min-heap of size k achieves O(n log k), and the elegant bucket sort insight that delivers true O(n) — with full visual dry run, common mistakes, and Python/JavaScript solutions for all three approaches.
LeetCode 76 Minimum Window Substring is a Google staple solved with a two-pointer sliding window plus a need-and-have frequency counter. Optimal solution runs in O(n + m) time and O(m) space.
Group anagrams, find anagram occurrences, and detect anagrams under constraints. Master the three classical encodings — sorted key, 26-bucket frequency vector, and prime-product hash — with rolling-window extensions used at Meta and Google.
LC 437 Path Sum III counts all paths in a binary tree summing to a target. The optimal O(n) solution mirrors the subarray sum equals k trick — use a prefix sum frequency map with DFS backtracking, a pattern tested at Amazon and Google.