DEV Community

FatimaAlam1234
FatimaAlam1234

Posted on

RocketLane Interview II

Q1. Tell me about yourself
Q2. Why choose React as a framework? What is the main selling point of it?
Q3. While working with React what kind of issues did you come across different browsers?
Ans. synthetic events, Polyfills,
Q4. What is Virtual DOM?
Q5. How does React work (React flow)
Q6. If Virtual DOM after updating gives the same result as the Real DOM, don't you think it will be an expensive operation on the react side to update the virtual DOM?
Ans -> shouldComponentUpdate, Pure Components.

Q7. How can you optimize renders?
Ans -> Memo, useMemo(), useCallback()
Q8. Is Javascript single-threaded?
Q9. So since you said there are different queues that Javascript maintains do you know their precedence?
Ans -> Explain event loop.
Q10. So if I have 3 tasks 1 promise, 1 timer and 1 input - output task(Fetch call), What do you think will be the order of their execution.
Ans -> Promise -> Timer -> (Fetch Call).
Q11. What do you know about cookies?
Q12. Apart from cookies which type of browser storage do you know?
Q13. If I open 2 different tabs for the same website does it share the session data?
Q14. What do you mean by Authorization?
Q15. How is it different from Authentication?
Q16. Session Storage vs Local Storage?
Q17. Can session of one tab is accessible in other tab?
Q18. If I store some data in the local storage while in a Netflix session will I be able to access that local storage data in the Amazon website?
Q19. Javascript Coding Question.

Complete the Calculator Function

const calc = Calculator();
calc.one().three().five() // should return 1+3+5=9
Enter fullscreen mode Exit fullscreen mode
function Calculator() {
    let acc = 0;
    return { one : () => {
         acc+=1;
         return this;
    },
     three: () => {
         acc+=3;
         return this;
    },

     five : () => {
        acc+=5;
        return this;
    }};

}
const calc = Calculator();
calc.one().three().five() // should return 1+3+5=9

//2+5+6
calc.two().five().six();
Enter fullscreen mode Exit fullscreen mode

Q20. CSS Question.

.blue {
    color: blue;
}
.red {
    color: red !important;
}
.green {
    color: green;
}


<div class="blue green">Hello World!!</div>
<div class="red green blue">Hello World!!</div>
Enter fullscreen mode Exit fullscreen mode

Q20.1 What is the final color of both divs?
Q20.2 What if we remove !important
Q20.3 which is priority? definition, usage?

Top comments (0)