
An introduction to the course. A text version is available immediately afterward.
Write a function to determine if every character in a string is unique, with case sensitivity. Use lastIndexOf to verify uniqueness or sort and compare adjacent characters.
Master the JavaScript interview teaches rapid string processing by detecting duplicates with a seen-characters structure, achieving O(n) time and O(n) space, and using a set for a simpler solution.
Use a set to detect duplicates by inserting each character of a string and comparing the set size to the string length, achieving linear time.
Flatten a deeply nested array by writing a recursive function that extracts every item into a single flat array, preserving original order for numbers, strings, and objects.
The lecture explains flattening arrays with recursion, showing each item is processed once, yielding linear time complexity and space proportional to input.
Write a function that returns a string with duplicates removed while preserving the original order of characters. The lesson contrasts array-based and object-based lookups to improve time and space complexity.
Learn to determine if two strings are rotations by ensuring equal length, generating rotations with slice, and using the doubled string trick to check inclusion of the second string.
Evaluate whether the second array is a subset of the first by ensuring every item appears in the first, accounting for repeats and size.
Explore double array algorithms by verifying subset relationships using a counting object to track item frequencies, avoiding mutating inputs and comparing time and space complexity.
Learn to solve the array subset problem with a map that accepts any key type (numbers or strings) and counts occurrences, instead of using objects whose keys coerce to strings.
Use a brute force approach to maximize stock profits by checking every buy-sell pair, storing profits, and returning zero when no profit exists.
Learn to calculate the maximum profit in a single pass by tracking the smallest price seen so far and updating the max profit, achieving linear time and constant space.
Identify if two strings are identical except for at most one mutation: a deletion, insertion, or substitution, by scanning with two indices, counting mutations, and adjusting indices as needed.
Count character frequencies for each string, build a character-count object, and compare these objects across all strings to verify anagrams. Refactor into a function and analyze time and space complexity.
Master the JavaScript interview by explaining how to rotate a matrix 90 degrees clockwise, using an input array of arrays to produce a new matrix while leaving the original intact.
Master the JavaScript interview by applying a square-matrix rotation algorithm to rotate a matrix by 90 degrees, using 2x2 and 3x3 examples to map indices and extend to square matrix.
Explore bonus functions to rotate a matrix by 180 and 270 degrees, reuse a single working function for both, and compare time and space implications before tackling in place rotation.
Rotate a square matrix in place by 90 degrees clockwise without extra space. Use a layer-by-layer outer perimeter rotation, then handle inner perimeters.
Demonstrate a brute force approach to finding an integer's index in a sorted array by a linear scan, returning the index or -1 with constant space.
Learn to implement binary search on a sorted array, replacing brute force scans with halving the search range using the middle index, and analyze time complexity as log base 2.
Master the balanced brackets problem by using a stack: push open brackets, pop to match closes, return true when all brackets balance and the stack is empty.
Apply a deep equality algorithm to verify two values are identical by recursively comparing object properties and array contents, ensuring same types, counts, and order.
Explore a deep equivalence algorithm that validates JavaScript values by their types, handling null, primitives, and objects, including nested structures and arrays, with a recursive solution.
Build a function to compute the Fibonacci sequence with a brute-force approach, then introduce memoization to cache values and optimize the calculation in JavaScript.
Obtain faster Fibonacci with memoization by storing computed values in a shared array via an immediately invoked function expression, allowing subsequent calls to reuse results and extend the sequence.
Compare the brute force fibonacci with a memoized version to demonstrate memoization performance gains, as timing shows near a second versus four milliseconds and a multi-order-of-magnitude speedup.
Explore how setTimeout and a looping variable interact in JavaScript, showing why the code prints 6 five times at one-second intervals and how to print 1–5 instead.
Learn to implement a versatile add function in JavaScript that adds two numbers, returning a function when given one argument and using closures to retain scope for the second value.
Extend the add function to handle intermediate function calls and undefined arguments by returning a function until the second number arrives, enabling a more versatile addition workflow.
Explore versatile add, showing how to begin with an arbitrary number of empty invocations at the start and return the function until a value arrives, producing 7 and 22.
Master the JavaScript interview by practicing this set of carefully curated interview questions and solutions. These problems will provide the programming tools you need to tackle any question you find in an interview.
Most questions have multiple solutions presented. All solutions are thoroughly explained and time and space complexity are discussed. A passing familiarity with these ideas is expected. You'll learn how to tackle different types of problems so you can proceed with confidence in your interviews.
These questions go beyond the common problems that we've all seen. FizzBuzz and bubble sort? We start past those.
We'll discuss how to refine algorithms. We'll go over clever, advanced ways of manipulating data that interviewers are looking for. You'll walk away more skilled and confident in your problem solving and interviewing abilities.