100 JavaScript coding questions
- Write a function to reverse a string.
- Check if a string is a palindrome.
- Count the number of vowels in a string.
- Find the factorial of a number.
- Check if a number is prime.
- Print Fibonacci sequence up to n terms.
- Write a function to find the largest number in an array.
- Write a function to remove duplicates from an array.
- Check if two strings are anagrams.
- Return the sum of all even numbers in an array.
- Capitalize the first letter of every word in a sentence.
- Write a custom implementation of
.map(). - Write a function that flattens a nested array.
- Implement a debounce function.
- Implement a throttle function.
- Write a function to check if an object is empty.
- Convert an object to an array of key-value pairs.
- Write a function to find the intersection of two arrays.
- Write a function to count the frequency of elements in an array.
- Write a function that returns the longest word in a sentence.
- Create a function that deep clones an object.
- Implement a function that checks deep equality.
- Implement a basic memoization function.
- Write a function to group objects by a key.
- Implement a curry function.
- Write your own version of
bind. - Simulate the
newkeyword in JS. - Simulate the
instanceofoperator. - Create a polyfill for
Array.prototype.reduce. - Implement a simple promise-like structure.
- Compose multiple functions together.
- Write a custom event emitter (Pub/Sub).
- Write a function to shuffle an array (Fisher-Yates).
- Implement a binary search algorithm.
- Write a function to find the nth largest number in an array.
- Implement a function that returns all permutations of a string.
- Implement
once()function (executes only once). - Convert Roman numerals to integers.
- Evaluate a simple mathematical expression string (e.g. "2 + 3 * 4").
- Implement a basic LRU cache.
- Generate all combinations of balanced parentheses.
- Solve the Tower of Hanoi.
- Find all subsets (power set) of an array.
- Implement merge sort.
- Implement quick sort.
- Implement binary search recursively.
- Find the lowest common ancestor in a binary tree.
- Serialize and deserialize a binary tree.
- Solve N-Queens problem.
- Check if a string has valid parentheses using stack.
- Count unique paths in a grid (dynamic programming).
- Find the longest common prefix among an array of strings.
- Implement a Trie data structure.
- Implement BFS and DFS on a graph.
- Check if a graph is cyclic.
- Detect if a number is a happy number.
- Find the first non-repeating character in a string.
- Implement Kadane's Algorithm.
- Solve the coin change problem.
- Find the longest increasing subsequence.
- Implement a stack using arrays and linked lists.
- Implement a queue using arrays and linked lists.
- Build a linked list from scratch.
- Implement a doubly linked list.
- Create a hash table (object-based).
- Implement a basic binary search tree.
- Write a min-heap / max-heap.
- Create a priority queue.
- Build a graph using adjacency list.
- Design and implement a Set class with union, intersection, and difference.
- Explain and implement closures in various examples.
- Simulate
call,apply, andbind. - Create your own async/await with generators.
- Implement a retry mechanism for async functions.
- Debounce vs Throttle β build both with UI.
- Simulate JavaScriptβs event loop and microtask queue.
- Create a virtual DOM and diffing algorithm (simplified).
- Implement a mini state management system (like Redux).
- Write a basic templating engine.
- Build a basic reactive system (like Vue's reactivity core).
- Implement a modal popup from scratch.
- Build a simple image slider.
- Create an infinite scroll.
- Make a to-do list with localStorage.
- Build a drag-and-drop list.
- Build a calculator with keyboard support.
- Build a stopwatch/timer.
- Create a quiz app with score tracking.
- Build a weather app using any API.
- Create a Markdown previewer.