Topics / Arrays
🔢
Arrays
The most common interview topic — and the building block of almost every other data structure.
Why learn Arrays?
-
Show up in 30%+ of coding interviews.
-
Foundation for two-pointer, sliding window, and prefix-sum patterns.
-
Easy to start, deep enough to keep you sharp for years.
What you can build with Arrays
Two-pointer and sliding-window problems Prefix-sum and difference-array tricks Matrix and 2D grid problems
Arrays tutorials
9 articlesHand-written tutorials, ordered as a recommended learning path.
- 01 Arrays A complete beginner's guide to JavaScript arrays — creation, indexing, the essential mutation methods, iteration, map/filter/reduce, and a first look at spread and destructuring.
- 02 Arrays — Intro A beginner's introduction to arrays — contiguous memory, indexing, the Python list vs C array caveat, time complexity of read/write/insert/delete, and 1D vs 2D arrays.
- 03 Arrays — Operations The everyday array patterns every DSA learner should know — traversal, linear search, insertion, deletion, reversal, rotation, prefix sums, Kadane's preview, and the one-pass habit.
- 04 Arrays — Practice Ten classic array interview problems with examples, approach, complexity, and clean Python solutions — Two Sum, Best Time to Buy/Sell Stock, Kadane's, Rotate Array, Product Except Self, and more.
- 05 Buy Sell Stock Walk through LeetCode 121 Best Time to Buy and Sell Stock. We go from the quadratic brute force to a clean one-pass solution tracking the running minimum.
- 06 Max Subarray A clear walkthrough of LeetCode 53 Maximum Subarray. We build Kadane's algorithm from first principles and contrast it with the divide and conquer approach.
- 07 Product Except Self Solve LeetCode 238 Product of Array Except Self in O(n) without division using prefix and suffix passes. Clean walkthrough plus interview script.
- 08 Rotate Image Solve LeetCode 48 Rotate Image in place by transposing and reversing each row. Walkthrough, edge cases, complexity, and interview script.
- 09 Spiral Matrix Solve LeetCode 54 Spiral Matrix with the four-boundary walk pattern. Clean implementation, edge cases for rectangles, complexity, and interview tips.