A while back, I posted a mind map of the frontend things that were appearing the most in senior interviews outside of Brazil. I think it would also be useful to have a small list of the type of questions that are most common. I will create a document or blog post to document this but for now, it will be here because it can help someone who is about to be interviewed:
this context: In various different ways, they will try to make "tricks" with it... calling functions in different ways.. arrow function, inside a literal object (method), inside an instance like new MyObject, borrowing the function from somewhere else like: const m = myObject.m; m();...Promise API... they are keeping a close eye on this... and in 3 different places, they asked to write my own Promise.all that takes an array of promises and returns an array with the results in the SAME ORDER as the array of promises.fn1();
fn2();
setTimeout(() => {
fn3();
}, 0);
And also questions like: If javascript is a "single-threaded language," how does it handle more than one task at the same time...
createDocumentFragment() 7. Master the reduce, map, filter... of life... 8. Closures: The last one I saw was: Create a function called redGreen that when called without any parameter once it returns red and the other time it returns green. Do not use ANY place outside the function to store any variables and also do not change the way the function is called:redGreen(); //red
redGreen(); //green
redGreen(); //red
redGreen(); //green