JavaScript bank Data Structures JavaScript / 23 questions Your progress 0 / 23 done Saved in this browser. Reset All 23 Easy 8 Medium 13 Hard 2 Hide done No questions match those filters. 01 Explain the difference between `map`, `forEach`, `filter`, and `reduce`. Easy 02 Implement `Array.prototype.map` from scratch without using the native method. Medium 03 Implement `Array.prototype.reduce` from scratch, including the initial-value edge case. Medium 04 How does `Array.prototype.sort` work by default? Why is `[10, 2, 1].sort()` surprising? Medium 05 Explain `flat` and `flatMap` and implement a recursive array flatten function for arbitrary depth. Medium 06 What is the difference between mutating array methods (`push`, `splice`) and non-mutating ones (`slice`, `concat`)? Easy 07 Implement a function to remove duplicates from an array while preserving order. Easy 08 Explain stable vs unstable sorting algorithms and whether `Array.prototype.sort` is stable in modern engines. Hard 09 How would you efficiently find the intersection of two large arrays? Medium 10 Implement a debounced search-as-you-type array filter using `filter` and `includes`. Medium 11 Explain array-like objects (e.g., `arguments`, NodeList) and how to convert them to real arrays. Medium 12 Implement a sliding-window function to find the maximum sum subarray of size k. Medium 13 How does `Array.isArray` differ from `typeof` and `instanceof` for detecting arrays? Easy 14 Explain string immutability in JavaScript and its performance implications. Easy 15 Implement a function to check if a string is a palindrome, ignoring case and punctuation. Easy 16 Implement your own `String.prototype.trim` without using the native method. Easy 17 How do template literals differ from string concatenation? Explain tagged templates. Medium 18 Write a function to find the first non-repeating character in a string. Medium 19 Explain Unicode, UTF-16 surrogate pairs, and why `'😀'.length` is 2, not 1. Hard 20 Implement a function that counts the frequency of each character in a string. Easy 21 Explain the difference between `String.raw`, escape sequences, and regular string literals. Medium 22 Write an anagram-checking function and discuss its time complexity trade-offs (sort vs frequency map). Medium 23 How would you implement a basic string compression algorithm (e.g., 'aabcccccaaa' -> 'a2b1c5a3')? Medium ← Previous Objects & OOP Next → Functions