- React
- React Fundamentals for Frontend Interviews
React Fundamentals Interview Questions: JSX & Props
React fundamentals interview questions come up in frontend screening rounds to verify that candidates understand how the declarative paradigm functions under the hood. Understanding why React components must remain pure functions without side-effects during render is the first line of defense against subtle production bugs.
In these lessons, step through JSX compilation via the modern jsx-runtime, analyze the React element object structure, inspect list reconciliation key rules, and avoid common traps like the boolean zero pitfall in conditional rendering.
React Fundamentals Interview Questions: 5 lessons
React Mental Model & The Declarative Paradigm
The React mental model is declarative: instead of mutating the DOM step-by-step, you describe what the UI should look like for a given state as a pure function (UI = f(state)), and React calculates the necessary DOM updates efficiently.
JSX Compilation & Modern JSX Runtime
JSX in React is syntactic sugar that compilers transpile into createElement or modern jsx-runtime function calls, returning plain JavaScript element objects marked with a unique Symbol($$typeof) security tag.
Components, Props & Children Composition
Props in React are read-only inputs passed from parents to children that enforce unidirectional data flow. The children prop enables component composition and slot patterns, allowing parents to pass arbitrary UI trees without coupling components to specific child implementations.
Conditional Rendering & List Keys
Conditional rendering displays UI based on conditions, where the falsy zero (0 && <Component />) pitfall renders the literal number 0. Keys give list elements stable identities across renders, allowing React to match existing DOM nodes instead of re-creating or incorrectly recycling stateful elements.
Fragments, Portals & Event Bubbling
Fragments group elements without adding extra DOM nodes. Portals render children into a different physical DOM container (like document.body) while preserving React synthetic event bubbling through the virtual component tree, regardless of physical DOM hierarchy.
