Solving MakeMyTrip Frontend Interview Question | Count Numbers | JavaScript

preview_player
Показать описание
In this video, we will solve a front-end interview question from top companies like MakeMyTrip. We will implement a function that returns the count of numbers inside an array.

Try now using the links below

You can support our channel via:

************************************************************
Devtools Tech is a YouTube channel started as a collaborative effort among like-minded engineers to provide high-quality programming tutorials for free. We firmly believe in knowledge sharing and easy access to quality content for everyone. Hence, this channel is an effort to give back to the community and a step toward our belief -- "We rise by lifting others".

Team Members:
Yomesh Gupta

#javascript #makemytrip #interviewquestions #frontend #web #devtoolstech #code #programming #development #code
***********************************************************
Рекомендации по теме
Комментарии
Автор

Tried a question got an approach .The way you write a code it is worth learning . Thanks sir ..

anujtiwari
Автор

Simple solution without using Recursion
function countNumbers(collection) {
let count = 0;
let newArr = collection.flat(Infinity);
for(let i =0;i<newArr.length;i++){
if(typeof newArr[i]==="number"){
count+=1;
}
}
return count;
};

gantavyasaraswat
Автор

hi bhaiya do you have 30 min in this week would love to book a topmate session regarding a switch .

trivedi
Автор

const isNumber =(nums )=>{
let count=0
for (let items of nums){
if(typeof(items)=== "number"){
count++;
}
if(Array.isArray(items)){
count+= isNumber(items)
}
}
return count;
}

const res=isNumber(input)
console.log(res)

trivedi
Автор

const countNumbers = (arr) => {
return arr.reduce((totalCount, el) => {
if (typeof el === 'number') totalCount++;
else if (Array.isArray(el)) totalCount += countNumbers(el);

return totalCount;
}, 0);
};

manojpathak
Автор

Hey bro, how to tackle hacker Rank front end challenges, is there any other site where we can practice?

-_-I
Автор

More Video on Interview ques, Thanks in advance

allpeace