Courses / DSA Patterns for Working Engineers
Course · Beta · FreeDSA Patterns for Working Engineers
Short lessons, one pattern per chapter. Start with how a coding round runs and how to read a problem's limits, then work through pointers, windows, intervals, linked lists, heaps, binary search, subsets, greedy choices, backtracking, dynamic programming, sorting, matrices, stacks, graphs, trees, tries, hash maps, union-find, custom structures, bits and maths, monotonic stacks, prefix sums, range queries and the deeper graph algorithms. Each lesson solves one original problem in TypeScript, ends with a short quiz and links related LeetCode problems.
0 of 39 chapters done · saved on this device
Try a scene from chapter 1
a1 is not in the set yet, so it is added
Read it as steps
A set records each id until one arrives twice
What you will be able to do
- Read a problem's limits and choose an approach that fits the time budget
- Recognise the pattern a new problem hides from its wording, input shape and limits
- Write tested TypeScript for heaps, tries, union-find, caches and graph searches
- Prove a greedy choice or a binary search check before you rely on it
- Define a DP state and transition, fill the table and recover the actual answer
- Solve two medium problems in 45 minutes while explaining each step out loud
Who it is for
Working engineers with about 2 to 10 years of experience, mostly in JavaScript or TypeScript, who build products every day but have not solved algorithm problems since college and now face coding rounds at product companies, GCCs and global teams. Students who know one language well can follow too.
You will need
Comfort writing JavaScript or TypeScript: functions, arrays, objects, classes and loops. Node 22.18 or later to run TypeScript files directly (the course is tested on Node 24). School-level maths; logarithms and bits are explained when they first appear.
Pick a path
Curriculum
12 modules · 39 chapters · 22 hModule 1The coding interview0 of 1 done
How a coding round runs and is scored, a method for problems you have not seen, budgeting time from the limits, and running TypeScript on Node.
Module 2Pointers, windows, intervals and linked lists0 of 5 done
Walk sequences with two indices, at two speeds or with a sliding window, merge and count overlapping intervals, and rewire linked lists in place.
- Not started: 02Two Pointers: Pairs, Partitions and In-Place Scans35 min · 2 scenesOpposite-end pairs, triples, partitions and read-write heads, with why each discard is safe
- Not started: 03Fast and Slow Pointers: Cycles, Midpoints and Repeats27 min · 2 scenesTwo speeds on one sequence: detect cycles, find their entry and middle, and spot repeats in O(1) space
- Not started: 04Sliding Windows: Fixed and Variable Ranges Over Sequences29 min · 2 scenesFixed and variable windows, the counts inside them, why they run in O(n), and when negatives break them
- Not started: 05Intervals: Merging, Inserting and Counting Overlaps31 min · 2 scenesSort by start, merge and insert ranges, intersect schedules, count rooms with a sweep, cancel the fewest
- Not started: 06In-Place Linked List Changes: Reversal, Reordering and Rotation29 min · 2 scenesReverse whole lists, segments and groups, reorder and rotate them with O(1) extra space
Module 3Heaps, k-way merges and top k0 of 3 done
Build a binary heap, keep two of them balanced for running medians, merge many sorted streams, and pick the k best without sorting everything.
- Not started: 07Heaps and Two Heaps: Running Medians and Priority Scheduling33 min · 2 scenesBuild a typed binary heap, then pair a max-heap and a min-heap for medians and scheduling
- Not started: 08K-Way Merge: Combining Sorted Streams With a Heap27 min · 2 scenesMerge k sorted lists with a heap of heads, find kth items across lists, and cover k lists with one range
- Not started: 09Top K Elements: Size-K Heaps, Buckets and Quickselect40 min · 2 scenesKeep the k best with a size-k heap, count with buckets, or partition with quickselect
Module 4Binary search, subsets, greedy, backtracking and DP0 of 5 done
Halve a search space without off-by-one bugs, enumerate every subset, make local choices you can prove, prune a search, and stop repeating work with DP.
- Not started: 10Modified Binary Search: Bounds, Rotations and Searching the Answer38 min · 2 scenesOne half-open template for bounds, rotated data, peaks and answer searches, tested at the edges
- Not started: 11Subsets: Every Subset, Permutation and Combination31 min · 2 scenesGenerate subsets, orders and combinations by include-exclude, iteration and bitmasks, and count them
- Not started: 12Greedy Techniques: Safe Local Choices and How to Prove Them45 min · 2 scenesProve a greedy choice with stays-ahead and exchange arguments, and catch the ones that fail
- Not started: 13Backtracking: Choose, Explore, Undo and Prune38 min · 2 scenesThe choose-explore-undo template, pruning that cuts the search, and boards, grids and partitions
- Not started: 14Dynamic Programming: States, Transitions and Tables43 min · 3 scenesDefine a state and a transition, memoise or fill a table, shrink its space, and recover the answer
Module 5Cyclic sort, topological sort, and sort and search0 of 3 done
Put values in their own slots, order tasks by their dependencies, and sort first so the search afterwards is fast.
- Not started: 15Cyclic Sort: Placing Each Value at Its Own Index28 min · 2 scenesSort values in 1 to n with at most n - 1 swaps, then read missing and repeated values in O(1) space
- Not started: 16Topological Sort: Ordering Tasks by Their Dependencies37 min · 2 scenesOrder tasks with Kahn's in-degree queue or DFS, run them in waves, and report a cycle
- Not started: 17Sort and Search: Sort Once, Then Search Fast37 min · 2 scenesSort with the right comparator, then use binary search or two pointers on the sorted data
Module 6Matrices, stacks and graphs0 of 3 done
Walk and rewrite 2-D grids in place, use stacks for matching, parsing and next-greater questions, and model problems as graphs searched breadth first and depth first.
- Not started: 18Matrices: Traversals, Rotations and In-Place Marking30 min · 2 scenesIndex 2-D grids safely, rotate and spiral them, and mark cells in place without extra space
- Not started: 19Stacks: Matching, Parsing and Nested Structure31 min · 2 scenesMatch brackets, evaluate formulas, decode nested labels, time nested calls and clean up paths
- Not started: 20Graphs: Modelling, Breadth-First and Depth-First Search39 min · 3 scenesStore graphs, search them breadth first and depth first, detect cycles, colour two sides
Module 7Trees and tries0 of 3 done
Recursion that returns answers upward on binary trees, level-by-level searches, and prefix trees for search and autocomplete.
- Not started: 21Tree Depth-First Search: Recursion That Returns Answers Upward36 min · 2 scenesPre-, in- and post-order recursion on binary trees: depths, diameters, paths, ancestors, rebuilds
- Not started: 22Tree Breadth-First Search: Level by Level28 min · 2 scenesLevel-order with a queue and a level-size snapshot: zigzags, side views, averages and next pointers
- Not started: 23Tries: Prefix Trees for Search and Autocomplete27 min · 2 scenesBuild a trie for prefix search, keep suggestions on nodes, match wildcards and prune grid word searches
Module 8Hash maps, tracking, union-find and custom structures0 of 4 done
Use maps for lookups, complements and prefix counts, choose what to count, merge groups with union-find, and compose maps, lists and arrays into new structures.
- Not started: 24Hash Maps: Lookups, Complements and Pattern Matching32 min · 1 sceneHow hash tables work, then complements, rate limits, pattern matches and grouping with Map and Set
- Not started: 25Knowing What to Track: Counts, Signatures and Frequencies34 min · 2 scenesChoose the counts, signatures and running totals a problem needs, and the cheapest structure to hold them
- Not started: 26Union-Find: Merging Groups and Finding Redundant Links31 min · 2 scenesDisjoint sets with path compression and union by size, for groups, redundant links and flooding grids
- Not started: 27Custom Data Structures: Composing Maps, Lists and Arrays36 min · 2 scenesDesign structures from their operation costs: LRU and LFU caches, O(1) random sets, versioned arrays
Module 9Bits, maths and mixed practice0 of 3 done
Bitwise tricks and JavaScript's 32-bit operators, number and geometry problems without precision bugs, then timed sets that mix every pattern so far.
- Not started: 28Bitwise Manipulation: Masks, XOR and the 32-Bit Trap34 min · 2 scenesMasks, x & (x - 1), XOR cancellation and bit counts, and where JavaScript's 32-bit operators bite
- Not started: 29Math and Geometry: Precision, Primes, Powers and Points39 min · 2 scenesExact integers and BigInt, digit arithmetic, sieves, fast powers, and point and rectangle tests
- Not started: 30Mixed Practice: Pick the Pattern Under Time34 minThree timed sets of original problems with no pattern named, hints, tested solutions and judge links
Module 10Monotonic stacks, prefix sums and range queries0 of 3 done
Answer next-greater and window questions in linear time, turn range sums into one subtraction, and handle ranges that change with ordered sets, Fenwick trees and segment trees.
- Not started: 31Monotonic Stacks and Deques: Next Greater, Spans and Window Maximums39 min · 2 scenesKeep a stack or deque in sorted order to answer next-greater, span and window-maximum questions in O(n)
- Not started: 32Prefix Sums: Range Totals, Counts and Difference Arrays37 min · 3 scenesRange sums in O(1), counting stretches with a target sum, difference arrays, 2-D blocks and weighted picks
- Not started: 33Range Queries: Ordered Sets, Fenwick Trees and Segment Trees32 min · 2 scenesKeep sorted sets, and answer range queries while values change, with Fenwick and segment trees
Module 11Graph algorithms0 of 5 done
Breadth-first search over puzzle states, grids treated as graphs, weighted shortest paths, minimum spanning trees, and bridges, strong components and Euler paths.
- Not started: 34State-Space BFS: Fewest Moves Through Puzzle States37 min · 2 scenesTreat each configuration as a node, encode it as a key, and find the fewest moves with BFS
- Not started: 35Grids as Graphs: Flood Fill, Islands and Spreading34 min · 2 scenesTreat cells as nodes: count regions, spread from many sources at once, and search from the borders
- Not started: 36Weighted Shortest Paths: Dijkstra, Bellman-Ford and 0-1 BFS40 min · 3 scenesDijkstra with a heap, why negative edges break it, Bellman-Ford with k stops, 0-1 BFS, Floyd-Warshall
- Not started: 37Minimum Spanning Trees: Kruskal and Prim33 min · 2 scenesThe cut property, Kruskal with union-find, Prim with a heap or an array, and which edges every tree needs
- Not started: 38Advanced Graph Algorithms: Bridges, Strong Components and Euler Paths34 min · 2 scenesDFS entry times and low links for bridges and cut points, strong components, and Euler paths
Module 12Mock interview0 of 1 done
Five timed problems across the course's patterns, each with a model answer, tests and a scoring rubric.
How this course is made
Written by the aiiolar team. Every chapter is fact-checked by a second reviewer, checked against a shared set of numbers so chapters agree, and checked for originality before it goes up. Found a mistake? Tell us and we fix it within a week.
Questions
Why TypeScript and not Python, Java or C++?
Most engineers this course is for write TypeScript every day, and coding rounds accept it. The course also shows where JavaScript bites in algorithm code: default sorting, number precision past 2^53, 32-bit bitwise operators, recursion depth and the cost of shift().
Are these LeetCode problems?
No. Every problem in a lesson is written for this course. Each lesson links related public problems on LeetCode by name so you can practise the same pattern on a judge; a few of them need a LeetCode subscription and are marked premium.
How is a chapter laid out?
An introduction lesson explains the pattern, how to spot it and what it costs. Then each lesson solves one original problem: the idea, the TypeScript solution, its tests and real output, the complexity, and a two or three question quiz.
Is every solution tested?
Yes. Every solution runs on Node 24 and passes node:test tests, and every output on a page was copied from a real run. Speed claims come from counting operations or timing on a real machine, and say so.
Do I need a computer science degree?
No. Each term is defined the first time it appears, and the first chapter covers complexity and a method for problems you have not seen. A first course in programming is enough.
How much time should I plan?
About 22 hours of reading, plus the time you spend solving. Most engineers preparing for a round do one chapter and two or three linked problems a day for five to seven weeks.
Does it cover system design or machine coding?
No. Those rounds have their own courses on aiiolar. This course is the problem-solving round only.