Javascript Interview Questions

1,680 javascript interview questions shared by candidates

Build a Cart object using javascript with these three methods: chart.add('chair', 3); chart.add('chair'); //will add only 1 element chart.add('table', 2); chart.remove('table') // it will remove 1 element each time. chart.show(); // will show the elements and its quantity ordered by name // chair: 4, // table: 1
avatar

Mid-Level Software Engineer (Javascript)

Interviewed at Wayfair

3.1
Sep 14, 2016

Build a Cart object using javascript with these three methods: chart.add('chair', 3); chart.add('chair'); //will add only 1 element chart.add('table', 2); chart.remove('table') // it will remove 1 element each time. chart.show(); // will show the elements and its quantity ordered by name // chair: 4, // table: 1

Write the following utility; import {acc, total, reset} from "index.js" acc(2 ,3) // 5 acc(1,2) // 3 total() // 8 reset() // 0 total() // 0 and add promise support like this; acc(Promise.resolve(1),2) // 3 and write unit tests for this with Jest.
avatar

Senior JavaScript Engineer

Interviewed at Photobox

3.6
Jun 27, 2022

Write the following utility; import {acc, total, reset} from "index.js" acc(2 ,3) // 5 acc(1,2) // 3 total() // 8 reset() // 0 total() // 0 and add promise support like this; acc(Promise.resolve(1),2) // 3 and write unit tests for this with Jest.

which following is true about Node.js clustering? 1- A single instance of Node.js runs in a single thread. 2-To take advantage of multi-core systems, it is available to launch a cluster of Node.js processes to handle the load. 3-The cluster module allows easy creation of child processes that all share server ports. 4-All of the above ------------------------- let racer = function() { setTimeout(() => console.log("timeout"), setImmediate(() => console.log ("immediate")) ; process.nextTick(() => console.log("nextTick")) console.log( "current event loop") } racer(); Choose the best option 1- timeout, immediate, nextTick, current event loop 2- immediate, timeout, nextTick, current event loop 3- timeout, immediate, current event loop, current event loop 4- current event loop, nextTick, timeout, immediate 5- Syntax Error ---------------------- What styling method is not used in React? 1- by className 2- by inline styles 3- style bindings 4- css-in-Is 5- 3rd party libraries for styling components such as StyledComponents, Radium, (ssModules, etc.
avatar

Full Stack JavaScript Developer

Interviewed at Soshace

4.5
Dec 17, 2021

which following is true about Node.js clustering? 1- A single instance of Node.js runs in a single thread. 2-To take advantage of multi-core systems, it is available to launch a cluster of Node.js processes to handle the load. 3-The cluster module allows easy creation of child processes that all share server ports. 4-All of the above ------------------------- let racer = function() { setTimeout(() => console.log("timeout"), setImmediate(() => console.log ("immediate")) ; process.nextTick(() => console.log("nextTick")) console.log( "current event loop") } racer(); Choose the best option 1- timeout, immediate, nextTick, current event loop 2- immediate, timeout, nextTick, current event loop 3- timeout, immediate, current event loop, current event loop 4- current event loop, nextTick, timeout, immediate 5- Syntax Error ---------------------- What styling method is not used in React? 1- by className 2- by inline styles 3- style bindings 4- css-in-Is 5- 3rd party libraries for styling components such as StyledComponents, Radium, (ssModules, etc.

Viewing 341 - 350 interview questions

Glassdoor has 1,680 interview questions and reports from Javascript interviews. Prepare for your interview. Get hired. Love your job.