MakeMyTrip | Round 1 | SDE II Frontend questions
Anonymous User
1122
  1. What will be the o/p for all the console logs?
var name = "mmt";
var myObject = {
  name: "myObject",
  property: this.name,
  regularFunction: function() {
    return this.name
  },
  arrowFunction: () => {
    return this.name;
  },
  iife: (function() {
    return this.name
  })()
}
 
console.log('this.name: ' + this.name);  
console.log('myObject.name: ' + myObject.name); 
console.log('myObject.property: ' + myObject.property); 
console.log('myObject.iife: '+ myObject.iife);  
console.log(myObject.regularFunction()); 


const regFn = myObject.regularFunction; 
console.log('regfn.call: ' + regFn.call(myObject)) 
console.log('regfn(): ' + regFn()); 
console.log('regFn.call(window): ' + regFn.call(window)); 
console.log('myObject.arrowFunction.call(myObject): ' + myObject.arrowFunction.call(myObject)); 
console.log('myObject.arrowFunction(): ' + myObject.arrowFunction()) 
console.log('myObject.arrowFunction.call(window)  ' + myObject.arrowFunction.call(window)) 

Q. What will be the implementation of partialCurry function?

function mul(a, b, c){
    return a * b * c;
}

const partialCurryMultiplied = partialCurry(mul, 2);
console.log(partialCurryMultiplied(3)(4) //should log 24 */
  1. Promise.all polyfill

  2. Write a function to return the count of numbers in an array, if the array can consist of string, numbers and functions ? What will be the time complexity and space complexity ?


let myArr = [ 1,"2", [3,4,[5]], function(){}, 8, 9 ];
  1. What is critical rendering path?
  2. How can you optimize a React webpage?
  3. What is async and defer in scripts ?
  4. What is prefetch, preload and preconnect ?
Comments (4)