6.5 Years Experienced Best Javascript Interview | Chakde Frontend Interview EP - 12

  Рет қаралды 6,378

Chirag Goel

Chirag Goel

Күн бұрын

Пікірлер: 75
@chandanjoshi5727
@chandanjoshi5727 4 ай бұрын
Simple solution for first problem const input = { A : (a,b,c) => a+b+c, B : (a,b,c) => a-b-c, C : (a,b,c) => a*b-c, D : {E : (a,b,c) => a*b*c }, } const compute =(input,a,b,c)=>{ const temp = {} for(let i in input){ const key = input[i] if(typeof key ==='object'){ temp[i] = compute(key,a,b,c) }else{ const val = key(a,b,c) temp[i] = val } } return temp } console.log(compute(input ,1,1,1))
@coderinprocess2678
@coderinprocess2678 4 ай бұрын
good use of recursion. try to use proper names of variable. i got confused here const key = input[i]. its not returning key, its returning value of input object. Also never iterate objects using `in` because for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array. You will get such warnings from ESLINT in prod level code.
@chandanjoshi5727
@chandanjoshi5727 4 ай бұрын
@@coderinprocess2678 Thank you
@ur2352
@ur2352 4 ай бұрын
const compute = function (a, b, c) { const output = {}; for (const [key, value] of Object.entries(input)) { output[key] = typeof value === 'object' ? Object.values(value).at(0)(a, b, c) : value(a, b, c); } return output; }; this is how i solved the first problem
@Krishnasaini
@Krishnasaini 4 ай бұрын
i solved it using recursion. Time complexity should be O(n) as each and every property of object is visited once
@coderinprocess2678
@coderinprocess2678 4 ай бұрын
My feedback to the candidate who did good work on most part. - 1. since you are an experience folk, dont directly jump to code. ask clarifying questions. Breakdown the problem. 2. since you are an experience folk, take better examples , choose better naming conventions.
@mirijanyavo6532
@mirijanyavo6532 20 күн бұрын
Kinda trivial question: const compute = (object, ...args) => Object.entries(object).reduce((r, [k, v]) => ((r[k] = typeof v === "function" ? v(...args) : compute(v, ...args)), r), {}); or: const compute = (object, ...args) => Object.fromEntries(Object.entries(object).map(([k, v]) => [k, typeof v === "function" ? v(...args) : compute(v, ...args)])); Array reduce similar to JS: const reduce = (...args) => arr => { const reducer = args[0]; if (typeof reducer !== "function") throw new TypeError(`${typeof reducer} is not a function`); if (!arr.length && args.length < 2) throw new TypeError("Reduce of empty array with no initial value"); let accumulated = args.length < 2 ? arr[0] : args[1]; const startIndex = args.length < 2 ? 1 : 0; for (let i = startIndex; i < arr.length; i++) { accumulated = reducer(accumulated, arr[i], i, arr); } return accumulated; }; const add = (a, b) => a + b; // multiple elements + no initial console.log([1, 2, 3, 4].reduce(add)); // 10 console.log(reduce(add)([1, 2, 3, 4])); // 10 // multiple elements + initial console.log([1, 2, 3, 4].reduce(add, 5)); // 15 console.log(reduce(add, 5)([1, 2, 3, 4])); // 15 // 1 element + initial console.log([1].reduce(add, 2)); // 3 console.log(reduce(add, 2)([1])); // 3 // 0 elements + initial console.log([].reduce(add, 0)); // 0 console.log(reduce(add, 0)([])); // 0 // 1 element + no initial console.log([1].reduce(add)); // 1 console.log(reduce(add)([1])); // 1 // no elements + `undefined` passed in as literal console.log([].reduce(add, undefined)); // undefined console.log(reduce(add, undefined)([])); // undefined // no elements + no initial // console.log([].reduce(add)); // TypeError "Reduce of empty array with no initial value" // console.log(reduce(add)([])); // TypeError // Reducer not function // console.log([].reduce({}, 5)); // TypeError "object is not a function" // console.log(reduce({}, 5)([])); // TypeError
@SonuKumar-lh3hg
@SonuKumar-lh3hg 4 ай бұрын
Being a fresher/less exp. Sometime we feel happy when we were knowing basic core concept as compare to more exp. people.Very useful❤ bring such content regularly.
@4318A.M.vishal
@4318A.M.vishal 4 ай бұрын
This is my solution for the first problem, I've added an extra parameter to the compute function for using recursion based approach const input = { A: (a,b,c) => a+b+c, B: (a,b,c) => a-b-c, C: (a,b,c) => a+b*c, D: { E: (a,b,c) => a+b+c } } function compute(a, b, c, Input = null) { let obj = Input ? Input : input for(let key in obj) { if(typeof obj[key] === "function") { obj[key] = obj[key](a,b,c); }else { let temp = obj[key]; compute(a,b,c, temp); } } return obj; } console.log(compute(1,1,1));
@4318A.M.vishal
@4318A.M.vishal 4 ай бұрын
For the second question my answer is Array.prototype.myReduce = function (callback, initialVal) { const arr = this; for(let i=0;i item + acc, 0)); kindly tell me if there is any corrections to be made
@coderinprocess2678
@coderinprocess2678 4 ай бұрын
paused during Q1 and solved it using recursion. // clarifying questions to Chirag // 1. can you tell me more about types of the input object // 2. can input object takes more than 3 perameters for its function as value // 3. Should I validate the input, or can I assume it's always valid? Assumption - assuming the type of value of Input object is either function or object const outputConstructor = (input, ...args) => { if (typeof input !== "object" || Array.isArray(input)) { return input; } const output = {}; for (const [key, value] of Object.entries(input)) { output[key] = typeof value === "function" ? value(...args) : outputConstructor(value, ...args); } return output; }; const compute = (...args) => { return outputConstructor(input, ...args); }; compute(1, 1, 1);
@jaswanthponnusamy5970
@jaswanthponnusamy5970 Ай бұрын
Since we are using the term dynamically the input can change and so args could also, function compute(...args) { function computeHandler(inputObj) { let output = {}; for(const key in inputObj) { let obj = inputObj[key]; if(typeof obj === "function") { output[key] = obj(...args); } else { output[key] = computeHandler(obj); } } return output; } return computeHandler(input); }
@ankitasrivastava6943
@ankitasrivastava6943 4 ай бұрын
My solution for first problem: :) const compute = (a,b,c) => { const input = { A: (a,b,c) => a + b + c, B: (a,b,c) => a + b - c, C: (a,b,c) => a + b * c, D: { E: (a,b,c) => a + b + c, } } const recCompute = (tempInput, a,b,c) => { let result = {}; for(let key of Object.keys(tempInput)) { if(tempInput[key] instanceof Function) { result = { ...result, [key]: tempInput[key](a,b,c) } } else { result = { ...result, [key]: recCompute(tempInput[key],a,b,c) } } } return result; } return recCompute(input,a,b,c) }
@gunjanvyas695
@gunjanvyas695 4 ай бұрын
Thank you, for awesome content as always My Solution: //Question 1 : my recursive solution const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => (a / b) * c, D: { E: (a, b, c) => a + b + c, }, }; function getOutputExecuted(input, ...args) { let ans = {}; Object.keys(input).forEach((key, value) => { if (typeof input[key] === "function") { return (ans[key] = input[key](...args)); } else { ans[key] = getOutputExecuted(input[key], ...args); } }); return ans; } console.log("result -> ", getOutputExecuted(input, 1, 1, 1)); //Question2 Array.prototype.myReduce = myReduce; function myReduce(fn, initialValue) { let arr = this; let n = arr.length; let curr = initialValue; for (let i = 0; i < n; i++) { curr = fn(curr, arr[i]); } return curr; } let inbuiltSol = [1, 2, 3].reduce((acc, item) => { return (acc += item); }, 0); let myReducerSol = [1, 2, 3].myReduce((acc, item) => { return acc + item; }, 0); console.log(inbuiltSol); //6 console.log("myReduce polyfill Sol", myReducerSol); //6 //Reduce usage => 1) accumulation(same as above example) //Reduce usage => 2) transformation
@AtulKumar-gt7uq
@AtulKumar-gt7uq 4 ай бұрын
[Input Not Modified Solution 1] | It was really a good problem. @chirag Please find my approach for the solution and do let me know If I missed anything here :) const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a * b * c, C: { D: (a, b, c) => a / b / c, E: { F: (a, b, c) => a - b - c } } } function compute(a, b, c) { if (typeof input !== 'object' || Array.isArray(input)) { throw new Error('Invalid input'); } function deepChecks(input) { let resObject = {} for (let key in input) { if (typeof input[key] === 'function') { resObject[key] = input[key](a, b, c); } else if (typeof input[key] === 'object') { resObject[key] = deepChecks(input[key]); } else { resObject[key] = input[key]; } } return resObject; } return deepChecks(input); } console.log(compute(1, 2, 3)); Thanks ❤
@shivareddy4169
@shivareddy4169 3 ай бұрын
Thank you so much for the JavaScript content which you are providing. here the solution const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => a + b * c, D: { E: (a, b, c) => a + b + c } }; function compute(a, b, c) { const result = {}; for (const key in input) { if (typeof input[key] === 'function') { result[key] = input[key](a, b, c); } else if (typeof input[key] === 'object') { result[key] = {}; for (const innerKey in input[key]) { if (typeof input[key][innerKey] === 'function') { result[key][innerKey] = input[key][innerKey](a, b, c); } } } } return result; } console.log(compute(1, 1, 1));
@coderinprocess2678
@coderinprocess2678 4 ай бұрын
after quick reading of prototype and this, came up with this solution of polyfill of reduce Array.prototype.myReduce2 = function (cb, initialValue=0) { if (!Array.isArray(this) || typeof cb !== "function") { throw new Error("input is not an array"); } let acc = initialValue; // iterate through array for (let i = 0; i < this.length; i++) { acc = cb(acc, arr[i]); } return acc; }; console.log('polyfill2 via prototype', arr.myReduce2(sum, 1))
@mehulsatardekar8985
@mehulsatardekar8985 3 күн бұрын
my solution const obj = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => a * b * c, D: { E: (a, b, c) => a + b + c, }, }; const compute = (a, b, c) => { const process = (inputObj) => { const emptyObj = {}; for ([key, value] of Object.entries(inputObj)) { if (typeof value === "object") { // process() emptyObj[key] = process(value); //process(obj[key](a,b,c)) } else if (typeof value === "function") { emptyObj[key] = value(a, b, c); } } return emptyObj }; return process(obj); }; console.log(compute(1, 1, 1));
@nayansinghal23
@nayansinghal23 4 ай бұрын
CODE - 1 :- function recursion(input, a, b, c) { const output = {}; for(const prop in input) { if(typeof(input[prop]) === 'object') { output[prop] = recursion(input[prop], a, b, c) } else { const func = input[prop]; const value = func(a, b, c); output[prop] = value; } } return output; } function compute(a, b, c) { const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => a + (b * c), D: { E: (a, b, c) => a + b + c, } } return recursion(input, a, b, c); } console.log(compute(1, 1, 1));
@nikhilkorane9364
@nikhilkorane9364 4 ай бұрын
He has 7 years of experience and didn’t know how to get value from object 😮😅
@coderinprocess2678
@coderinprocess2678 4 ай бұрын
paused during polyfill of myReduce and here is my solution const myReduce = (arr, cb, initialValue = 0) => { if (!Array.isArray(arr || typeof cb !== "function")) { throw new Error("input is not an array"); } let result; let acc = initialValue; // iterate through array for (let i = 0; i < arr.length; i++) { acc = cb(acc, arr[i]); } return acc; };
@RounakSaga
@RounakSaga 3 ай бұрын
function compute(a,b,c) { var output = {} function recur(input,output) { for(let k in input){ if(typeof(input[k]) == 'object') { output[k] ={} recur(input[k], output[k]) } else { output[k] = input[k](a,b,c) } } } recur(input,output) return output }
@AnkitTyagi-co8rs
@AnkitTyagi-co8rs 4 ай бұрын
const input = { A : (a,b,c) => a+b+c, B : (a,b,c) => a-b-c, C : (a,b,c) => a*b-c, D : {E : (a,b,c) => a*b*c }, } const iterator =(input,a,b,c)=>{ let output ={}; for(let i in input){ if(typeof input[i] ==='object'){ output[i] = iterator(input[i],a,b,c) } else{ output[i] = input[i](a,b,c) } } return output; } function compute(a,b,c){ let res = iterator(input,a,b,c) return res } const res=compute(1,1,1); console.log(res);
@DebayanMukherjee-wo2ul
@DebayanMukherjee-wo2ul 4 ай бұрын
I am a fresher.......I am able to done the second part of the object successfully.......
@suwalsabin9250
@suwalsabin9250 4 ай бұрын
my solution for qns 1 const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => a + b * c, D: { E: (a, b, c) => a + b + c, }, }; function compute(a, b, c) { let finaloutput = RecursiveFnCall(input); function RecursiveFnCall(value) { const output = {}; Object.keys(value).forEach((key) => { output[key] = callFN(value[key]); }); return output; } function callFN(propsFn) { if (typeof propsFn == 'function') { return propsFn(a, b, c); } else { return RecursiveFnCall(propsFn); } } return finaloutput; } console.log(compute(1, 1, 1));
@Krishnasaini
@Krishnasaini 4 ай бұрын
before jumping to code- clarifying questions to Interviewer- 1. can you tell me more about types of the input object 2. can input object takes more than 3 perameters for its function as value 3. Should I validate the input, or can I assume it's always valid?
@shubhanshusahuu
@shubhanshusahuu 4 ай бұрын
//My inplementation using recusrion for First problem const input = { A: (a,b,c)=> a+b+c, B: (a,b,c)=> a-b-c, C: (a,b,c)=> a+b*c, D: { E : (a,b,c) => a+b+c } } const getSolvedObj= (a,b,c,obj)=>{ let result ={} for(let key of Object.keys(obj)){ if(typeof obj[key] == 'object'){ result[key] = getSolvedObj(a,b,c,obj[key]) } else{ result[key] = obj[key](a,b,c) } } return result } console.log(getSolvedObj(1,2,3,input))
@AshutoshDubey-m4d
@AshutoshDubey-m4d 3 ай бұрын
const inObj = { A:(a,b,c) => a+b+c, B:(a,b,c) => a-b-c, C:(a,b,c) => a*b*c, D:{ E:(a,b,c) => a+b+c, } } const output = { A:3, B:-1, C:1, D:{ E:1 } } function compute(input, ...args) { let output= {} for(key in input) { const isObj = typeof(input[key])==='object' if(isObj) { const childRes = compute(input[key],...args) output[key]= childRes }else { output[key]= input[key](...args) } } return output; }
@sanujasethi6286
@sanujasethi6286 4 ай бұрын
I hope this will work const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => a + b * c, D: { E: (a, b, c) => a * b * c, }, }; function compute(a, b, c) { const recurseCompute = (obj) => { const result = {}; for (const key in obj) { if (typeof obj[key] === 'function') { result[key] = obj[key](a, b, c); } else if (typeof obj[key] === 'object') { result[key] = recurseCompute(obj[key]); } } return result; }; return recurseCompute(input); } const output = compute(1, 1, 1); console.log(output);
@shubhanshusahuu
@shubhanshusahuu 4 ай бұрын
2nd const arr = [1,2,3] Array.prototype.myReduce = function(callback,initial){ let acc = initial for(let i =0 ; i < this.length; i++) acc = callback(acc,this[i]) return acc } console.log(arr.myReduce((acc,curr)=> {return acc + curr}, 0))
@ur2352
@ur2352 4 ай бұрын
what if we don't provide the initial value to the fun, i.e initial is undefined
@shubhanshusahuu
@shubhanshusahuu 2 ай бұрын
​@@ur2352 we can use the default param for initial as null
@PrashantKumar-ui6rs
@PrashantKumar-ui6rs 4 ай бұрын
function compute(input, a, b, c){ const result = {}; for(let key in input){ if(typeof input[key] === 'function'){ result[key] = input[key](a,b,c) }else{ Object.assign(result,compute(input[key], a, b, c)) } } return result; }
@robinsaini8401
@robinsaini8401 4 ай бұрын
First Problem solution by using graph dfs const calGraph = (input, ...a) => { if (typeof input === "function") return input(...a) let result = {}; for (const key in input) { result[key] = calGraph(input[key] , ...a); } return result; }; const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a * b * c, C: { E: (a, b, c) => a - b - c, D: { X: { Z: (a, b, c) => a + b - c, } } }, }; console.log(calGraph(input , 1,2,3));
@mrwhosaini
@mrwhosaini 4 ай бұрын
Solution to First Problem const myObj = { A : (a, b, c) => a + b + c , B : (a, b, c) => a - b - c, C : (a, b, c) => a - (b * c), D : { E: (a, b, c) => a + b + c, F: { G: (a, b, c) => Math.pow(a,b) + c } } } const result = new Object(); let compute = function(a, b, c, computed) { const props = Object.keys(this); props.forEach((prop) => { const propType = typeof this[prop]; if(propType === 'function') { //execute only if value is a function computed[prop] = this[prop](a, b, c); } else if(propType === 'object') { // do recursion if value is an object const subComputed = new Object(); computed[prop] = subComputed; compute.call(this[prop], a, b, c, subComputed); } }) } compute.call(myObj, 1, 1, 1, result);
@deepaksharma9874
@deepaksharma9874 4 ай бұрын
Could you take my interview sometime?It would mean a lot to me. Keep up the amazing work!
@anirudhhnalapur5426
@anirudhhnalapur5426 4 ай бұрын
let input = { A: (a,b,c) => a+ b + c, B: (a,b,c) => a - b - c } function compute(a,b,c) { let keys = Object.keys(input); let outputObject = {} for(let i = 0; i
@ankushroy5606
@ankushroy5606 4 ай бұрын
u make my saturday worthit
@engineerchirag
@engineerchirag 4 ай бұрын
🙏❤️
@ajitchaubey3280
@ajitchaubey3280 4 ай бұрын
Here is the solution for both the problem . Question 1- const input={ A:(a,b,c)=>a+b+c, B:(a,b,c)=>a-b-c, C:(a,b,c)=>a+b*c, D:{ E:(a,b,c)=>a+b+c } } function compute(...args){ function helperFunction(currObj){ return Object.keys(currObj).reduce((acc,curr)=>{ if(typeof currObj[curr]==="object"){ acc[curr]= helperFunction(currObj[curr]) }else{ acc[curr]=currObj[curr](...args) } return acc },{}) } return helperFunction(input) } console.log(compute(1,1,1)) Question 2 - //Custom my reduce function //1: callback function //2: initialValue Array.prototype.myReduce=function(cb,initialValue){ let acc; let startIndex=0; if(arguments.length
@omnikingomniking6412
@omnikingomniking6412 4 ай бұрын
How can he have 6 years exp. He dont have his fundamentals clear. Clearly rejected
@uditkhandelwal6330
@uditkhandelwal6330 4 ай бұрын
function compute(a,b,c) { const inner = (obj) => { let output = {}; for(let key in obj){ if(Object.hasOwn(obj,key)){ if(typeof obj[key] === 'object'){ output[key] = {...inner(obj[key])} }else{ output[key] = obj[key](a,b,c) } } } return output; } return inner(input); }
@rajnishgiri6252
@rajnishgiri6252 4 ай бұрын
Set of good questions Chirag 👍. I feel Venkata has watched multiple tutorials but lacks hands on practice as he knows things but finds it difficult to implement. How do I get a chance to appear on an interview with you 😀.
@HelloIntizar
@HelloIntizar 4 ай бұрын
Thank you so much for the JavaScript content which you are providing. Here is the solution for the first problem const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => a + b - c, D: { E: (a, b, c) => a + b + c, }, }; function compupte(a, b, c) { const getObjectValue = (obj) => { if (typeof obj !== 'object') { return obj; } return Object.keys(obj).reduce((accumulator, key) => { const currentValue = typeof obj[key] === 'function' ? obj[key](a, b, c) : getObjectValue(obj[key]); return { ...accumulator, [key]: currentValue, }; }, {}); }; return getObjectValue(input); } console.log(compupte(1, 1, 1));
@Prince-yz1tc
@Prince-yz1tc 4 ай бұрын
const recurse = (input, ...args) => { return Object.entries(input).reduce((acc, [k, v]) => { acc[k] = typeof v === "function" ? v(...args) : recurse(v, ...args); return acc; }, {}); }; const compute = (...args) => { return recurse(input, ...args); };
@sumitmobiotics3161
@sumitmobiotics3161 4 ай бұрын
const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a-b-c, C: (a, b, c) => a + b*c, D: { F: (a, b, c) => a+ b+c } } function CB (a,b,c, payload) { let result = {} for (let data in payload) { if (typeof payload[data] == 'function') { result[data] = payload[data](a,b,c) } else if (typeof payload[data] == 'object') { result[data] = CB(a,b,c,payload[data]) } } return result; } function compute(a, b, c) { let result = {}; return CB(a,b,c, input) } console.log(compute(1,1,1));
@PavanKumar-os9xj
@PavanKumar-os9xj 4 ай бұрын
Good question lot of leaning in the implementation
@engineerchirag
@engineerchirag 4 ай бұрын
Keep learning, keep sharing 🚀
@rishabhmehta6204
@rishabhmehta6204 4 ай бұрын
const input = { A : (a,b,c) => a+b+c, B : (a,b,c) => a-b-c, C : (a,b,c) => a*b-c, D : {E : (a,b,c) => a*b*c }, } compute (1,1,1) function compute(input,...args){ const ans ={}; for (let key in input){ if(typeof input[key] ==="object"){ ans[key] = compute(input[key],...args) } else if(typeof input[key]=="function"){ ans[key] = input[key](...args) } else{ ans[key] = input[key] } } return ans; } console.log(compute(input,1,1,1)) my solution
@arkaprabhadas8590
@arkaprabhadas8590 2 ай бұрын
bhaiya please look into the audio quality, its a little hard to follow
@HunkIsHere
@HunkIsHere 4 ай бұрын
Solution of Problem 1: const input = { A: (a, b, c) => a + b + c, B: (a, b, c) => a - b - c, C: (a, b, c) => a * b * c, D: { E: (a, b, c) => a + b * c, }, }; function compute(...args) { const input = this; const result = {}; Object.keys(input).map((key) => { if (typeof input[key] === 'function') { result[key] = input[key](...args); } else if (typeof input[key] === 'object') { result[key] = compute.call(input[key], ...args); } else { result[key] = input[key]; } }); return result; } const result = compute.call(input, 1, 1, 1); console.log(result);
@AtulKumar-gt7uq
@AtulKumar-gt7uq 4 ай бұрын
Is this valid?? as We were not suppose to modify the input or usage of the compute function. !!!
@lalipathak-g3c
@lalipathak-g3c 4 ай бұрын
second problem Array.prototype.myReduce = function(cb, init) { let acc = init for(let i = 0; i < this.length; i++){ acc = acc ? cb(acc, this[i], i, this) : this[i]; } return acc; }
@ketanthorat4337
@ketanthorat4337 4 ай бұрын
@Chirag Goel can you please suggest KZbin channels in English as well as Hindi to learn react j's
@வைரமுத்து.மா
@வைரமுத்து.மா 4 ай бұрын
First Question My Solution function compute(a,b,c, obj = input) { for(let va in obj) { if(typeof(obj[va]) === 'function') { obj[va] = obj[va](a,b,c); } else if(typeof(obj[va]) === 'object' && !Array.isArray(obj[va])) { obj[va] = compute(a,b,c, obj[va]); } } return obj; } const op = compute(1,1,1); Second Question my Solution Array.prototype.myReduce = function(fn, initVal) { for(let i =0; i < this.length; i++) { initVal = fn.apply(null, [initVal, this[i]]); } return initVal; }
@sumitmobiotics3161
@sumitmobiotics3161 4 ай бұрын
Its awsome.
@engineerchirag
@engineerchirag 4 ай бұрын
❤️
@MacheteBoy
@MacheteBoy 4 ай бұрын
My opinion would be Reject
@Krishnasaini
@Krishnasaini 4 ай бұрын
which platform is this where they are solving questions?
@inspirelogic7
@inspirelogic7 4 ай бұрын
Codility
@Fam-m4i
@Fam-m4i 4 ай бұрын
Bhai accumulated value return karde😅
@ryandsouza2962
@ryandsouza2962 4 ай бұрын
How can I apply for these?
@engineerchirag
@engineerchirag 4 ай бұрын
Apply here: forms.gle/8VyGEUuRwEUrj4vT6
@rizwansaifi3590
@rizwansaifi3590 4 ай бұрын
how can i give these mocks interviews ?
@engineerchirag
@engineerchirag 4 ай бұрын
Apply here: forms.gle/8VyGEUuRwEUrj4vT6
@rizwansaifi3590
@rizwansaifi3590 4 ай бұрын
@@engineerchirag done
@CodeNinja18
@CodeNinja18 4 ай бұрын
Bring react instead of javascript it will be more helpful 😅
@engineerchirag
@engineerchirag 4 ай бұрын
Sure, noted 👍
@trialaccount2244
@trialaccount2244 4 ай бұрын
​@@engineerchiragI think if candidate not able to give soln for Vanilla js then it will make no sense to elevate it into react soln 😉
@AnkitTyagi-co8rs
@AnkitTyagi-co8rs 4 ай бұрын
let arr =[1,2,3,4,5]; let sum = arr.reduce((acc,curr)=>{ acc +=curr; return acc },0) console.log(sum) Array.prototype.myReduce = function(cb,initialVal){ let arr= this; let acc=initialVal; for(let i=0; i{ acc+=curr; return acc; },0) console.log(output)
@anantsharma13
@anantsharma13 4 ай бұрын
Array.prototype.myReduce = function (callback, initialValue) { let acc = initialValue this.forEach((element, index) => { acc = callback(acc, element, index) }) return acc } const arr = [1, 2, 3, 7] const result = arr.myReduce((acc, number) => acc + number, 0) console.log({ result })
@uditkhandelwal6330
@uditkhandelwal6330 4 ай бұрын
Array.prototype.myReduce = function(cb,initialValue) { if(typeof cb !== "function") throw new Error("Argument is not a function") const isInitialValueNotGiven = typeof initialValue === "undefined"; if(isInitialValueNotGiven) initialValue = this[0]; const len = this.length; let start = isInitialValueNotGiven ? 1 : 0; for(let i=start;i
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 99 МЛН
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
Solving Output Based JavaScript Interview Questions
28:17
Devtools Tech
Рет қаралды 4,2 М.
React JS Freshers Interview  | Chakde Frontend Interviews EP - 15
1:04:25
Fresher's Frontend Interview | JavaScript and React | Selected
1:35:44
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 99 МЛН