Main Navigation
Share your interview in your own words — our AI handles the rest. Hardly takes 2 minutes.
Practice mock interviews or book a 1:1 call for career guidance, resume reviews, and more.
AI interview prep powered by real interview data.
Connect with us on social media
Interview experiences & questions tagged React
Explain the purpose of React.memo(). How is it different from useMemo(), and in what scenarios would you choose one over the other?
Explain the purpose of useMemo(). When should it be used, and when can it actually hurt performance?
Create a custom React hook that synchronizes a state value with localStorage. The hook should: - Read the initial value from localStorage - Keep React state and localStorage in sync - Return the current value and a setter function - Handle changes to the storage key correctly.
What is React.memo()? Explain what problem it solves, how it works internally, and what the optional comparison function (isEqual) is used for. Also, explain the difference between React.memo() and useMemo().
Consider the following React component using useMemo. Why might useMemo not behave as expected in this example? Explain how useMemo works, what dependency arrays do, and when useMemo should or should not be used.
Coming Soon