Maximum Subarray — Kadane Algorithm for FAANG Interviews
LeetCode 53 — find the contiguous subarray with the largest sum in O(n). Kadane is the dynamic programming gateway problem at Amazon, Google, and Meta.
1582 articles
LeetCode 53 — find the contiguous subarray with the largest sum in O(n). Kadane is the dynamic programming gateway problem at Amazon, Google, and Meta.
LeetCode 283 moves every zero to the end of an array in place, keeping the other elements in order. Two pointers do it in one pass — but the problem also asks you to minimise the total number of operations, and that is where the overwrite and swap versions stop being interchangeable.
LeetCode 66 — increment a large integer represented as a digit array, propagating the carry. The deceptively simple FAANG warmup that catches careless coders.
LeetCode 88 — merge nums2 into nums1 in place by walking from the back. The classic two-pointer interview question at Meta and Microsoft.
Master the write pointer pattern — the canonical technique for in-place array modification. Full walkthrough of LeetCode 26 with visual dry run, common mistakes, and the LC 80 generalization. Python and JavaScript solutions included.