Learning order

1. Array

Free

Start your learning journey by understanding the most fundamental data structure.

Show Index

2. Singly Linked List

Free

Learn in-depth the most fundamental data structure in a programmer's life

Show Index

3. Doubly Linked List

Premium

Learn about the extension of the singly linked list that powers stacks and queues

Show Index

4. Hash Table

Premium

Learn how applications deal with key value mappings efficiently

Show Index

5. Stack

Premium

The data structure behind recursion, memory management, and much more

Show Index

6. Queue

Premium

Learn about the data structure that powers CPU and disk scheduling algorithms

Show Index

7. Binary Tree

Premium

Learn all about the most critical data structure in computer science

Show Index

8. Binary Search Tree

Premium

Learn about the most critical search data structure in computer science

Show Index

9. Heap

Premium

Learn all how a tree can be used as a priority queue

Show Index

10. Graph

Premium

Learn about the most dynamic data structure in computer science

Show Index

What you will learn

How a hash function maps arbitrary keys to a finite codomain and why collisions are unavoidable.

The three properties of a good hash function: uniform distribution, deterministic output, and constant time computation

All four collision resolution strategies: separate chaining, linear probing, quadratic probing, and double hashing

Why deletion needs a DELETED tombstone state in open addressing and what breaks without it

The five hashing patterns: counting, pattern generation, fixed window, variable window, and prefix sum

How to design an LRU cache and a randomised set with constant-time operations

Why this course

Reaching for a hash table on every counting or lookup problem is the right reflex. Explaining what happens when two keys collide, why deletion needs a tombstone slot, or how a poor hash function degrades an O(1) average into an O(N) worst case is what separates the engineers who call dict() from the engineers who could implement one on a whiteboard. Most interviewers know which group they have in front of them within the first minute.

This course rebuilds your understanding of hash tables from the hash function up. You learn the four standard collision resolution strategies, the five hashing patterns that cover almost every hash table interview question, and you finish by designing an LRU cache and a randomised set of your own.

Requirements

The course assumes you can read code in any mainstream language and have a working sense of how an array sits in memory.

  • Comfort writing loops, conditionals, and functions in at least one language.
  • Familiarity with basic Big-O notation (O(N), O(log N), O(1)).
  • A working sense of how arrays and linked lists behave, since both underpin the hash table implementations.

Overview

A hash table is the data structure interviewers expect you to reach for whenever a problem mentions counts, lookups, or duplicates. Every mainstream language ships one: Python's dict, Java's HashMap, C++'s unordered_map, JavaScript's Map, Go's map. They all share the same three internal pieces: an indexed array of slots, a hash function that converts a key into an index, and a collision resolution mechanism that decides where a key goes when another key already lives there.

Representation of a hash table

The course covers both halves of the problem: how the data structure actually works under the hood, and how to recognise which of the five standard patterns a given problem fits.

Fundamentals

The course opens with the problem hash tables exist to solve. You see why storing key-value mappings in two parallel arrays forces an O(N) linear scan on every lookup, and how introducing an indexed bucket array with a hash function collapses that lookup to average O(1). From there you study the hash function itself as a mathematical map, and you compare four concrete families: identity, trivial digit extraction, division by modulus, and mid square. Each one is evaluated against the three properties of a good hash function: uniform distribution, deterministic output, and constant-time computation.

The middle of the course is the collision resolution material most resources skip. You implement four strategies in turn: separate chaining with a doubly linked list per bucket, then linear probing, quadratic probing, and double hashing as three flavours of open addressing. For each strategy the course walks the same three operations - search, insert, and delete - so the differences between primary clustering, secondary clustering, and probe-step variation become concrete instead of abstract. You also learn why open addressing needs an EMPTY, DELETED, OCCUPIED slot-state machine and why a missing tombstone silently breaks search.

The fundamentals close with load factor and resize behaviour, so you can explain why the average in "average O(1)" is doing real work, and what determines whether a given table degenerates into a long chain or a long probe.

Problem solving

After the fundamentals, the rest of the course is patterns. Most hash table problems you will see in an interview reduce to one of five templates. Read the problem, name the template, and the choice of key, value, and update step becomes the only remaining decision.

The 5 hash table patterns you'll master
Counting
Map each item in a sequence to its running frequency in a hash table, the default approach whenever a problem mentions occurrences, duplicates, or "most common", running in O(N) time. First Non Repeating Character, Constructibility Check, Anagram Checker, Build Palindrome, Cluster Anagrams.
Pattern generation
Assign each sequence a unique signature string by mapping first occurrences to indices through a hash table, the trick that lets you compare two sequences for shared structure regardless of the actual items in O(N) time. Row Specific Words, Homomorphic Strings, Pattern Matching, Cluster Displaced Strings.
Fixed sized sliding window
Slide a length-k window across the sequence while a hash table tracks every item currently inside it, processing each window in amortised O(1) via one insertion and one removal per step. Duplicate Detection, Subarray Distinctness, Contains Variation, Anagram Finder.
Variable sized sliding window
Expand and contract a window with two moving boundaries while a hash table tracks the items inside, solving constraint-based subarray questions in O(N) time and O(K) space. Unique Character Span, K Characters Span, Maximal Character Swap, Subarray Sum Equals K, Twin In Proximity.
Prefix sum
Map every running prefix aggregate of a sequence to its index in a hash table, enabling O(1) subarray aggregate queries and turning O(N²) brute force into a single O(N) pass. First Equilibrium Point, Self Excluded Array Product, Balanced Binary Subarray, Zero Sum Subarrays.

Each pattern is taught in three layers. An Understanding lesson explains the technique on a problem where the pattern is obvious. An Identifying lesson teaches you the wording in a problem that flags it as a counting, window, or prefix-sum question before you start coding. Then four to five problems give you progressively harder applications. The course finishes with two design capstones: an LRU cache built on a hash table backed by a doubly linked list, and a randomised set with O(1) insert, remove, and uniform random access. By the end you can both use a hash table and build one.

How this course is different

Most hash table material on the internet either skips the collision strategies or skips the patterns. This course gives both equal weight.

Most DSA resources
This course
âś—Teach "use a hash map" as the entire lesson, then jump to problems.
✓Derives the data structure from the parallel-array problem, so the O(1) average has a reason behind it.
âś—Skip collision resolution entirely, leaving you unable to explain how dict works.
✓Implements separate chaining, linear probing, quadratic probing, and double hashing in full, including the EMPTY, DELETED, OCCUPIED slot states.
âś—Treat probing as one technique instead of three distinct strategies with different clustering behaviour.
✓Compares primary clustering, secondary clustering, and the double-hash step that breaks both.
âś—Show counting and prefix sum as separate tricks with no shared structure.
✓Groups all five patterns by their key-value choice and update mechanic, so you see what they share.
âś—Stop at usage and never have you implement a hash table from scratch.
✓Ends with an LRU cache and a randomised set you build yourself.

Who this course is for

The course suits anyone who needs to actually understand hash tables rather than just type dict() and hope.

  • New programmers who have used a hash map but never thought about what happens on a collision.
  • Self-taught and bootcamp graduates who can solve a counting problem but stall when the key has to be derived from the input.
  • Working developers who use HashMap or unordered_map daily but cannot explain why average O(1) can degrade to O(N).
  • Engineers preparing for FAANG and Big Tech interviews where LRU cache, anagram clustering, and subarray-sum questions appear in nearly every onsite.
  • Returning engineers who learned hashing years ago and want a refresher that covers all four collision strategies side by side.
  • Anyone who has been asked "implement a hash table" in a real interview and wants to walk in with a complete answer instead of a hand wave.

Continue your DSA journey

Hash tables sit at the centre of the DSA curriculum because they show up inside almost every other pattern. After this course, the natural next steps depend on what you want to deepen.

  • Array: The hash table is built on top of an array, and several of the patterns in this course (fixed window, variable window, prefix sum) are array patterns where the hash table is the auxiliary structure. Working through the array course makes the underlying mechanics second nature.
  • Singly linked list: Separate chaining uses a linked list per bucket, and the LRU cache capstone is a hash table glued to a doubly linked list. The linked list course makes both implementations cleaner.
  • Heap: Several frequency-based interview questions ("top k most frequent") combine a hash table for counting with a heap for the top-k step. The two structures are commonly paired in onsites.
  • Sorting: Many hash table problems have a sorting alternative that trades O(N) time and O(N) space for O(N log N) time and O(1) space. Knowing both options lets you choose the right one under interview constraints.
  • Dynamic programming: DP problems often use a hash table for memoisation when the state space is sparse or non-integer. The prefix sum pattern in this course is also a stepping stone to DP-style state caching.
  • Bit manipulation: Bitmasks are essentially compact hash sets when the key space is bounded. Several pattern-generation and counting problems have a bitmask variant that runs faster in practice.

Frequently asked questions

Code examples use Python for readability, but every concept (hash function, probing, slot states, load factor) is language-agnostic. The course explicitly shows how dict in Python, HashMap in Java, and unordered_map in C++ map onto the same internal machinery.
Yes. The course starts from the parallel-array problem and derives the hash table from there. If you can write a for loop in any language and read Big-O notation like O(N), you have everything you need. A basic familiarity with arrays helps but is not required.
There are around 41 lessons across 11 sections and 28 problems, including four collision-resolution design problems and two design capstones (LRU cache and randomised set). Most learners finish the lessons in 13 to 19 hours and need another 12 to 20 hours to solve the problems.
Hash tables appear in a large share of onsite questions, either as the main data structure or as the auxiliary structure that turns O(N²) into O(N). The five patterns covered here, counting, pattern generation, fixed window, variable window, and prefix sum, cover most of the hashing questions asked. The LRU cache capstone is itself a frequently asked onsite question.
LeetCode shows you problems one at a time with no grouping. This course teaches the five templates first, then drills problems within each template so you build pattern recognition. It also teaches the internals (hash function design, probing, deletion tombstones) that LeetCode never tests but interviewers regularly ask about.
Separate chaining stores every colliding key in a chain data structure (usually a doubly linked list) at the same array index, so collisions never affect other slots. Linear probing stores every key directly in the same flat internal array, and on a collision it walks forward slot by slot until it finds an EMPTY or DELETED slot. Chaining handles high load factors gracefully but has worse cache locality. Linear probing has excellent cache behaviour but degrades sharply once the load factor passes around 0.7, and it suffers from primary clustering where long runs of occupied slots make probes longer for everyone.
A hash table is the underlying data structure. A hash map and a dictionary are the same idea wearing different names: a hash table that stores key-value pairs (Java's HashMap, Python's dict, C++'s unordered_map). A hash set stores keys only, with no associated value (Java's HashSet, Python's set, C++'s unordered_set). All four sit on the same engine, the only difference is whether each slot stores a key on its own or a key plus a value.
Yes. Once you finish all lessons and both design capstones, codeintuition issues a shareable certificate you can post to LinkedIn or attach to a job application.