Tip 1: Spend time learning JavaScript internals along with their implementations.
Tip 2: Spend time learning DSA basics and solve at least 150 questions.
Tip 1: Tailor your resume to the specific job requirements.
Tip 2: Be prepared to answer questions about the details mentioned in your resume.
console.log("begins");
setTimeout(() => {
console.log("setTimeout 1");
Promise.resolve().then(() => {
console.log("promise 1");
});
}, 0);
new Promise(function (resolve, reject) {
console.log("promise 2");
setTimeout(function () {
console.log("setTimeout 2");
resolve("resolve 1");
}, 0);
}).then((res) => {
console.log("dot then 1");
setTimeout(() => {
console.log(res);
}, 0);
});
The function had to listen to an object’s property (increment) and store the result of a provided function. On listener.call(), it should print the stored outputs.
let obj = {
count: 1,
increment: function () {
return this.count++;
},
decrement: function () {
return this.count++;
},
};
let listner = listenTo(obj, "increment");
obj.increment(); // 2
obj.increment(); // 3
obj.increment(); // 4
console.log(listner().call); // [2, 3, 4];
Difference between Promise.all() and Promise.allSettled() with theory and examples.
Implement Promise.all() from Scratch.
// Problem 1: What is the output of the below program?
var fruits = ["apples", "bananas", "cucumbers", "dragonfruit"];
for (var i = 0; i < fruits.length; i++) {
var time = 1000 - 100 * i;
setTimeout(function () {
console.log(i);
}, time);
}
var fruits = ["apples", "bananas", "cucumbers", "dragonfruit"];
for (let i = 0; i < fruits.length; i++) {
var time = 1000 - 100 * i;
setTimeout(function () {
console.log(fruits[i]);
}, time);
}



• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.
'P' = 1, 'Q' = 3
tree = 2 1 4 -1 -1 3 -1 -1 -1,
The BST corresponding will be-

Here, we can clearly see that LCA of node 1 and node 3 is 2.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?