Sajjaad Khader on YouTube · Open on YouTube
Foundations: programming and problem solving · Novice · Lesson 10 of 98 · 16 min video, then about 1 week of practice
Core data structures: arrays, hash maps, sets, stacks and queues
After this you can choose between an array, a map, a set, a stack and a queue for a given problem and explain the cost of the main operations on each.
Why it matters
Most everyday code is about putting data in a structure that makes the next operation cheap. If you need to look something up by key, use a map; if you need uniqueness, a set; if order of arrival matters, a queue. Choosing well is often the difference between code that is instant and code that times out. Focus on JavaScript's built-ins (`Array`, `Map`, `Set`, plain objects) and understand what each does well. Learn how a hash map works underneath, because it explains why lookups are fast and why keys need to be hashable. Trap: memorising textbook implementations of every structure. At this stage you need to know when to use each, not how to build a red-black tree.
How to use this resource
A clear overview of the core structures and when each one is the right tool.