React and JavaScript Core Concepts
Problem Cover React and JavaScript core concepts: the Virtual DOM, component lifecycle, the Context API, Redux, and the event loop.
Be ready to discuss
- Virtual DOM: an in-memory element tree that React diffs against the previous tree to compute and batch the minimal set of real DOM mutations.
- Component lifecycle: the mounting, updating, and unmounting phases, and the class methods (
componentDidMount,componentDidUpdate,componentWillUnmount) versus theiruseEffectequivalents. useEffectspecifics: the dependency array, the cleanup function, and why effects run after paint.- Context API: passing values down the tree without prop drilling - and its sharp edge, that any change to the context value re-renders every consumer.
- Redux: a single global store, plain-object actions describing what happened, and pure reducers computing the next state; predictable updates plus time-travel debugging.
- When Context is enough vs when you actually need Redux.
- The event loop: one call stack, a macrotask queue (timers, I/O), and a microtask queue (promise callbacks) that drains fully between every macrotask.
- Why JS is non-blocking despite being single-threaded, and how a long synchronous task starves rendering and every queued callback.
asked …