Ultimate List of JavaScript Interview Questions

Check questions and answers by category: for Juniors, Middle and Senior Developers. Choose either theoretical or practical questions. If you have anything to add, please leave a comment.

Questions Level
Question Type
 JavaScript Question № 1 Practical for Senior

How to compare two objects with nested properties in JavaScript?

 JavaScript Question № 2 Theoretical for Middle

List special numeric values.

 JavaScript Question № 3 Theoretical for Senior

Explain the Map , Set , WeakMap and WeakSet .

 JavaScript Question № 4 Theoretical for Middle

List the methods to search in an array.

 JavaScript Question № 5 Theoretical for Middle

What is the purpose of the file package-lock.json ?

 JavaScript Question № 6 Theoretical for Junior

What’s the difference between using var, let, and const?

 JavaScript Question № 7 Theoretical for Middle

What is Cross-Origin Requests and CDN?

 JavaScript Question № 8 Practical for Middle

Does it make sense to add directive use strict in modern scripts?

 JavaScript Question № 9 Theoretical for Middle

What are web workers?

 JavaScript Question № 10 Practical for Middle

Improve the code using ES6

 

 JavaScript Question № 11 Practical for Middle

Write an example of testing the sum function.

 JavaScript Question № 12 Theoretical for Junior

How to show the user a notification that javascript is not enabled by his browser?

 JavaScript Question № 13 Practical for Senior

Give webpack config sample for scss using.

 JavaScript Question № 14 Theoretical for Junior

Why is the order of adding scripts to the page important?

 JavaScript Question № 15 Practical for Senior

Create a script to lazy load the images shown after scrolling.

 JavaScript Question № 16 Theoretical for Junior

How to get the current URL?

 JavaScript Question № 17 Practical for Middle

Write a builder class to create developer instances.

 

 JavaScript Question № 18 Practical for Senior

Create a rectangle object with a private width and public height using the Revealing Module Pattern.

 JavaScript Question № 19 Practical for Senior

Create a function that will receive an estimate as the input and output the average of all previously obtained estimates.

 

 JavaScript Question № 20 Practical for Senior

Write Observer pattern sample.

 JavaScript Question № 21 Practical for Middle

Improve the code using classes.

 

 JavaScript Question № 22 Practical for Middle

What is output?

 

 JavaScript Question № 23 Practical for Senior

How to get the sum of even numbers if the sum of array elements is even and the sum of odd numbers if the sum of array elements is odd? Complete the function without using additional variables.

 

 JavaScript Question № 24 Practical for Middle

Write a function to find the sum number of array elements using reduce.

 

 JavaScript Question № 25 Practical for Middle

Write a JavaScript function to check that two words are anagrams (formed by rearranging the letters of another)

 JavaScript Question № 26 Practical

How to add your method to the Array object so the following code would work?

 

 JavaScript Question № 27 Practical for Junior

How to check that variable is not undefined? How to check that a property exists in an object?

 JavaScript Question № 28 Practical for Senior

What is wrong with this code?

 

 JavaScript Question № 29 Practical for Middle

Write 3 code examples to check whether a string “Soshace” contains a substring “sh”.

 

 JavaScript Question № 30 Theoretical for Senior

How to forbid adding, removing and changing of object properties?

 JavaScript Question № 31 Practical for Middle

How to update the sample to use previous object constructor?

 

 JavaScript Question № 32 Practical for Senior

Write a recursive function to create a deep copy of the object

 JavaScript Question № 33 Practical for Middle

Give code samples for immutable operations using Object.assign and Spread  operator

 JavaScript Question № 34 Practical for Middle

Update the code to correctly release the button object by the garbage collector.

 

 JavaScript Question № 35 Practical for Junior

Write a simple function to check that a number is an integer?

 JavaScript Question № 36 Practical for Senior

Optimize the function using switch statement.

 JavaScript Question № 37 Practical for Senior

Provide some shorthand coding techniques using operators “&&” , || and ?

 JavaScript Question № 38 Theoretical for Junior

How to stop the setInterval  function?

 JavaScript Question № 39 Theoretical for Middle

Explain the output of the code? How to improve this code?

 

 JavaScript Question № 40 Theoretical for Junior

What is the difference between the following examples of creating a function?

 

 JavaScript Question № 41 Practical for Senior

Write a JavaScript function that accepts a number as a parameter and check the number is prime or not.

Note: A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.

 JavaScript Question № 42 Practical for Senior

Write a JavaScript program to find the greatest common divisor of two positive numbers.

Sample Input: 32, 24

Sample Output: 8

 JavaScript Question № 43 Theoretical for Middle

What is a hasOwnProperty ?

 JavaScript Question № 44 Theoretical for Senior

Explain the Symbol type.

 JavaScript Question № 45 Theoretical for Senior

What are accessor descriptors?

 JavaScript Question № 46 Practical for Middle

Correct the code without changing the object sample.

Sample

 

 JavaScript Question № 47 Theoretical for Senior

What is the difference between Boolean(true) and new Boolean(true) ?

 JavaScript Question № 48 Practical for Junior

Write a JavaScript program to create a Clock

Sample Output (will come every second):

09:57:12

09:57:13

09:57:14

 JavaScript Question № 49 Theoretical for Senior

Categorize JavaScript test tools by type.

 JavaScript Question № 50 Practical for Middle

How to remove elements from an array by criteria? Complete the function.

// using loop and splice

// create an example

Sample

 

 JavaScript Question № 51 Practical for Middle

Write a JavaScript program to find the most frequent item of an array.

Sample Input: [d, 3, a, d, d, c, c, 3, 1, a, d]

Sample Output : d: 4

 JavaScript Question № 52 Practical for Middle

Write a JavaScript program to remove duplicate items from the char array.

Sample Input: [d, 3, a, d, d, c, c, 3, 1, a, d]

Sample Output : [1, 3, d, a, c]

 JavaScript Question № 53 Practical for Senior

Write a JavaScript program to get the first n Fibonacci numbers.

Note : The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, . . . Each subsequent number is the sum of the previous two.

Sample Input: 7

Sample Output: [0, 1, 1, 2, 3, 5, 8]

 JavaScript Question № 54 Theoretical for Middle

How does prototype work?

 JavaScript Question № 55 Theoretical for Junior

What is the scope?

 JavaScript Question № 56 Theoretical for Middle

Explain static properties and methods.

 JavaScript Question № 57 Practical for Middle

How to find the sum of the elements of an array if the nesting of the array is unknown?

Sample

 

 JavaScript Question № 58 Theoretical for Middle

How to redirect the browser to another page?

 JavaScript Question № 59 Theoretical for Senior

What are bubbling, capturing, and event delegation in the browser?

 JavaScript Question № 60 Practical for Middle

Write a JavaScript function to create random hex color

Sample Output: #31c05f”

 JavaScript Question № 61 Theoretical for Middle

What is the difference between import and require?

 JavaScript Question № 62 Practical for Senior

Write a code to drag and drop an absolute positioned element.

 JavaScript Question № 63 Theoretical for Middle

What are the benefits of debugging the script in the browser?

 JavaScript Question № 64 Practical for Senior

How to set an environment variable in the npm script?

 JavaScript Question № 65 Theoretical for Senior

Explain the settings of the following eslintrc.json sample

eslintrc.json

 

 JavaScript Question № 66 Theoretical for Senior

For what purposes can the global object console be used, besides logging?

 JavaScript Question № 67 Theoretical for Middle

What useful plugins / extensions / features can be added in IDE?

 JavaScript Question № 68 Theoretical for Middle

What is a destructuring assignment? Give an example.

 JavaScript Question № 69 Theoretical for Senior

What is yield, give an example?

 JavaScript Question № 70 Practical for Senior

Rewrite the example using promise

 

 JavaScript Question № 71 Theoretical for Senior

List examples in which ECMAScript languages ​​are used other than the browser and the web backend.

 JavaScript Question № 72 Theoretical for Middle

What is the difference between REST API and GraphQL?

 JavaScript Question № 73 Theoretical for Middle

What is PWA?

 JavaScript Question № 74 Theoretical for Middle

What is SSR?

 JavaScript Question № 75 Theoretical for Middle

What is Static Site Generators?

 JavaScript Question № 76 Theoretical for Senior

List types of storage in the browser.

 JavaScript Question № 77 Theoretical for Middle

What is a common practice for type checking in JavaScript?

 JavaScript Question № 78 Theoretical for Middle

What is Lodash?

 JavaScript Question № 79 Theoretical for Middle

What is a Hybrid Mobile App?

 JavaScript Question № 80 Theoretical for Middle

What are the disadvantages of using jQuery with SPA?

 JavaScript Question № 81 Theoretical for Middle

List some popular libraries for data visualization.

 JavaScript Question № 82 Theoretical for Senior

What are the libraries for state management?

 JavaScript Question № 83 Theoretical for Junior

List SPA frameworks and libraries.

 JavaScript Question № 84 Theoretical for Middle

List the libraries to making requests from the browser and Node.js?

 JavaScript Question № 85 Theoretical for Middle

What is JWT?

 JavaScript Question № 86 Theoretical for Senior

How to create push notifications?

 JavaScript Question № 87 Theoretical for Senior

What is Web Assembly?

 JavaScript Question № 88 Theoretical for Senior

What is Websocket?

 JavaScript Question № 89 Practical for Middle

Create a script to toggle the DOM element’s class “active” by clicking.

<button id=”click-me class=”btn>Click Me</button>

 JavaScript Question № 90 Theoretical for Junior

List primitive types in JavaScript

About the author

Stay Informed

It's important to keep up
with industry - subscribe!

Stay Informed

Looks good!
Please enter the correct name.
Please enter the correct email.
Looks good!

Related articles

26.03.2024

An Introduction to Clustering in Node.js

Picture your Node.js app starts to slow down as it gets bombarded with user requests. It's like a traffic jam for your app, and no developer likes ...

15.03.2024

JAMstack Architecture with Next.js

The Jamstack architecture, a term coined by Mathias Biilmann, the co-founder of Netlify, encompasses a set of structural practices that rely on ...

Rendering Patterns: Static and Dynamic Rendering in Nextjs

Next.js is popular for its seamless support of static site generation (SSG) and server-side rendering (SSR), which offers developers the flexibility ...

5 comments

Alina Shumarina December 11, 2019 at 1:05 pm
0

I like how you divide them into theoretical and practical ones. Even if the theory was learned a while ago, one can still feel confident with practical questions.

Mohammad Shad Mirza December 24, 2019 at 7:42 am
0

Thank you for this

Nikita Bragin December 24, 2019 at 8:29 am
0

Thanks, cool idea with types of questions, very useful!

Maxim Demidov March 20, 2020 at 5:11 pm
0

JavaScript Question № 57

function arrSum(arr) {
return arr.toString().split(‘,’).map(str => +str).reduce((a, b) => a + b);
}

Chandrakant Tripathi March 18, 2021 at 12:11 pm
0

yeah! this is very useful article not for the interview only but for those who have a lot questions in their mind related to css and jq. Thanks for such wonderful post.

Sign in

Forgot password?

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy

Password recovery

You can also try to

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy