Javascript Developer Interview Questions


Javascript Developer interview questions shared by candidates

Top Interview Questions

Sort: Relevance|Popular|Date
Javascript Developer was asked...August 7, 2019

Convert : person_First_Name to personFirstName

4 Answers

var name = "person_First_Name"; var d = name.split("_").join(""); console.log(d); Less


function convertor(name){ let result="" splittedNames=name.split("_")>{ result+=a }) console.log(result); } convertor("Person_First_Name") Less

Show More Responses
Dassault Systemes

4)write program to remove duplicate in an array

4 Answers

function removeDuplicateUsingSet(arr){ let unique_array = Array.from(new Set(arr)) return unique_array } Less

var chars1 = ['A', 'B', 'A', 'C', 'B']; var uniqueChars2 = []; chars1.forEach((c) => { if(!uniqueChars2.includes(c)) { uniqueChars2.push(c); } }) Less

for(let i=0; i

Show More Responses

How will you put a child div in center to outer container?

2 Answers

{display:block; margin:0 auto;}

Margin : auto

Dassault Systemes

6) what will be the value of a and b if Var a = 5 +7 + “8” Var b = “8”+5+7

3 Answers


a = 128 b= 857

a=128 b=124

Pin Click

Q : About Basic tech knowledge and one good assignment

2 Answers


Please do assignment carefully

Dassault Systemes

2)How to clear an array by different way

2 Answers

A = []; orelse; A .length=0; orelse; loop it till length is 0 and pop all elements Less

arr.splice(0, arr.length)


Using a nested for() loop is inefficient, can you do it more efficient than the native String.indexOf() method? Without nesting for loops or recursion.

2 Answers

Convert the strings to objects with each word being added as a property to speed up the lookup. I had heard of this technique but never done it myself. Less

sort the words will be done in n Log n . for each word in 1st string do binary search on other string which will run in n log n so overall complexity will be n log n. Less

Capital One

To reverse a string without using reverse keyword.

2 Answers

Can use the loop in structure



Online : 1) Nearest to zero element in an array 2) Longest prefix program 3) single loop reversal of string online questions require you to fill the logic only , not to write the entire program Pen paper : input =['acr', 'bat','car','atb','rca','rac','xyz'] desired output: [ ['acr','car','rca','rac'], ['bat','atb'],['xyz']] i.e grouping of psuedonyms .

1 Answers

let arr = ["acr", "bat", "car", "atb", "rca", "rac", "xyz"]; let flag = 0; let result = []; let pos = 0; for (let i = 0; i < arr.length; i++) { if (!result.flat().includes(arr[i])) { result.push([arr[i]]); pos += 1; for (let j = i + 1; j < arr.length; j++) { if (arr[i].length === arr[j].length) { for (let k = 0; k < arr[i].length; k++) { if (arr[j].includes(arr[i][k])) { flag += 1; } } if (flag == arr[i].length) { result[pos - 1].push(arr[j]); } flag = 0; } } } } console.log(result); Less

Pair programming exercise on a React Router related bug.

2 Answers

I tried rooftop slushie mentioned above and it was pretty helpful. I recommend it. Less

This is an interesting read:

Viewing 1 - 10 of 1,058 interview questions

See Interview Questions for Similar Jobs

php developerweb developerrails developerfront end developerpython developerhtml5 developerui developer

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