Compile Ready
DSA
DSA/Arrays & Hashing

Arrays & Hashing

This is a premium interview-preparation course on the two data structures every other topic is built on: the **array** and the **hash table**. Most interview problems reduce to one question — can you avoid re-computing something you already know? Arrays let you scan and transform in place; a **prefix sum** turns any range query into two lookups; a **frequency map** or **hash set** trades a little memory for O(1) membership and counting, collapsing an O(n^2) search into O(n). You will start with the mental models (how dynamic arrays amortise growth, why hashing is expected O(1), how collisions are handled), then work through curated problems grouped by the patterns interviewers actually test: prefix sums, frequency maps, in-place array transformations, and hash-backed data-structure design. Every lesson recognises the pattern first, dry-runs a concrete example, then shows a clean Java 17 implementation.

29

Curated lessons

6

Learning modules

7h 13m

Est. study time

10

Target companies

What you'll learn

  • Recognise when a prefix sum or difference array replaces repeated range work with O(1) lookups.
  • Reach for a hash map or set the moment a problem needs membership, counting, or grouping in O(1).
  • Transform arrays in place — marking, sign tricks, and index-as-hash — to hit O(1) extra space.
  • Design hash-backed structures (LRU, RandomizedSet, HashMap) that combine maps with arrays or lists.

Your progress

0%

0 / 29

problems completed

29 available now · keep going!

Mark lessons complete as you work through them. Progress is saved on this device and syncs to your account when you sign in.

Learning roadmap

Work top to bottom — each module builds on the last.

  1. 1

    Arrays Fundamentals

    Scan, prefix-sum, and count in place

    How arrays store and resize data, the true cost of each operation, and the prefix-sum and difference-array tricks that answer range questions in O(1).

    7/7 problems54m
  2. 2

    HashMap & HashSet Fundamentals

    Trade memory for O(1) lookup

    Why hashing gives expected O(1) lookups, how collisions are resolved, and when to choose a map over a set.

    4/4 problems32m
  3. 3

    Prefix Sum Pattern

    Prefix sums + hash map of seen sums

    Precompute cumulative sums so any range or subarray-sum question becomes a constant-time lookup or a single hash-map pass.

    4/4 problems1h 7m
  4. 4

    Frequency Map Pattern

    Hash map for counts, complements, grouping

    Use a hash map or set to count, look up complements, and group items — the workhorse pattern behind Two Sum and anagram problems.

    5/5 problems1h 19m
  5. 5

    Advanced Arrays

    In-place marking and index-as-hash

    In-place transformations and index tricks: prefix/suffix products, using the array as its own hash, and rotating a matrix without extra space.

    5/5 problems1h 48m
  6. 6

    Advanced Hashing

    Hash map + array/list for O(1) design

    Design problems that combine a hash map with an array or linked list to hit O(1) operations — RandomizedSet, LRU cache, and building a hash table from scratch.

    4/4 problems1h 33m

Modules

6 themed modules from fundamentals to advanced.

Full curriculum

18 problems and 11 concept lessons in learning order.

Techniques you'll master

Amortized AnalysisAnagramArrayArrayListArraysBig-OBucket SortCacheCollisionsComplement LookupComplexityConstant SpaceCountingCyclic SortData StructureDesignDifference ArrayDuplicate DetectionEarly ExitFrequencyFrequency CountingFrequency SignatureGroupingHash FunctionsHash MapHash SetHashMapHashSetHashingHeapIn-PlaceIn-Place MarkingIn-Place ThinkingIn-place UpdateIndex As HashIndexingInterview ClassicInterview FrameworkJavaLinear ScanLinked ListMatrixMembershipMemoryModuloNo DivisionOne PassPattern ChoicePatternsPrefix ProductPrefix SumRandomizedRange QueryRange UpdateResizingRunning TotalSequenceSimulationStringSubarraySuffix ProductTransposeTwo Pointers