Top 10 Javascript Interview Questions | Data Structures and Algorithms | Arrays | WebStack Group

preview_player
Показать описание
These Javascript questions are commonly asked in most of the interviews. In this video, you'll see the possible solutions for all the questions. These questions are really helpful if you are trying to crack the Javascript interview.

/*************************************/
/************************************/

Chapters:
0:28 - Sorting an array of numbers (Bubble Sort)
10:31 - Sorting an array [0, 1, 1, 0, 0, 1]
15:20 - Question on array method - 1 (Map)
19:34 - Question on array method - 2 (Filter, Reduce)
23:54 - Remove duplicates from an array
31:11 - Sum the digits in the given number (Recursion)
37:49 - Compute the exponent of a number (Recursion)
42:15 - Check any two numbers will sum up the given number (Two-Sum)
48:00 - Reverse a string
50:34 - Find the missing number
Рекомендации по теме
Комментарии
Автор

For Removing duplicates, you can use array Set method
Array.from(new Set(numbers));

upassit
Автор

Hey man I hope you keep going you’re voice is very easy and clear to understand and the energy of the video is light thank you man

farhanbegg
Автор

Very helpfull video
brother...make more videos of javascript

TECHWITHKAMALRAJ
Автор

Exponent problem we can simply return base ** exp

shivasampath
Автор

Hi! Thanks so much for creating this content! Found it very helpful. However there is an issue with the calculateSum function you have created. If you would try to introduce another mobile it would return NaN. Here is a little fix to go through as many objects as you want:

'
const calculateSum = (arr) => {
filterMobile = arr.filter((item) => {
if (item.type == "Mobile") {
return item;
}
});

return filterMobile.reduce((acc, mobile) => acc + mobile.price, 0);
};'

kaja
Автор

For sum the mobile price. Only needs to use reducer iterator loop. It is easy to calculate

ashoksingh
Автор

Thank you so much for doing this video. You really put a lot of effort into this. Kudos!

paschalynukwuani
Автор

the sorting of 0, 1 we can do in 1 loop with reduce and immidiatelly filling the current array;

dufifa
Автор

It's very helpful thank you so much for making this video 🤟🙏

Sk-eryj
Автор

To sum mobile price:
var result = mobileList.reduce((a, b)=>{
return a+b.price
}, 0)

JabirMoiduVtk
Автор

why are we comparing this array with the inner for loop what happened to the outer for loop why are we not using it like am confused lately someone help please this content is really useful is there any content like this for beginner
🤔🤔🤔🤔

nicklauschris
Автор

For the "Sum the digits in the given number" question, sum should be >= 10

rikunk
Автор

Sir where are you?

Please start Data structures and algorithms series from beginner level to advance level in Javascript.

vinaypatil
Автор

I saw someone remove duplicates from array using a "Set" then they used "..." and converted that set to an array. I kind of forgot how they did it, was just curious what the difference was.

richardbianco
Автор

@43:33 6+5=11 check this. but u mark false why

ehtisham_hashmi
Автор

The sum function wasn't done right, , , its quiet expensive operation to make string from number so u just could solve this like this

function sum1(num) {
let res = 0;

while(num > 0) {
res+=num%10;
num=Math.floor(num/10)
}
return res;
}

sum1(123);

arammanukyan
Автор

let newprice = product.map((item)=>{
return {...item, price:item.price * 2}
})

console.log(newprice)

Gitsh
Автор

the sorting of 0, 1 we can do in 1 loop with reduce and immidiatelly filling the current array;

dufifa