Commonly Asked Coding Problems in JavaScript Interviews

Photo from Unsplash (

JavaScript is changing every year. There are always new libraries, new frameworks and new things around it. Every year new developers are coming to learn this language and the jobs are increasing so as the interviews.

This post contains some practical and commonly asked coding problems that can be found in any technical interviews. So be not surprised while facing them.

Remove duplicate element from an array

Using Array.filter method, check each element's index is equal to the indexOf value of the array.

Or in ES6 using set:

Reverse a string without native methods

Given a string, print the reverse of the string (ex: javascript becomes tpircsavaj).

Without native methods:

Using recursion:

Find the missing number

Given a unsorted array of numbers 1 to 100 excluding one number, find the missing number.

The sum of a linear series of n numbers is equal to n*(n+1)/2.

Permutations of a string

Get all permutations of a string

Check sum of two

From a unsorted array, check whether there are any two numbers that will sum up to a given number.

Another way of doing, have an object where we will store the difference of sum and element. And then when we get to a new element and if we find the difference is the object, then we have a pair that sums up to the desired sum.

Brackets match

For the given string, determine if the strings of brackets in the input is valid or invalid by these criteria.

“([)]” // false
“()” // true

The solution is

This post contains only a handful of examples from our recently published app JS Code Samples. This app contains many examples varying from variable scope to coding problems like these. You can download the app from the below link.

Play Store link




Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vigo Webs

Vigo Webs

More from Medium

Design a stack with a min() function in Javascript

7 JavaScript Design Patterns Every developer should knows.

Front-end and Back-end Explained In Layman’s Terms

A group of people building the front end for a mobile application

[Git]Front End Developer Interview Questions [Git]