JavaScript Algorithm Interview Problems: 8 Patterns with Solutions
Learn eight JavaScript algorithm interview patterns with worked solutions: array transforms, hashing, interval scans, matrix rotation, and async sequencing.
Coding-challenge walkthroughs and data-structure problems.
8 articles
Learn eight JavaScript algorithm interview patterns with worked solutions: array transforms, hashing, interval scans, matrix rotation, and async sequencing.
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise).
Given a set of distinct integers array ```myArray```, return all possible subsets (the power set).
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.
should return square array.
Check if the predicate (second argument) is truthy on all elements of a collection (first argument).
Given a collection of intervals, merge all overlapping intervals.
Group anagrams in JavaScript two ways: a sorted-string hash key (O(n·k log k)) and the optimal character-count key (O(n·k)). Clean code, complexity analysis, and the interview follow-ups.