Solving MakeMyTrip Frontend Interview Question | Count Numbers | JavaScript
Вставка
- Опубліковано 25 вер 2024
- 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.
Question link: devtools.tech/...
Book A Mock Interview Session: topmate.io/yom...
Support Us: devtools.tech/...
Try now using the links below
devtools.tech/...
devtools.tech/...
You can support our channel via:
rzp.io/l/suppo...
devtoolstech.g...
www.buymeacoff...
************************************************************
Devtools Tech is a UA-cam 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".
Interview questions: devtools.tech/...
Interview resources: devtools.tech/...
Hidden Gem: devtools.tech/...
Team Members:
Yomesh Gupta
Portfolio: yomeshgupta.com
LinkedIn: / yomeshgupta
Twitter: / yomeshgupta
#javascript #makemytrip #interviewquestions #frontend #web #devtoolstech #code #programming #development #code
***********************************************************
Try question here: devtools.tech/questions/s/write-a-function-to-return-the-count-of-numbers-in-an-array-or-makemytrip-frontend-interview-question---qid---cjzjsfJUP0zHb2lgPJVy
Other useful links:
topmate.io/yomeshgupta
devtools.tech/questions/all
devtools.tech/lists/all
Tried a question got an approach .The way you write a code it is worth learning . Thanks sir ..
Glad to hear that! 🙌🏼
hi bhaiya do you have 30 min in this week would love to book a topmate session regarding a switch .
Yes sure. Please book through topmate.io/yomeshgupta
Hey bro, how to tackle hacker Rank front end challenges, is there any other site where we can practice?
I haven't tried other platforms honestly in terms of solving more questions. Only one I can recommend is devtools.tech only.
@@DevtoolsTech haha nice bhai, ofcourse devTools is there
Learnersbucket you can try too!
More Video on Interview ques, Thanks in advance
More coming soon!
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)
Simple solution without using Recursion
function countNumbers(collection) {
let count = 0;
let newArr = collection.flat(Infinity);
for(let i =0;i
Yes, it is one of the ways do it. Thanks for sharing!
const countNumbers = (arr) => {
return arr.reduce((totalCount, el) => {
if (typeof el === 'number') totalCount++;
else if (Array.isArray(el)) totalCount += countNumbers(el);
return totalCount;
}, 0);
};