I am currently running #250DaysOfJSQuestions on twitter where I share one JavaScript interview questions daily, follow me on twitter @learnersbucket for web dev and interview related content.
In 2019 January, during the lockdown, I had started solving problems in JavaScript and writing articles on it on my blog, over the time I have solved 300+ problems. This cheat sheet contains list of problem that can be asked to a JavaScript dev.
This is a curated list of solved problems in JavaScript categorized on the type & nature of the problem which you can refer to and use as a cheat sheet for interview preparation.
It contains Data Structures & Algorithms, functions, async, closure, & hoisting-related problems.
DataStructures
- Javascript array: Complete reference.
- Javascript Objects: Complete Reference.
- Javascript String: Complete Reference.
- Implement Stack data structure in javascript.
- Queue data structure in javascript.
- List data structure in javascript.
- Linked list data structure in javascript.
- Implement stack using linked list.
- Implement queue using linked list.
- Doubly linked list implementation in javascript.
- Implement deque data structure in javascript.
- Deque data structure with doubly linked list.
- Circular linked list implementation in javascript.
- Circular Doubly linked list in javascript.
- Priority Queue Implementation in javascript.
- Tree data structure in javascript.
- Heap data structure in Javascript.
- Treap data structure in Javascript.
- Trie data structure in Javascript.
- Javascript graph data structure.
- AVL Tree in Javascript.
Algorithms
It contains only the important ones, you can checkout the whole list here.
- Implement Stack data structure in javascript.
- Print all subarrays with a given sum k in an array.
- Program to check if a subarray with 0 sum exits or not.
- Find distinct ways to climb the stairs in javascript.
- Caesar Cipher in javascript.
- Count all substrings having character k.
- Number of subarrays with given sum k.
- Implement a Stack using Queue.
- Implement queue using two stack.
- Learn how to implement two stack with an array.
- Alternatively merge two different arrays.
- Implement stack with max and min function.
- Merge two sorted linked list.
- How to find loop in linked list.
- Find height and width of binary tree.
- Tree traversal in Javascript.
- Flood fill algorithm in javascript.
- Find longest palindrome in a string.
- Find all anagrams substring in a string.
- Find the largest sum of contiguous subarray.
- Check if binary tree has path sum.
- Rotate matrix 90 degrees clockwise and anti-clockwise.
- Find the intersection point of two linked list.
- Trapping rain water in javascript.
- Diagonal traversal of binary tree.
- Check if binary tree is symmetric.
- Find floor and ceil of binary search tree.
- Find Least Common Ancestor (LCA) of binary tree.
- Find kth smallest and largest element in BST.
- Serialize and Deserialize Binary Tree.
- Find inorder successor of a given key in a BST.
- Find inorder predecessor of a given key in a BST.
- N meetings in one room.
- knapsack problem in Javascript (Bounded & Unbounded).
- LRU cache in Javascript.
- Fractional knapsack problem.
- Longest Common Subsequence.
- Longest repeated subsequence.
- Longest Consecutive Sequence.
- Deepest leaves sum of binary tree.
Sorting
- Selection sort in javascript.
- Dutch national flag problem.
- Bubble sort algorithm in javascript.
- Recursive Bubble sort algorithm.
- Insertion sort algorithm in javascript.
- Recursive Insertion Sort Algorithm.
- Sorting a linked list.
- Bubble sort using two stacks.
- Merge sort in javascript.
- Iterative merge sort algorithm.
- Merge sort a linked list.
- Quick sort algorithm in Javascript.
- Quick sort Iterative.
- Quick sort using linked list.
- Heap sort algorithm in Javascript.
- Iterative heap sort in Javascript.
- Counting Sort Algorithm In Javascript.
- Radix sort algorithm in Javascript.
- Bucket Sort Algorithm.
- Shell Sort Algorithm In Javascript.
Searching
- Linear search algorithm in javascript.
- Binary search in javascript.
- Binary search in javascript.
- Search in a sorted rotated array.
JavaScript specific problems.
I am currently working on this list, these are few random questions, you can find the full list here.
- How to merge objects in javascript.
- Compare two array or object with JavaScript.
- What is debouncing in javascript?.
- What is throttling in javascript?.
- Number increment counter in Javascript (React).
- Detect idle state (inactive) in Javascript.
- Deep flatten object in Javascript β 1.
- Currying in JavaScript.
- Capture product visible on viewport when user stops scrolling.
- Animate elements in a sequence.
- Create Pausable auto incrementer.
- Implement clearAllTimeout in JavaScript.
- Implement ClearAllInterval in JavaScript.
- Singleton design pattern in JavaScript.
- Observer design pattern in JavaScript.
- Remove cycle from the object in JavaScript.
- Execute async functions in Series.
- Retry promises N number of times in JavaScript.
- In-memory filesystem library in JavaScript.
JavaScript projects.
- Create simple calculator with javascript.
- Whack a mole game in javascript.
- Rock, Paper, Scissor, Lizard, Spock game in javascript.
- Eye follow cursor in javascript.
- Text typing effect in javascript.
- Word falling effect in javascript.
- Day night toggle switch in javascript.
- Day night toggle switch in javascript.
- Roman to numeral converter javascript.
- Tic tac toe game in javascript with bot.
More questions will be added to it as and when I write them.
Top comments (1)
Great resources thanks for sharing them all.