VISA Frontend Interview | 🎉 Selected | ReactJs & JavaScript

  Рет қаралды 12,370

Dev. Aditya

Dev. Aditya

Күн бұрын

Пікірлер: 40
@DevAditya
@DevAditya 2 жыл бұрын
Watch Cognizant React/Frontend Interview kzbin.info/www/bejne/o5jMk6lop72ce7c 📌 Join our Telegram Channel t.me/Reactjs_Interview Please don't judge and comments on my answers. This is just the interview experience and If you know the right answers please comment below which can also help others.
@jaiku3689
@jaiku3689 2 жыл бұрын
Cant wait
@anandkumar-vq2eo
@anandkumar-vq2eo 2 жыл бұрын
function sum(...arr){ const total = arr.reduce((acc,val)=>{ if(typeof val === 'number') return acc + val else if(typeof val === 'string') return acc+parseInt(val) else return acc }) return total } console.log(sum(1,2,3, null, '4'))
@rahulxdd
@rahulxdd 2 жыл бұрын
This doesn't work if an array is passed right? Could you tell me what is the use of spread operator in this?
@anandkumar-vq2eo
@anandkumar-vq2eo 2 жыл бұрын
@@rahulxdd Yes, this will not work if you pass array As per the question they asked here, i wrote the code.
@onrjs
@onrjs 2 жыл бұрын
console.log(sum(1,2,3, NaN, '4')) try this
@rahulxdd
@rahulxdd 2 жыл бұрын
@@anandkumar-vq2eo got it. Thank you.
@RaviKumar-11
@RaviKumar-11 2 жыл бұрын
Congrats brother
@asadrahman6123
@asadrahman6123 2 жыл бұрын
function sum(...args) { const newArgs = args .map((element) => { if (Array.isArray(element)) { return sum(...element); } return element; }) .map((element) => Number(element)) .filter((number) => !isNaN(number)); return newArgs.reduce((previousValue, currentValue) => { return (previousValue += currentValue); }, 0); }
@mmareload9032
@mmareload9032 2 жыл бұрын
function sum2(...args){ let total = 0; for(let arg of args){ if(Array.isArray(arg)){ total += sum2(...arg) }else if(!isNaN(arg)){ total += Number(arg) } } return total }
@SANJEEVGUPTA-bx8xb
@SANJEEVGUPTA-bx8xb 2 жыл бұрын
Helpful
@aghasghazryan1192
@aghasghazryan1192 4 ай бұрын
function sum(...argsArray) { let total = argsArray.reduce((sumNumber, curr) => { switch (typeof curr) { case "number": return (sumNumber += curr); case "string": const number = parseInt(curr.match(/\d+/)[0]); return (sumNumber += number); case "object": if (Array.isArray(curr)) { const sumOfElements = curr.reduce((sum, curr) => sum + curr, 0); return (sumNumber += sumOfElements); } else { return sumNumber; } default: return sumNumber; } }, 0); return total; }
@RAMKUMARR-dm5mb
@RAMKUMARR-dm5mb 4 ай бұрын
HI Mate do u have interview in Visa in few days !!
@pujadas18
@pujadas18 Жыл бұрын
Make more video about product based company interview
@DevAditya
@DevAditya Жыл бұрын
Sure 😊
@kedarkulkarni107
@kedarkulkarni107 2 жыл бұрын
how to know such good companies job requirements & from which websites to apply ??
@DevAditya
@DevAditya 2 жыл бұрын
LinkedIn
@kushagra5208
@kushagra5208 2 жыл бұрын
Solution: const sum = (...rest) => { const ans = rest.filter(Boolean).reduce((acc, cur) => { if (Array.isArray(cur)) { acc += sum(...cur); } else { acc += parseInt(cur); } return acc; }, 0); return ans; }
@DevAditya
@DevAditya 2 жыл бұрын
Liked the Solution 👌
@kovendanragupathi7632
@kovendanragupathi7632 2 жыл бұрын
Is visa company can provide good salary package bro?
@DevAditya
@DevAditya 2 жыл бұрын
Yup bro
@kovendanragupathi7632
@kovendanragupathi7632 2 жыл бұрын
@@DevAditya ok
@akashbhadouria6727
@akashbhadouria6727 Жыл бұрын
@@DevAditya how much?
@Thanveershah
@Thanveershah 2 жыл бұрын
Is this really a VISA interview? If yes, what is the level? Because this question seems to be very beginner, intermediate level.
@DevAditya
@DevAditya 2 жыл бұрын
1-2 Year Exp.
@Thanveershah
@Thanveershah 2 жыл бұрын
@@DevAditya Did you get hired?
@AnkitKumar-vq9qx
@AnkitKumar-vq9qx 2 жыл бұрын
bhai koi suggest kar do React Developer ka job kaise le as fresher
@DevAditya
@DevAditya 2 жыл бұрын
Use LinkedIn for referal
@magedibrahim1405
@magedibrahim1405 2 жыл бұрын
function sum() { // Time complexity O(n) // Space complexity O(n) let total = 0; for (const index in arguments) { let argument = arguments[index]; if (Array.isArray(argument)) { // Call it over and over again until we reach numbers, add them, and return them. total += sum(...argument); continue; } total += Number(argument || 0); } return total; } console.log(sum(1, 2, 3, "4", NaN, null, undefined, [5, 6, 7, [[[[[8]], 9, 10]]]])); // 55
@saikumarkandikonda431
@saikumarkandikonda431 2 жыл бұрын
let total = 0; const sum = (...numbers) => { numbers.map((number) => { // console.log("type of number is", typeof (number)) // console.log("is not a number ", isNaN(number)) if (isNaN(number) || typeof (number) === "object") { // console.log("ignore this"); return undefined; } else { total += parseInt(number); return parseInt(total); } }) return total; } console.log(sum(1, 2, 3, null, undefined, "4", [3, 2, 3]))
@programmingpictures4420
@programmingpictures4420 2 жыл бұрын
itni gandi english bolty hy ye angrez. Lahula wala quata😂😂
@sterinsaji3240
@sterinsaji3240 2 жыл бұрын
can you show the resume that got you selected for the interview
@DevAditya
@DevAditya 2 жыл бұрын
Sure, will make a video on it
@codeengineer10
@codeengineer10 2 жыл бұрын
@@DevAditya please make that video soon
@DevAditya
@DevAditya 2 жыл бұрын
@@codeengineer10 I have uploaded it on my topmate profile - topmate.io/roshan
JISOO - ‘꽃(FLOWER)’ M/V
3:05
BLACKPINK
Рет қаралды 137 МЛН
Wednesday VS Enid: Who is The Best Mommy? #shorts
0:14
Troom Oki Toki
Рет қаралды 50 МЛН