A typical JavaScript/Frontend interview is composed of 4 to 5 rounds.
- JavaScript-related problem solving
- DataStructures and Algorithms
- Machine-Coding round
- Web fundamentals
- Frontend system design
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, promises, hoisting, & other JavaScript-core concepts problems.
You can also checkout my youtube playlist where I am solving one question daily for 100 days that can help you to prepare and crack your JavaScript interview.
JavaScript concepts revision
- ES6 Intro
- Babel
- let vs var in javascript
- Template Strings
- Function & this in JavaScript
- Javascript Fat Arrow Function
- Functions with default parameters in javascript
- What are Pure and Impure functions in JavaScript
- ES6 Object Literals
- Javascript set
- Javascript Map
- Javascript Spread and Rest Operator
- Javascript destructuring
- Introduction to es6 class
- ES6 Modules
- Javascript Symbol
- Javascript Iterator
- Understanding closure in JavaScript
- Understanding powerful Array.reduce() method
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 check out 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.
- Iterative binary search in javascript.
- Search in a sorted rotated array.
JavaScript specific problems
I am currently working on this list, these are a few random questions, you can find the full list here.
- Implement mapLimit async function
- Execute async functions in parallel in JavaScript
- HTML encoding of a string
- Implement an in-memory search engine
- Highlight the words in the string
- Throttle an array of task
- Circuit breaker in JavaScript
- Get different value of Object property in JavaScript
- Create analytics SDK in JavaScript
- Fetch with Timeout in JavaScript
- Debouncing with leading and trailing options
- Cached api call with expiry time
- Piping function in JavaScript โ Part 2
- Aggregate the Input values
- Handle race condition in React
- Run useEffect() hook only on update in React
- Set object value at the string path
- Get object value from string path
- Create custom cookie in JavaScript
- Piping function in JavaScript โ Part 1
- Fetch request and response interceptor
- Make high priority Api call in JavaScript
- Aggregate array of objects on the given keys
- Filter array of objects on value or index
- Currying โ part 4
- Currying โ part 3
- Implement browser history in JavaScript
- Method chaining in JavaScript โ Part 2
- Method chaining in JavaScript โ Part 1
- Implement getByClassNameHierarchy() function in JavaScript
- Array with event listeners in JavaScript
- CSS selector generator
- Localstorage with expiry
- Array iterator method in JavaScript
- Convert JSON to HTML
- Find element with the given color property
- Get object value from the string path
- Share data between two browser window with JavaScript
- Piping function in JavaScript โ Part 1
- 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 (Machine-Coding)
- 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.
- User profile viewer in javascript.
- Roman to numeral converter javascript.
- Tic tac toe game in javascript with bot.
- Create website walkthrough assistant in JavaScript
- Chrome Extension to use ChatGPT anywhere
React questions (Machine coding)
- Create a lightbox (modal-image-gallery) in Reactjs
- Create responsive slideshow gallery in Reactjs
- Responsive slideshow in Reactjs
- Search with pagination in Reactjs
- Editable todo-list in React
- Multi-Stepper component in React
- Implement Feature Flag component in React
- useCopy() hook in React
- Implement Infinite Scroll in React
- Switch-Case component in React
- useToggle() hook in React
- useHasFocus() hook in React
- useOnClickOutside() hook in React
- Two-step login form in React
- useScript() hook in React
- useOnScreen() hook in React
- useWhyDidYouUpdate() hook in react
- useThrottle() hook in React
- useResponsive() hook in React
- useDebounce() hook in React
- useAsync() hook in React
- useIdle() hook in React
- usePrevious() hook in React.
- Create scrollspy in react
- Image comparison slider in react
- Create loader component in react
- Typing effect component in react
- Create tooltip in react
- Create scroll indicator in react
- Create timeline in react
- React image zoom
- React drag and drop list of elements
- Create slider in react
- Login form component in react
- Lazy loading component in react.
- Create voice visualizer in react
- Create modal component in react
- Create alert box in react
- Create tabs in react
- Sliding sidebar menu with hamburger in react
- Create autocomplete search in react
- Create dropdown in react
- Create accordion in react
- Pagination component in react
- Create progress bar in react
- Toggle switch in react
- Create select dropdown in react
- Create file uploader in react
- Create checkbox group component in react
- Create radio group component in react
- Create checkbox in react
- Create input component in react
- Create custom button component in react
Web fundamentals
- Testing Strategies: Ensuring Quality in Software Engineering
- How a web page is rendered in browser?
- Anatomy of URL
- The frontend Landscape โ Different Architectures
- Reactivity in JavaScript frameworks
- Tree shaking in JavaScript and how it helps
- Load websites faster with Code Splitting
- Monorepo vs Polyrepo in frontend
- Data Normalization of Frontend State
- Static site generation (SSG) vs Incremental Static regeneration (ISR)
- Single-Page Application (CSR) vs Multi-Page Application (SSR)
- Authenication on the web and its best practices
- Understanding the Cross-Site scripting (XSS) attacks
- Decoding and preventing the Cross-Site forgery (CSRF) attacks
- Understanding the Cross-Site scripting (XSS) attacks
Frontend System Design
- What is System Design in Software Engineering?
- What to expect in Frontend System Design?
- Design the video streaming web app like Netflix, Youtube, Prime videos.
- Design a trello / kanban board
- Design a food ordering web app like Swiggy, Zomato, Uber eats
- Design collaborative text editor
- Design an form enricher, shortner SDK
- Design news feed of Facebook, Twitter, Linkedin
- Design a configurable frontend application with different login type
- Design the frontend of the group or suite of apps
- Design the frontend of the Pinterest or Google photos
- Design the frontend of the Instagram
Design patterns
- Builder design pattern in JavaScript
- Iterator design pattern in JavaScript
- Container and Presentational pattern in React
- Prototype design pattern in JavaScript
- Higher-order component pattern in React
- Provider design pattern for Reactjs
- Proxy design pattern in JavaScript
- Observer design pattern in JavaScript
- Singleton design pattern in JavaScript
Interview Experience
- Frontend Interview Process at Atlassian
- Frontend Interview Process at Coursera
- Razorpay frontend interview experience
- Fullstack interview experience at Nutanix
- OLA-SDE2-Frontend Interview Experience
- Dream11 โ SDE2 โ Frontend Interview Experience
- Reliance JIO interview experience
More questions will be added to it as and when I write them.
All the very best!.