React

0%
Coding
Theory
Quiz

    State & Props

    • What does it mean to lift state up, and what architectural problem does this solve?

      Junior
    • What is prop drilling and what are the built-in React ways to solve it?

      Junior
    • What is prop drilling, and at what point does it become a problem?

      Junior
    • How does useRef differ from useState, and when should you use a ref instead of state?

      Mid
    • Explain the difference between a controlled and an uncontrolled component, and in what scenario would you prefer an uncontrolled component?

      Mid
    • When would you choose useReducer over useState, and what are the architectural trade-offs?

      Mid
    • Why must state be treated as immutable in React, and what happens if you mutate state directly instead of using a setter function?

      Mid
    • How does React handle state updates that are dependent on the previous state, and why is the functional update pattern preferred?

      Mid
    • What happens if you update state inside a render function or the body of a function component?

      Mid
    • How do you decide whether a piece of data should be managed as state or passed as props, and what are the conceptual trade-offs?

      Mid
    • What is the difference between a callback ref and a ref object created with useRef, and when would you use a callback ref?

      Mid

    Jsx & Fundamentals

    • How does React handle one-way data flow, and why is this considered an advantage over two-way data binding?

      Junior
    • Why should we use <Fragment> (or <>) instead of a <div> wrapper, and how does this impact the DOM tree and CSS selectors like flexbox?

      Junior
    • What is the difference between State and Props in React?

      Junior
    • What is JSX, and what does it actually compile to?

      Junior
    • Why must we always start Component names with a capital letter in JSX?

      Junior
    • What is the difference between a class component and a function component, and why has the community largely shifted to function components?

      Junior
    • What are the different ways to conditionally render content in JSX, and what are the pitfalls of using short-circuit evaluation with values like 0?

      Junior
    • How does the children prop work, and how does it enable component composition?

      Junior
    • What are Synthetic Events in React, and why does React use its own event system instead of native browser events?

      Mid
    • Why does React favor composition over inheritance, and what does a compositional architecture look like?

      Mid
    • What are "Pure Components" and how do they relate to functional programming?

      Mid
    • How does React handle events under the hood: where does it attach event listeners, and what changed about event delegation in React 17?

      Senior

    Hooks Fundamentals

    • How do the three forms of the useEffect dependency array (no array, empty array, populated array) differ in terms of when the effect runs?

      Junior
    • What is the primary benefit of a custom hook over a standard helper function, and how do they interact with React's stateful logic?

      Mid
    • Why can't you use async functions directly inside a useEffect?

      Mid
    • What are the main lifecycle methods of a class component, and what are their equivalents using Hooks in a function component?

      Mid
    • What is the purpose of the cleanup function returned from useEffect, and when exactly does React run it?

      Mid
    • What are the Rules of Hooks, and why does React enforce that hooks are called at the top level in the same order every render?

      Mid
    • Why can't hooks be called inside loops or conditions, and how does React track hook state internally using an array/linked list?

      Senior
    • Explain the stale closure problem in useEffect. How does the dependency array solve this, and what happens if you omit a dependency?

      Senior

    Performance Optimization

    • What is the difference between useMemo and useCallback, and when is it over-optimization to use them?

      Mid
    • Explain the concept of code splitting in React using React.lazy and Suspense, and how does it improve Time to Interactive?

      Mid
    • How does React.memo work, and how does it differ from useMemo?

      Mid
    • How does React.memo optimize performance, and what is the difference between a shallow comparison and a deep comparison in this context?

      Mid
    • How do you identify a performance bottleneck in a React application?

      Mid
    • What is virtualization (or windowing), and why is it necessary for rendering large datasets?

      Mid
    • How does the new React Compiler (React Forget) change how we think about performance optimization, and does it make useMemo and useCallback obsolete?

      Senior
    • What are the performance tradeoffs of using the Context API for frequently changing values?

      Senior
    • How do you identify and fix "wasted" or unnecessary re-renders in a large application?

      Senior
    • What are the costs of over-using React.memo, and why shouldn't we wrap every single component in it?

      Senior

    Context Keys & Concurrent Rendering

    • What is the purpose of "Keys" in lists, and what happens if you use a random value or an index as a key?

      Junior
    • What does useContext do, and how does a component subscribe to and re-render on context changes?

      Junior
    • When is the Context API the right choice versus simply drilling props, and what are the performance pitfalls of overusing Context?

      Mid
    • What is the Context API, and does it replace a dedicated state management library?

      Mid
    • What is the difference between useTransition and useDeferredValue, and when would you use one over the other to improve perceived performance?

      Senior
    • Explain Suspense for data fetching: how does it change the way we handle loading states compared to the traditional loading-spinner pattern?

      Senior
    • What is 'Concurrent Rendering', and how does it allow React to remain responsive during heavy UI updates?

      Senior
    • Explain the concept of Transitions in React 18 and how useTransition helps maintain UI responsiveness during heavy re-renders.

      Senior

    Component Patterns

    • What are Error Boundaries, why can they only be implemented as Class Components, and what types of errors do they not catch?

      Mid
    • When would you use ReactDOM.createPortal, and can you explain a scenario where the DOM hierarchy needs to differ from the React component hierarchy?

      Mid
    • What are "Higher-Order Components" (HOCs) and why have they become less common since the introduction of Hooks?

      Mid
    • Explain the "Render Props" pattern.

      Mid
    • Compare the HOC pattern with the Render Props pattern, and why have both largely been replaced by Hooks?

      Senior

    Effects Refs & Utility Hooks

    • What is the overall purpose of Strict Mode in React, and what does wrapping your app in it accomplish?

      Junior
    • What is the difference between useEffect and useLayoutEffect, and when would using the former cause a flicker in the UI?

      Mid
    • Why does React's 'Strict Mode' double-invoke effects and reducers in development, and what kind of bugs is it trying to surface?

      Mid
    • What is useId used for, and why can't you just use a random number or index to generate IDs?

      Mid
    • What is the purpose of useImperativeHandle when used with forwardRef?

      Senior

    Rendering Internals & Reconciliation

    • Explain the difference between the Virtual DOM and the real DOM, and why is the Virtual DOM considered a performance optimization?

      Junior
    • What exactly causes a React component to re-render, and does a parent re-rendering always cause all children to re-render?

      Mid
    • Explain the reconciliation process: how does React's diffing algorithm decide which parts of the DOM to update?

      Mid
    • What is the "Virtual DOM" and how does the "Diffing Algorithm" work?

      Mid
    • What is React Fiber, and how does it differ from the old stack reconciler in terms of how it handles updates?

      Senior
    • What is automatic batching in React 18, and how does it change the way state updates are processed compared to older versions?

      Senior
    • Explain the difference between the Render phase and the Commit phase in the Fiber architecture, and which one is interruptible.

      Senior
    • Explain the difference between the Virtual DOM and the Shadow DOM. Why does React use one but not necessarily the other?

      Senior
    • Why does React need to traverse the entire UI tree during a re-render, and what are the performance implications of this?

      Senior

    Server Components & Ssr

    • What does the 'use client' directive actually do? Does it mean the component only renders on the client?

      Mid
    • Why is it now recommended to fetch data directly inside Server Components rather than using useEffect on the client?

      Mid
    • What is 'Hydration' in React, and why do 'Hydration Mismatch' errors occur? How does React 18/19's selective hydration improve this?

      Senior
    • What is the fundamental difference between a Server Component and a Client Component, and why can't you use useState in a Server Component?

      Senior
    • Explain the difference between React Server Components and traditional Server-Side Rendering (SSR). Do they solve the same problem?

      Senior
    • What is "Streaming SSR" and how does it improve Time to First Byte (TTFB)?

      Senior
    • How does useSyncExternalStore help in keeping React state in sync with external data sources?

      Senior

    React 19 Features

    • Explain the concept of 'Actions' in React 19. How do they simplify form handling compared to the traditional useState and onSubmit pattern?

      Mid
    • Why is forwardRef being deprecated in React 19, and how do we handle refs in functional components now?

      Mid
    • What is the difference between useActionState and useFormStatus, and when would you use one over the other?

      Mid
    • What problem does the use hook solve, and how does it differ from standard hooks regarding where it can be called?

      Senior
    • Explain how the useOptimistic hook works. Why is it better than manually managing 'loading' and 'success' states for UI responsiveness?

      Senior