{
 "schemaVersion": 1,
 "pathSlug": "react-under-the-hood",
 "items": [
  {
   "questionId": "react.jsx_components__510",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How are inline styles specified in JSX?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<div style={{ backgroundColor: '#f0f', padding: 8 }} />",
    "label": "jsx-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Using a special css attribute on JSX elements"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A JavaScript object with camelCased properties"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "As an array of individual style declarations"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "As a CSS string identical to regular HTML usage"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__5273849",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Two components appear visually similar but only one is actually a component. Which criterion separates a component from an ordinary JSX expression?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It declares at least one state hook inside its body"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It returns a fragment rather than a plain element"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It is a function whose name starts with a capital letter"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It has a displayName string attached to the export"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__400532",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which description best fits the purpose of a Suspense boundary in the render tree?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Shows a fallback while descendants wait on a pending async resource"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Catches synchronous exceptions thrown from any descendant component tree"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Defers descendant effects until the parent finishes its own layout phase"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Batches state updates across descendants into a single commit transition"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__504",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Why must custom React component names start with an uppercase letter?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function ProfileCard() {\n  return <section>Profile</section>;\n}",
    "label": "jsx-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "JavaScript requires uppercase for class names just in modules"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Lowercase functions cannot return valid JSX elements"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "React reads lowercase tags as HTML, uppercase as components"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The bundler automatically removes lowercase function exports"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__507",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How does a parent inject content into a child component's layout?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function Card({ children }) {\n  return <div className=\"card\">{children}</div>;\n}\n// Usage: <Card><p>Hello</p></Card>",
    "label": "jsx-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Through named slot elements mirroring the web-components slot API"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Through a template attribute set on the child JSX element directly"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Through the children prop, between opening and closing tags"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Through an innerHTML prop that injects raw markup into the child"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__40827",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which of the following is a valid self-closing JSX tag?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "code",
        "v": "<input>"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "code",
        "v": "<Input>"
       },
       {
        "t": "code",
        "v": "</Input/>"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "code",
        "v": "<Input />"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "code",
        "v": "<Input>"
       }
      ],
      "shape": "code"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__40822",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does JSX compile to under the modern (automatic) JSX transform?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// JSX\nconst el = <h1 className=\"title\">Hello</h1>;\n// Modern transform compiles to:\nimport { jsx as _jsx } from 'react/jsx-runtime';\nconst el = _jsx('h1', { className: 'title', children: 'Hello' });",
    "label": "jsx-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "jsx() and jsxs() runtime calls auto-imported from react/jsx-runtime"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Style-aware object literals consumed by a CSS-in-JS runtime adapter"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Pre-rendered HTML strings inlined into the bundled module output"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Direct document.createElement and appendChild DOM API call sequences"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__40946",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does the "
      },
      {
       "t": "code",
       "v": "displayName"
      },
      {
       "t": "text",
       "v": " property on a component do?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const MyComponent = React.memo(function() { return <div />; });\nMyComponent.displayName = 'MyComponent';",
    "label": "jsx-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Sets the name shown in React DevTools and stack traces"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Overrides the component's key in reconciliation"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Sets the accessible name for screen readers via aria-label"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Provides a human-readable label displayed in the rendered DOM"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__508",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What renders when a boolean true is used as a JSX child expression?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<div>{true}{false}{null}</div>\n// renders: <div></div>",
    "label": "jsx-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The string 'true' is displayed"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Nothing visible is rendered"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "React throws a type error"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A checkbox input element appears"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.jsx_components__506",
   "topic": "react",
   "subSkill": "jsx_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does React.Fragment (or <>...</>) accomplish?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "return (\n  <>\n    <Header />\n    <Main />\n  </>\n);",
    "label": "jsx-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Creates a portal to a separate DOM tree location"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Caches component render output in a persistent store"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Groups multiple elements without adding an extra DOM node"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Enables server-side rendering mode for the subtree"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__40838",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "When should you use the functional updater form "
      },
      {
       "t": "code",
       "v": "setState(prev => prev + 1)"
      },
      {
       "t": "text",
       "v": " instead of "
      },
      {
       "t": "code",
       "v": "setState(state + 1)"
      },
      {
       "t": "text",
       "v": "?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// Buggy: both calls read stale count=0 → count ends at 1\nsetCount(count + 1);\nsetCount(count + 1);\n// Correct: prev is the latest queued value → count ends at 2\nsetCount(prev => prev + 1);\nsetCount(prev => prev + 1);",
    "label": "props-state.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "When you want the update to be synchronous rather than batched"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "When state is an object, since objects need the functional form"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "When the new state depends on the previous state value here"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Just inside useEffect to prevent infinite loops here"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__41005",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What happens if you pass a boolean "
      },
      {
       "t": "code",
       "v": "true"
      },
      {
       "t": "text",
       "v": " as a prop value in JSX without specifying a value?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<Button disabled /> // same as <Button disabled={true} />",
    "label": "props-state.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The prop is set to the boolean true"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The prop is set to undefined until React coerces it on read"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The prop is set to the string 'true'"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The prop is set to the empty string, mirroring HTML attributes"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__510",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What happens when you call a state setter with the same value as current state?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const [name, setName] = useState('Ada');\nsetName('Ada'); // no re-render triggered",
    "label": "props-state.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "React bails out and skips re-rendering the component"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The component unmounts and remounts with fresh state"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "React always re-renders the component regardless of value"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "React throws a duplicate value error in development mode"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__518",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How does React determine if a React.memo component should re-render?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A shallow Object.is compare on each prop value"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It deep-compares the props recursively"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It converts props to JSON strings for comparison"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It re-renders memo-wrapped components regardless"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__752903",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A parent lifts a single "
      },
      {
       "t": "code",
       "v": "onChange"
      },
      {
       "t": "text",
       "v": " to an object setter: "
      },
      {
       "t": "code",
       "v": "setUser({...user, name: e.target.value})"
      },
      {
       "t": "text",
       "v": ". Typing fast only keeps the last keystroke. Why?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "React coalesces spread operators into one assignment and drops fields"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Object state must be set with Object.assign for partial updates to persist"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Stale "
       },
       {
        "t": "code",
        "v": "user"
       },
       {
        "t": "text",
        "v": " snapshots overwrite one another within the same batch cycle"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The input is rendered uncontrolled, so keystrokes bypass the setter entirely"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__40836",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does the "
      },
      {
       "t": "code",
       "v": "children"
      },
      {
       "t": "text",
       "v": " prop contain?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function Card({ children }) {\n  return <div className=\"card\">{children}</div>;\n}\n<Card><p>Hello</p></Card>",
    "label": "props-state.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The JSX between the opening and closing tags"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The component's internal state object"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A list of the mounted child components"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "An array of DOM nodes attached to the component"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__508",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is prop drilling?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Passing props through intermediate components that do not use them"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A method for deep cloning props between sibling components"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A testing technique for validating component prop contracts"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A tool for auto-generating prop type definitions from usage"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__5947289",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Switching "
      },
      {
       "t": "code",
       "v": "docId"
      },
      {
       "t": "text",
       "v": " has to clear whatever the user typed and leave the pin and the zoom untouched. Which placement does exactly that?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function Toolbar() {\n  const [pinned, setPinned] = useState(false);\n  return (\n    <button onClick={() => setPinned(!pinned)}>\n      {pinned ? \"pinned\" : \"pin\"}\n    </button>\n  );\n}\n\nfunction Draft({ docId }: { docId: string }) {\n  const [text, setText] = useState(\"\");\n  return (\n    <textarea\n      placeholder={`notes on ${docId}`}\n      value={text}\n      onChange={(e) => setText(e.target.value)}\n    />\n  );\n}\n\nfunction Pane({ docId }: { docId: string }) {\n  const [zoom, setZoom] = useState(1);\n  return (\n    <div>\n      <h2>{docId}</h2>\n      <button onClick={() => setZoom(zoom + 1)}>zoom {zoom}</button>\n      <div className=\"wrap\">\n        <Toolbar />\n        <Draft docId={docId} />\n      </div>\n    </div>\n  );\n}",
    "label": "props-state.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "key={docId} on the wrap <div> that holds both children"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "key={docId} on <Pane /> at the site that renders the pane"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "key={docId} on the <Draft /> element inside the wrap div"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "key={docId} on the <textarea /> that Draft renders"
       }
      ],
      "shape": "code"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__864172",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A dropdown's selected option is passed down through 6 nested layout components that do nothing with it except forward it. A refactor aims to cut this ceremony without adopting a global store. What's the appropriate remedy?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Collapse the six intermediate layouts into one giant component so the prop only travels through one boundary"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Attach the selection to a module singleton that each layout layer imports on demand when it mounts again"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Move the selection into a URL search param and read it in the leaf via a route-level loader function each render"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Introduce a context at the nearest ancestor so intermediate layers stop forwarding the value manually"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.props_state__509",
   "topic": "react",
   "subSkill": "props_state",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How do you update a nested object in state immutably?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "setUser(prev => ({\n  ...prev,\n  address: { ...prev.address, city: 'NYC' }\n}));",
    "label": "props-state.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Use JSON.stringify then JSON.parse on each update pass"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Call Object.freeze before attempting to mutate the object"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Directly mutate the nested property on the state object"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Spread each level so the changed path gets new references"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__40975",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How do intentional re-renders differ from re-renders that cascade from an ancestor?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Intentional re-renders run on the sync lane; cascading ones are always deferred onto a transition lane"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Intentional re-renders mutate the real DOM; cascading ones only update the element tree held in memory"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Intentional re-renders skip the commit phase entirely; cascading ones still run effects and refs as normal"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "An intentional re-render is dispatched by a setter on this component; a cascading one comes from the parent re-rendering"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__40936",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A profile form must drop every piece of its own state when you switch to another user, and you cannot edit the form's implementation. What is the idiomatic fix?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// Changing userId resets the UserProfile state entirely\n<UserProfile key={userId} userId={userId} />",
    "label": "rendering-lifecycle.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Unmount and remount the component using a conditional render with a setTimeout"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Give the element a different "
       },
       {
        "t": "code",
        "v": "key"
       },
       {
        "t": "text",
        "v": " prop, since React reads a new key as a new instance"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Call the state setter with undefined, which restores each hook's initial value"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Pass a "
       },
       {
        "t": "code",
        "v": "reset"
       },
       {
        "t": "text",
        "v": " prop and clear each piece of state from an effect that watches it"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__532",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "When does useLayoutEffect fire compared to useEffect?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "useLayoutEffect(() => {\n  const { height } = ref.current.getBoundingClientRect();\n  if (height > maxHeight) {\n    ref.current.style.overflow = 'auto';\n  }\n}, [content]);",
    "label": "rendering-lifecycle.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "useLayoutEffect and useEffect fire at the same time"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "useLayoutEffect fires before the DOM is updated"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It fires after DOM mutations but before the browser paints"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "useLayoutEffect fires asynchronously after the browser paints"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__5930299",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does a function component return to describe its piece of the UI?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "a CSS rule"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "a JSON blob"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "JSX markup"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "a DOM node"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__7551131",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "This breadcrumb collapses itself once it overflows. QA films a flash on deep navigations: the full trail shows for a frame, then snaps compact. A teammate proposes the patch below. What is the right review verdict?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function Crumbs({ parts }) {\n  const [compact, setCompact] = useState(false);\n  const navRef = useRef(null);\n\n  useEffect(() => {\n    const el = navRef.current;\n    if (!compact && el.scrollWidth > el.clientWidth) {\n      flushSync(() => setCompact(true));\n    }\n  }, [parts, compact]);\n\n  const shown = compact\n    ? [parts[0], \"…\", parts[parts.length - 1]]\n    : parts;\n  return (\n    <nav ref={navRef}>\n      {shown.map((p) => <span key={p}>{p}</span>)}\n    </nav>\n  );\n}",
    "label": "rendering-lifecycle.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Request changes: run the overflow check during render instead, where the pass can read the nav it is producing and skip the second commit"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Request changes: schedule the collapse inside requestAnimationFrame, which the browser runs ahead of the frame the flash appears in"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Request changes: only the layout-effect slot orders a scheduled update ahead of the frame, so move the check there and drop the flush"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Approve: the Effect already runs after the commit, and the forced flush inside it now lands the compact trail ahead of the frame"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__7734749",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "One click on Publish. What does the handler log, and how many times did React invoke Toolbar for that click?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function Toolbar() {\n  const [dirty, setDirty] = useState(true);\n  const [mode, setMode] = useState(\"edit\");\n  const out = useRef(null);\n\n  function onPublish() {\n    setDirty(false);\n    flushSync(() => setMode(\"preview\"));\n    console.log(out.current.textContent);\n  }\n\n  return (\n    <>\n      <span ref={out}>{`${mode}/${dirty}`}</span>\n      <button onClick={onPublish}>Publish</button>\n    </>\n  );\n}",
    "label": "rendering-lifecycle.tsx"
   },
   "widget": {
    "kind": "predict_output",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "preview/false, and one call: both updates rode the same render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "preview/false, and two calls: the pending update flushes in its own render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "preview/true, and two calls: the queued setter renders after the handler"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "edit/true, and one call: the flush only raises the update's priority"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__500863",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which best describes the effect of the React Compiler on a component that already follows the rules of React?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It rewrites effect callbacks into synchronous render-phase code so side effects run before commit"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It auto-memoizes values and components so manual useMemo and memo become largely unnecessary"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It inlines every child component into its parent so the runtime tree is a single flat element"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It ships a new event system that bypasses synthetic events and dispatches directly to the DOM layer"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__40991",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What forces React to tear down a subtree and rebuild it from scratch during reconciliation, instead of updating in place?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// Type change at same position: full teardown\n{isEditing ? <EditForm /> : <DisplayView />}\n// Type stable: update in place\n<Form editable={isEditing} />",
    "label": "rendering-lifecycle.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A useMemo dependency that changes, invalidating the memoized branch and forcing a new mount"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The element at a given position changes type or its key changes, so the previous instance cannot be reused"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "An error caught by an error boundary, which always unmounts and remounts the affected subtree"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A render that takes longer than the frame budget, causing React to discard and retry the work"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__522",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A stateful wrapper re-renders on every keystroke, yet the "
      },
      {
       "t": "code",
       "v": "<List />"
      },
      {
       "t": "text",
       "v": " it receives as "
      },
      {
       "t": "code",
       "v": "children"
      },
      {
       "t": "text",
       "v": " never re-renders. Why?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// Parent creates <List /> once\nfunction Parent() {\n  return <Wrapper><List /></Wrapper>;\n}\n// Wrapper state changes don't re-render List",
    "label": "rendering-lifecycle.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Children passed as props are created in the parent scope as stable references"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Children are rendered first and cached; the parent's update reuses the cached tree directly"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Passing children as a prop makes reconciliation compare by string key, not by identity"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The children prop is shallow-compared automatically as if React.memo wrapped each child"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.rendering_lifecycle__89309",
   "topic": "react",
   "subSkill": "rendering_lifecycle",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What happens when you render "
      },
      {
       "t": "code",
       "v": "<form action={serverAction}>"
      },
      {
       "t": "text",
       "v": " in React 19?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// Server action:\nasync function addTodo(formData) {\n  'use server';\n  await db.insert({ text: formData.get('text') });\n}\n\nfunction TodoForm() {\n  return (\n    <form action={addTodo}>\n      <input name=\"text\" />\n      <SubmitButton />\n    </form>\n  );\n}\n\nfunction SubmitButton() {\n  const { pending } = useFormStatus();\n  return <button disabled={pending}>Add</button>;\n}",
    "label": "rendering-lifecycle.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "React turns the form into a controlled component and invokes the action on every input change instead of on submission"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "React generates a URL endpoint for the function at build time, and the form posts to that URL as a normal HTML form"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "React ignores a function passed in the action prop, so you still have to handle the submission yourself in onSubmit"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "React enhances the form to submit via the action function instead of a full-page navigation, with automatic pending state tracking"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__1780465",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does the 0 represent in the call "
      },
      {
       "t": "code",
       "v": "useState(0)"
      },
      {
       "t": "text",
       "v": "?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const [count, setCount] = useState(0);",
    "label": "hooks-core.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The number of updates the state allows"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The position of this hook in the list"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The delay in seconds before it appears"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The initial value the state starts with"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__40924",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does "
      },
      {
       "t": "code",
       "v": "useState"
      },
      {
       "t": "text",
       "v": " return?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const [count, setCount] = useState(0);",
    "label": "hooks-core.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "An object with "
       },
       {
        "t": "code",
        "v": "state"
       },
       {
        "t": "text",
        "v": " and "
       },
       {
        "t": "code",
        "v": "setState"
       },
       {
        "t": "text",
        "v": " properties"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "An array with the current value and an updater"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A single state value that updates automatically"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A function that returns the current state when called"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__1780464",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "In React, what kind of thing is useState?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A component that returns its own piece of markup"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A CSS class that changes how an element looks"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A JSX tag you place directly inside the markup"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A Hook, a special function you call inside components"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__704177",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A dev complains StrictMode runs their effect twice in development. What is the correct mental model for why that happens and what it surfaces?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It simulates a mount, unmount, remount to surface effects that are not correctly cleaned up"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It disables React's batching in development so sequential setState calls produce distinct renders"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It runs every render twice to catch impure renders by comparing outputs from both repeat passes"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It runs effects twice only when dependency arrays are empty, to warn about missing dependencies"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__40945",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the purpose of returning a cleanup function from "
      },
      {
       "t": "code",
       "v": "useEffect"
      },
      {
       "t": "text",
       "v": "?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "To signal React that the effect completed successfully before the next commit"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "To prevent the effect from running again on the component's initial mount call"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "To undo the effect's work before the next effect run or when the component unmounts"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "To reset state to its initial value whenever the component re-renders during use"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__200627",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "After the button is clicked once, what does the final render display?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function App() {\n  const [count, setCount] = React.useState(0);\n  function onClick() {\n    setCount(count + 1);\n    setCount(count + 1);\n    setCount(count + 1);\n  }\n  return <button onClick={onClick}>{count}</button>;\n}",
    "label": "hooks-core.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "2"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "0"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "3"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "1"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__502",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does the dependency array in useEffect control?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "useEffect(() => {\n  fetchUser(userId);\n}, [userId]);",
    "label": "hooks-core.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Which sibling components can access the effect logic"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The maximum allowed re-render count for the component"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "When the effect re-runs, based on which listed values changed"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The execution order of multiple effects in a component"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__41000",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the "
      },
      {
       "t": "code",
       "v": "useEffect"
      },
      {
       "t": "text",
       "v": " race condition and how do you fix it?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "useEffect(() => {\n  let cancelled = false;\n  fetchUser(id).then(data => {\n    if (!cancelled) setUser(data);\n  });\n  return () => { cancelled = true; };\n}, [id]);",
    "label": "hooks-core.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "An effect and a state update execute out of order due to React's batching, so the effect reads a state value that does not exist anywhere in the render history"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "An effect re-runs before its previous cleanup completes, corrupting the prior effect's data structures and producing an inconsistent final render output in the DOM"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Successive prop changes start overlapping fetches; the slower earlier request can overwrite the fresher later result - fix via cleanup flag or AbortController"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Two effects run simultaneously across Web Workers and both write to the same state variable without coordination, producing a corrupt final state on commit"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__503",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does an empty dependency array [] in useEffect mean?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "useEffect(() => {\n  initAnalytics();\n  return () => cleanupAnalytics();\n}, []);",
    "label": "hooks-core.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The effect runs on every single render cycle"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The effect runs only once after the initial render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The effect runs only on component unmount cleanup"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The effect never runs during the component lifecycle"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_core__100384",
   "topic": "react",
   "subSkill": "hooks_core",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "The component renders for the first time and stays on screen. What gets logged?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "fill_gap",
    "code": {
     "lang": "tsx",
     "code": "function App() {\n  React.useEffect(() => {\n    console.log('__GAP_g1__');\n    return () => console.log('clean');\n  }, []);\n  return <p>hi</p>;\n}"
    },
    "gaps": [
     {
      "id": "g1",
      "choices": [
       {
        "id": "c1",
        "label": "clean"
       },
       {
        "id": "c2",
        "label": "tick!"
       },
       {
        "id": "c3",
        "label": "mount"
       },
       {
        "id": "c4",
        "label": "setup"
       }
      ]
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__100004",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which statement best describes what a custom hook may return?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A cleanup function the consumer is expected to call once the component finally unmounts"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A two-element tuple in the [value, setter] shape, mirroring how useState is built"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A JSON-serializable value so React DevTools can record it in the snapshot panel later"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Any JavaScript value: a primitive, tuple, plain object, or nothing at all"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__100241",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A teammate wrote a reusable function named "
      },
      {
       "t": "code",
       "v": "getLocalStorage"
      },
      {
       "t": "text",
       "v": " that internally calls "
      },
      {
       "t": "code",
       "v": "useState"
      },
      {
       "t": "text",
       "v": " and "
      },
      {
       "t": "code",
       "v": "useEffect"
      },
      {
       "t": "text",
       "v": ". Why does React's linter flag it?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function getLocalStorage(key) {\n  const [value, setValue] = useState(() => localStorage.getItem(key));\n  useEffect(() => { localStorage.setItem(key, value); }, [key, value]);\n  return [value, setValue];\n}",
    "label": "custom-hooks.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "React forbids calling more than one built-in hook from inside another function regardless of what name you give it."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Any function that mutates localStorage must be declared as an action via the new "
       },
       {
        "t": "code",
        "v": "useAction"
       },
       {
        "t": "text",
        "v": " primitive first."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Functions that touch "
       },
       {
        "t": "code",
        "v": "window"
       },
       {
        "t": "text",
        "v": " must be wrapped in "
       },
       {
        "t": "code",
        "v": "useSyncExternalStore"
       },
       {
        "t": "text",
        "v": " or they will crash during SSR builds."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Only names starting with "
       },
       {
        "t": "code",
        "v": "use"
       },
       {
        "t": "text",
        "v": " are recognized as hooks, so the Rules of Hooks lint cannot verify it."
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__100231",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "When naming a function that calls other hooks internally, which form signals to React (and the linter) that the Rules of Hooks apply to it?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A helper identifier that ends with Hook, for example userDataHook"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A PascalCase identifier identical to a component name, for example UserData"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A camelCase identifier that begins with the prefix use, for example useUserData"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A snake_case identifier that describes the resource, for example user_data_loader"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__516",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What problem does a useStableCallback hook solve?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function useStableCallback(fn) {\n  const ref = useRef(fn);\n  // Safe for app code: render is pure, ref write is idempotent\n  // For library code targeting concurrent React, use useInsertionEffect instead\n  ref.current = fn;\n  return useCallback((...args) => ref.current(...args), []);\n}",
    "label": "custom-hooks.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A wrapper that converts asynchronous callback functions to execute synchronously"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A stable function reference that always calls the latest callback version"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A mechanism that permanently locks a callback to its initial closure captured values"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A guarantee that a callback function will never throw any runtime errors at all"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__400001",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which statement best describes how an effect inside a custom hook interacts with React 18 Strict Mode during development?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Setup runs once and teardown is deferred until the consumer fully unmounts"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Setup is skipped on first mount and only runs on the subsequent update cycle"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Setup runs then teardown runs then setup reruns on the same mount"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Setup and teardown run in parallel across two isolated shadow fiber trees"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__8639221",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How do you reuse a custom hook across several files?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Copy its body into each file that needs it"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Attach it to the window so files can read it"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Export it from a module and import it where needed"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Register it once in the root component tree"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__526",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How would you design a hook that shares a single subscription across multiple consumers?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "let listeners = new Set();\nlet ws = null;\nfunction subscribe(cb) {\n  listeners.add(cb);\n  if (listeners.size === 1) ws = connect();\n  return () => {\n    listeners.delete(cb);\n    if (listeners.size === 0) ws.close();\n  };\n}",
    "label": "custom-hooks.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Create a brand-new subscription for each individual consuming component instance"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Use window.postMessage for cross-component subscription sharing and broadcasting"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A module-level store with ref counting: subscribe on first mount, unsub on last"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Store the subscription object directly in React component state via useState hook"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__403884",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "code",
       "v": "useEventEmitter(event, handler)"
      },
      {
       "t": "text",
       "v": " lists "
      },
      {
       "t": "code",
       "v": "handler"
      },
      {
       "t": "text",
       "v": " in its effect deps. After adopting React 19's "
      },
      {
       "t": "code",
       "v": "useEffectEvent"
      },
      {
       "t": "text",
       "v": ", under what circumstance is replacing that dep still wrong?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "When the handler closure includes props that change frequently, since "
       },
       {
        "t": "code",
        "v": "useEffectEvent"
       },
       {
        "t": "text",
        "v": " rejects unstable bindings."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "When the handler is defined inline in the parent render, which causes the event to re-run on every keystroke emitted."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "When the event emitter library returns a promise-based subscription that cannot be torn down synchronously later."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "When the handler is itself a reactive value that the subscription logic uses for filtering or identity checks."
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__40979",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Why should a custom hook that wraps a subscription always return a stable value?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// Unstable: new object each render\nfunction useStore() { return { value, update }; }\n// Stable: same tuple references\nfunction useStore() { return useMemo(() => ({ value, update }), [value]); }",
    "label": "custom-hooks.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Unstable return values cause hooks to violate the Rules of Hooks ordering"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "An unstable return makes consumers re-render whenever the host does"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "React DevTools requires stable return values to display hook state accurately"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "React caches hook return values; instability prevents the cache from working"
       }
      ],
      "shape": "code"
     }
    ]
   }
  },
  {
   "questionId": "react.custom_hooks__524",
   "topic": "react",
   "subSkill": "custom_hooks",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How do you build a useSubscription hook that prevents tearing when a concurrent feature is in play?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function useSubscription(store) {\n  return useSyncExternalStore(\n    store.subscribe,\n    store.getSnapshot\n  );\n}",
    "label": "custom-hooks.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Use useState combined with a global event emitter for subscription updates"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Poll the external subscription source on every requestAnimationFrame callback"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Wrap the useEffect subscription callback inside a startTransition call block"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Use useSyncExternalStore with subscribe and getSnapshot for tear-free reads"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__2058808",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Besides pointing at DOM nodes, what else can a ref's current property hold?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "just booleans for toggling views"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "only elements React has rendered"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "solely ids returned by the server"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "any plain value you want to remember"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__40875",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does "
      },
      {
       "t": "code",
       "v": "useRef"
      },
      {
       "t": "text",
       "v": " return?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const inputRef = useRef(null);\n// After mount: inputRef.current is the DOM input element",
    "label": "refs-dom.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A proxy object that triggers re-renders when mutated"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "An immutable snapshot of the latest state value"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A mutable object whose "
       },
       {
        "t": "code",
        "v": "current"
       },
       {
        "t": "text",
        "v": " survives renders"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "An array containing the ref and a setter function"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__2058805",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Unlike useState, which hands back a value and a setter, what does useRef hand back to you?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "a getter plus a subscribe helper"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "a single object you mutate directly"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "a value and a matching update call"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "two functions for read and write"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__520",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the purpose of IntersectionObserver with refs in React?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "useEffect(() => {\n  const observer = new IntersectionObserver(([entry]) => {\n    if (entry.isIntersecting) loadMore();\n  });\n  if (sentinelRef.current) observer.observe(sentinelRef.current);\n  return () => observer.disconnect();\n}, []);",
    "label": "refs-dom.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "To measure element intersection with other elements for collision detection"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "To track mouse cursor intersection with page elements"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "To detect when an element enters or leaves the viewport on screen"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "To observe changes to an element's attributes over time"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__2058816",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "You attached a ref to an uncontrolled text input. Which expression reads whatever the user has typed?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<input ref={inputRef} />",
    "label": "refs-dom.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "inputRef.current.text"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "inputRef.current.value"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "inputRef.current.input"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "inputRef.current.data"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__2058797",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "You created a container object with useRef and want a particular div's DOM node stored into it once rendered. What attribute do you put on that div in JSX?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "a bind attribute holding your object"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "a ref attribute holding your object"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "a hook attribute holding your object"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "a node attribute holding your object"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__1158804",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does the effect log on first mount?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function App() {\n  return <p ref={node => { if (node) console.log('attach'); else console.log('detach'); }}>x</p>;\n}\nReactDOM.createRoot(el).render(<React.StrictMode><App/></React.StrictMode>);",
    "label": "refs-dom.tsx"
   },
   "widget": {
    "kind": "predict_output",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "attach attach detach"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "attach only once ok"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "detach attach detach"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "attach detach attach"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__519",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How does React.memo compose with a component that receives ref as a prop (React 19)?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const Input = memo(function Input({ ref, ...props }: Props & { ref?: Ref<HTMLInputElement> }) {\n  return <input ref={ref} {...props} />;\n});",
    "label": "refs-dom.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A component that accepts ref cannot be memoized without first re-wrapping it in forwardRef"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Passing ref as a prop disables memoization because React treats ref as an unstable identifier"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "memo wraps the component; ref is compared like any other prop and forwarded through unchanged"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "memo strips the ref prop during shallow comparison, so the inner element never receives it"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__2058795",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A component starts with const boxRef = useRef(null). What is the purpose of the null passed to useRef here?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const boxRef = useRef(null);",
    "label": "refs-dom.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It sets the initial value the ref object holds"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It hides the referenced element until it mounts"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It marks the ref as frozen for the first render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It links the ref to React's element registry"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.refs_dom__510",
   "topic": "react",
   "subSkill": "refs_dom",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How do you scroll to a specific element using refs?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const sectionRef = useRef(null);\nconst scrollToSection = () => {\n  sectionRef.current?.scrollIntoView({ behavior: 'smooth' });\n};",
    "label": "refs-dom.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Call ref.current.scrollIntoView() in a handler"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Set window.scrollTo with the element's ID as parameter"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Call the React.scrollTo(ref) built-in utility method"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Use CSS scroll-behavior property on the ref element"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__521",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What happens if a reducer function throws during state computation?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The dispatch call returns false to signal the failure back to the calling handler"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "React catches the error silently and reuses previous state value without notification"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The error propagates to the nearest error boundary; the update is abandoned"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The component auto-unmounts from the React tree and triggers full subtree cleanup"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__100253",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which statement best describes the behavior of useTransition for state updates?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Cancels any prior update that targeted the same store before scheduling this one"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Marks an update as non-urgent so React can interrupt it to keep typing responsive"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Defers the update to the next macrotask so effects see the current stale snapshot"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Debounces the update by a fixed delay so fewer renders are scheduled during bursts"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__200322",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which statement best describes useImperativeHandle?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Registers a listener to be invoked whenever the owning element is scrolled or resized"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Dispatches an imperative method call from child to parent across the React tree boundary"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Customizes the instance value that a parent receives through a forwarded ref object"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Forces an effect to run synchronously before a browser paint for layout measurements"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__41013",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the idiomatic way to read context in a function component?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const { user } = useContext(AuthContext);",
    "label": "hooks-advanced.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Import the context object and read its "
       },
       {
        "t": "code",
        "v": ".value"
       },
       {
        "t": "text",
        "v": " property directly"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Call "
       },
       {
        "t": "code",
        "v": "useContext(MyContext)"
       },
       {
        "t": "text",
        "v": " at the component top level here"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Access "
       },
       {
        "t": "code",
        "v": "this.context"
       },
       {
        "t": "text",
        "v": " inside the component function"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Wrap the component in "
       },
       {
        "t": "code",
        "v": "<MyContext.Consumer>"
       },
       {
        "t": "text",
        "v": " and use the render prop"
       }
      ],
      "shape": "code"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__9506184",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which Hook lets a deeply nested child read a shared value without prop drilling?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "the useContext Hook"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "the useReducer Hook"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "the useEffect Hook"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "the simple useRef Hook"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__6103948",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "After clicking the button, what do the two logs print in order?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function C() {\n  const [n, setN] = useState(0);\n  useEffect(() => { console.log(n); }, [n]);\n  return <button onClick={() => {\n    setN(1);\n    console.log(n);\n  }}>go</button>;\n}",
    "label": "hooks-advanced.tsx"
   },
   "widget": {
    "kind": "predict_output",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "1 then 0"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "0 then 1"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "0 then 0"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "1 then 1"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__9506174",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "In a component, where must Hook calls be placed?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Just before the closing return line"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Inside the returned JSX of the component"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "At the top level of the function body"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Within the first event handler defined"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__100437",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Compare "
      },
      {
       "t": "code",
       "v": "useMemo(() => compute(a, b), [a, b])"
      },
      {
       "t": "text",
       "v": " with "
      },
      {
       "t": "code",
       "v": "React.memo(Child)"
      },
      {
       "t": "text",
       "v": " wrapping "
      },
      {
       "t": "code",
       "v": "<Child a={a} b={b} />"
      },
      {
       "t": "text",
       "v": ". Which distinction is accurate?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "useMemo forces children to re-render; memo blocks the parent from re-rendering"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Both cache the same thing; only the call site differs between parent and child"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "useMemo caches a component render; memo caches a computed value inside the parent"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "useMemo caches a value in one component; memo skips a child re-render on equal props"
       }
      ],
      "shape": "code"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__5930218",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What will the two rendered "
      },
      {
       "t": "code",
       "v": "<p>"
      },
      {
       "t": "text",
       "v": " elements contain?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function Field() {\n  const id = useId();\n  return (\n    <>\n      <p>{id}</p>\n      <p>{id}</p>\n    </>\n  );\n}",
    "label": "hooks-advanced.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "two distinct random strings"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "empty strings until hydration"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "identical numeric timestamps"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "identical non-empty strings"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.hooks_advanced__9506198",
   "topic": "react",
   "subSkill": "hooks_advanced",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Calling your Hooks in a different order each render will:"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "skip the very first render pass"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "confuse how React tracks them"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "make the component mount faster"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "reset each value to its default"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__6073824",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Following the Rules of Hooks, where must useTransition be called?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "within a conditional that guards its use"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "in an event handler after a user clicks"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "inside a loop that runs once per item"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "at the top level of a component or Hook"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__6073831",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Before any transition has started, what is the initial value of isPending?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "unset"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "false"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "zeroed"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "empty"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__6073826",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "React's ability to render interruptibly, pausing work to handle urgent input, is broadly called what?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "concurrent rendering"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "synchronous flushing"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "parallel threading"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "server streaming"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__6073829",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A Suspense boundary shows its fallback when a component inside it does what?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "renders twice in strict mode"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "returns null instead of markup"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "throws an error during its render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "waits for data before it can render"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__100234",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the first value returned by useTransition?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A numeric counter of how many queued updates remain in the scheduler before the next browser paint tick occurs"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "An abort controller signal that child async operations can watch to cancel when the current route unmounts"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A boolean indicating whether a lower-priority update triggered from the paired starter is still being rendered"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A stable ref object pointing at the DOM node that last received focus while rendering was suspended or deferred"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__6073833",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "In React 18, createRoot replaced which older top-level rendering API?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "ReactDOM.render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "ReactDOM.create"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "ReactDOM.attach"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "ReactDOM.mount"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__500",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does useTransition provide?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const [isPending, startTransition] = useTransition();\nconst handleChange = (e) => {\n  setInput(e.target.value); // urgent\n  startTransition(() => setResults(search(e.target.value))); // deferred\n};",
    "label": "concurrent-features.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A way to mark state updates as non-urgent so the UI stays responsive"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A way to make a setter synchronous so the DOM reflects it before the next line"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A way to memoize a state value across renders so children skip reconciliation"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A way to throttle state setters so they fire at most once per frame"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__6073827",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "By default, which kind of update does React treat as urgent (high priority)?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "a route change that loads a new screen"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "a background data refresh on a timer"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "a heavy list re-render after filtering"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "a direct interaction like a click"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__6073832",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "React has a name for a state update marked as non-urgent so it can be interrupted. What is it called?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "a mutation"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "a deferral"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "a suspension"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "a transition"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.concurrent_features__525",
   "topic": "react",
   "subSkill": "concurrent_features",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is 'time slicing' in the context of React's concurrent renderer?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Scheduling CSS animations to run at precisely defined frame interval boundaries"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Breaking render work into small chunks, yielding to the browser between them"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Splitting the server response into multiple streamed HTML chunks for the client"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Dividing the component tree across multiple parallel Web Worker threads"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__4664618",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A page keeps a bio inside a Suspense boundary and its navigations are already wrapped in a Transition. Switching from one person to another should bring the placeholder back rather than leave the previous bio on screen while the next one loads. Which change expresses that?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Put a key tied to the user id on the boundary or on a component above it"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Drop the Transition wrapper so every navigation counts as an urgent update"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Move the fetch into an effect that reruns whenever the user id changes"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Nest a second boundary inside the first one around just the bio element"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__510",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "In streaming SSR, why does splitting a page into more Suspense boundaries let some sections respond to clicks sooner?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "React hydrates each Suspense boundary in one pass once the full HTML arrives"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Hydration walks the tree top-down in document order and ignores boundaries"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Each boundary is an independent hydration unit, so interactive areas win"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Fallback markup stays inert, so a section is clickable just after its parent"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__517",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the internal mechanism React uses to track which Suspense boundary should catch a thrown promise?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Each thrown promise object carries a direct reference to its Suspense boundary node"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "React uses standard try/catch blocks in the JavaScript call stack for matching"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A global promise registry maps each thrown promise to its target Suspense boundary"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "React walks up the fiber tree from the suspending component to find the nearest Suspense"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__516",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How does React's streaming SSR (renderToPipeableStream) handle Suspense boundaries?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It waits for all Suspense boundaries to resolve before sending any HTML content"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It renders all Suspense boundary content exclusively on the client side only"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It sends fallback HTML immediately and streams replacement content when resolved"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It completely skips Suspense boundaries during server-side rendering passes"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__4927911",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A page hosts two independent React apps, so this one is server-rendered with its own prefix option. Which id attribute does the emitted input carry on react 19.2?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "import { useId } from \"react\";\nimport { renderToStaticMarkup } from \"react-dom/server\";\n\nfunction Field() {\n  const id = useId();\n  return <input id={id} type=\"text\" />;\n}\n\nconst html = renderToStaticMarkup(<Field />, {\n  identifierPrefix: \"app1\",\n});",
    "label": "suspense-boundaries.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "id=\"_R_app1_0_\""
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "id=\"_R_0_app1\""
       }
      ],
      "shape": "code"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "id=\"app1_R_0_\""
       }
      ],
      "shape": "code"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "id=\"_app1R_0_\""
       }
      ],
      "shape": "code"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__528",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A list should show the nearest boundary's fallback while it loads. What kind of data layer makes that happen?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function UserProfile({ id }) {\n  const { data } = useSuspenseQuery({\n    queryKey: ['user', id],\n    queryFn: () => fetchUser(id),\n  });\n  return <h1>{data.name}</h1>;\n}",
    "label": "suspense-boundaries.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A data layer that hooks into Suspense by throwing promises while pending"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A React context provider that tracks global loading state for each route"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "An async function whose returned promise is awaited by the calling component"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A server-side data store such as a relational database or an external REST API"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__200006",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which statement best describes an error boundary's coverage of a suspending subtree?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It handles setState warnings emitted by React to the console during the commit phase of render"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It handles errors thrown during rendering or from a rejected promise resolved by the tree"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It handles only click-handler errors dispatched by DOM event listeners inside the same region"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It handles network status code mismatches reported by the browser fetch API across the page"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__8020460",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A reviews panel behind its own boundary renders the tag below next to its markup. After the review data resolves, the glimmer lingers a few hundred extra milliseconds before the panel appears, and the profiler shows no outstanding data reads at all during that gap. What is holding the reveal?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<link rel=\"stylesheet\" href=\"/reviews.css\" precedence=\"default\" />",
    "label": "suspense-boundaries.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The reveal is queued behind React's throttle window, which starts counting from the moment the panel's own promise was created."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "React keeps that boundary closed until the referenced stylesheet has loaded, up to a timeout, so the panel is never shown unstyled."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "React postpones every reveal by one animation frame per boundary, so a panel nested a few levels deep collects several frames."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A style tag inside a boundary forces a second render pass over the subtree, and the panel commits only once that pass finishes."
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__1318477",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Where do you put the components that may need to load inside a boundary?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Between the opening and closing wrapper tags"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Passed as arguments to a lazy import call"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "In a separate prop named children as a string"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Inside the value of the fallback prop instead"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.suspense_boundaries__519",
   "topic": "react",
   "subSkill": "suspense_boundaries",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A component inside a Suspense subtree throws a TypeError during render instead of suspending. Which handler sees that error?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "function DataComponent({ id }) {\n  const data = use(fetchUser(id));\n  if (!data.name) throw new TypeError('bad payload');\n  return <h1>{data.name}</h1>;\n}",
    "label": "suspense-boundaries.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "React retries the failed render a second time before surfacing anything"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The Suspense fallback replaces the subtree and renders the error message"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The error propagates to the nearest ErrorBoundary, not the Suspense boundary"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The throw escapes React entirely and unmounts the app to a blank page"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__2037014",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "The parent mounts and then re-renders because of a prop change outside the useMemo deps. What happens to the cached selector?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "import { useMemo, useState, useEffect } from 'react';\nexport default function S({ data }) {\n  const [, b] = useState(0);\n  useEffect(() => { b(1); }, []);\n  const sel = useMemo(() => data.filter(Boolean), [data]);\n  return <p>{sel.length}</p>;\n}",
    "label": "performance-memo.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Cache thrown away, React forces selector to recompute per mount"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Cache retained, the previous result reference is returned again"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Cache cleared, a new array is produced on every single render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Cache serialized to the heap and rehydrated asynchronously later"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__924071",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Parent mounts and useEffect triggers one state change. What does the console show?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "import { useMemo, useState, useEffect } from 'react';\nexport default function Once() {\n  const [, bump] = useState(0);\n  useEffect(() => { bump(1); }, []);\n  const v = useMemo(() => { console.log('factory'); return 42; }, []);\n  return <p>{v}</p>;\n}",
    "label": "performance-memo.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The factory logs on every parent render unconditionally"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The factory logs three times covering mount and updates"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The factory never logs because empty deps skip init"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The factory logs exactly once during initial mount"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__841657316",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "The "
      },
      {
       "t": "code",
       "v": "use"
      },
      {
       "t": "text",
       "v": " prefix in "
      },
      {
       "t": "code",
       "v": "useMemo"
      },
      {
       "t": "text",
       "v": " and "
      },
      {
       "t": "code",
       "v": "useCallback"
      },
      {
       "t": "text",
       "v": " tells you they are what?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Slots"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Nodes"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Props"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Hooks"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__841657318",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Without "
      },
      {
       "t": "code",
       "v": "useMemo"
      },
      {
       "t": "text",
       "v": ", a value computed in the component body is recalculated how often?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Only once ever"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Once per mount"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "After unmount"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "On every render"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__40900",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the danger of over-using "
      },
      {
       "t": "code",
       "v": "useMemo"
      },
      {
       "t": "text",
       "v": " and "
      },
      {
       "t": "code",
       "v": "useCallback"
      },
      {
       "t": "text",
       "v": "?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "They hold cached values for the app's lifetime, so long sessions leak memory steadily"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "They keep React DevTools from reporting re-render counts for those components"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "They opt a component out of concurrent rendering, including Suspense and transitions"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "They add overhead (memory, comparison cost) that can outweigh the savings for cheap operations"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__841657317",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does "
      },
      {
       "t": "code",
       "v": "memo"
      },
      {
       "t": "text",
       "v": " look at to decide whether it can skip a re-render?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The component's props"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The window's size"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The document's title"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The component's state"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__841657313",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What belongs inside "
      },
      {
       "t": "code",
       "v": "useMemo"
      },
      {
       "t": "text",
       "v": "'s dependency array?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The values the calculation reads"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The JSX the component returns"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The names of the Hooks used"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The child components to render"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__841657306",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "When does the "
      },
      {
       "t": "code",
       "v": "build(data)"
      },
      {
       "t": "text",
       "v": " function run again?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "const rows = useMemo(() => build(data), [data]);",
    "label": "performance-memo.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "After each browser paint completes fully"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "On absolutely every render of the component"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "When a value in the dependency array changes"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Only one time when the component mounts"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__841657303",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "code",
       "v": "useCallback"
      },
      {
       "t": "text",
       "v": " is used to cache which kind of thing?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "A function"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A promise"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A CSS class"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A DOM node"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.performance_memo__1597128",
   "topic": "react",
   "subSkill": "performance_memo",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Two parent rerenders occur. What does the console sequence show from the useMemo factory?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "import { useMemo, useState, useEffect } from 'react';\nexport default function K() {\n  const [n, setN] = useState(0);\n  useEffect(() => { setN(1); }, []);\n  const v = useMemo(() => { console.log('calc'); return n; }, [[]]);\n  return <span>{v}</span>;\n}",
    "label": "performance-memo.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "calc logs twice because the array literal is a new dep"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "calc logs three times because each hook call runs twice"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "calc never logs because React treats arrays as identical"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "calc logs once because empty arrays deep-equal themselves"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__523",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A Client Component imports a function from a module whose first line is "
      },
      {
       "t": "code",
       "v": "'use server'"
      },
      {
       "t": "text",
       "v": ". What has that first line done?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "async function addToCart(productId) {\n  'use server';\n  const cart = await getCart();\n  await cart.addItem(productId);\n  revalidatePath('/cart');\n}\n\n// Client Component can call this directly\n<form action={addToCart}>...</form>",
    "label": "server-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It marks that function as a Server Function the client may invoke by reference over the network"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It schedules the function to run during server rendering, before the response streams"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It marks the module as a Server Component, so its output renders on the server"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It strips the function from the client bundle and is otherwise a build-time no-op"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__514",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 4,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What security consideration is important when using Server Actions?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "'use server';\nasync function deletePost(id) {\n  const user = await getAuthUser();\n  if (!user) throw new Error('Unauthorized');\n  const post = await db.posts.find(id);\n  if (post.authorId !== user.id) throw new Error('Forbidden');\n  await db.posts.delete(id);\n}",
    "label": "server-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "No validation is needed since they run exclusively on the server runtime"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "They are public HTTP endpoints and must validate inputs and authenticate requests"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Only admin users can call Server Actions based on the default configuration"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Server Actions are inherently secure without any input validation needed"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__1023889",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Can a Server Component read directly from a database?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Yes, it can query the data store while rendering"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "No, it must call an API route to get the data"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "No, that access is limited to Client Components"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "No, only a Server Action may load the records"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__1023907",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Where does a React Server Component execute?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "On a CDN edge node that caches the finished markup"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "On the server, before the response reaches the browser"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "In the browser, right after the page finishes loading"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Inside a background web worker on the user's device"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__500812",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which best characterizes how React de-duplicates identical data fetches within a single Server render?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Via request-scoped caching on top of the cache() primitive"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Via a module-level Map keyed on serialized argument shape per route"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Via automatic memoization of all async functions called in render"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Via browser HTTP caching layered under a service-worker bridge code"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__89302",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What can Server Components NOT do?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "// Server Component - runs on server only:\nasync function UserProfile({ userId }) {\n  const user = await db.query('SELECT * FROM users WHERE id = $1', [userId]);\n  return (\n    <div>\n      <h1>{user.name}</h1>\n      {/* ❌ Can't do: onClick, useState, useEffect */}\n      <LikeButton userId={userId} /> {/* Client Component handles interaction */}\n    </div>\n  );\n}",
    "label": "server-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "They cannot use hooks, event handlers, or the browser APIs at hand"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "They cannot render HTML: they just return serialized data for Client Components"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "They cannot access databases, file systems, or server-side APIs"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "They cannot import other Server Components or Client Components"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__40891",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "A form submits straight to code that mutates the database on the server, with no API route in the project. Which mechanism is doing that?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "'use server';\nasync function createPost(formData) {\n  await db.posts.create({ title: formData.get('title') });\n}",
    "label": "server-components.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Lifecycle hooks that run on the server before the page is streamed down to the client"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Generated API route handlers that validate CSRF tokens and parse the body for you"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Server-side equivalents of "
       },
       {
        "t": "code",
        "v": "useEffect"
       },
       {
        "t": "text",
        "v": " that run after every render on the server"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Async server-side functions marked with 'use server' that can be called from Client Components"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__530",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 5,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What is the relationship between React Server Components and Server-Side Rendering (SSR)?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "One technology, two names: the same underlying thing rebranded for marketing"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "SSR is a strict prerequisite for RSC since RSC cannot function without SSR enabled"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "They complement each other: RSC picks what runs server-side, SSR when HTML is made"
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "RSC replaces SSR for good, so you pick just one or the other in a given application"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__9584847",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "The reference describes two moments at which this kind of component may be rendered. Besides during a page request on a live host, when else can that happen?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "On each client navigation, inside a cached service worker."
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Once per hydration, in the browser after the bundle loads."
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Once at build time on a CI machine, with no web server needed."
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "During the SSR pass only, right before the HTML is streamed."
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.server_components__1023886",
   "topic": "react",
   "subSkill": "server_components",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "When a Server Component renders, is its own JavaScript sent to the browser?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Yes, but only the parts that contain event handlers"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Yes, though the browser caches it after first load"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "No, its code stays on the server and is never downloaded"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Yes, its code is bundled and downloaded like a module"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__5203873",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which is the correct way to write the change-handler prop in JSX?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "onChanged"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "changeOn"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "changeTo"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "onChange"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__503",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How do you handle a checkbox in a controlled manner?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<input\n  type=\"checkbox\"\n  checked={agreed}\n  onChange={e => setAgreed(e.target.checked)}\n/>",
    "label": "forms-controlled.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Set defaultChecked to a state variable managed by useState"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Use onClick instead of onChange for checkbox toggle handling"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Bind checked prop to state and toggle it in onChange"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Use the value prop like you would for standard text input elements"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__89304",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What does "
      },
      {
       "t": "code",
       "v": "useActionState()"
      },
      {
       "t": "text",
       "v": " do in React 19?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "async function submitForm(prevState, formData) {\n  const result = await saveToDb(formData.get('name'));\n  if (result.error) return { error: result.error };\n  return { success: true };\n}\n\nfunction MyForm() {\n  const [state, formAction, isPending] = useActionState(submitForm, {});\n  return (\n    <form action={formAction}>\n      <input name=\"name\" />\n      <button disabled={isPending}>Submit</button>\n      {state.error && <p>{state.error}</p>}\n    </form>\n  );\n}",
    "label": "forms-controlled.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "It wraps a form action, giving the state, a dispatch and a pending flag"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It tracks which form fields have been touched and returns validation errors"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "It manages form serialization and automatically converts FormData to JSON"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "It replaces useReducer with an async-aware version that handles optimistic updates"
       }
      ],
      "shape": "long"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__9706788",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Calling "
      },
      {
       "t": "code",
       "v": "useOptimistic(value)"
      },
      {
       "t": "text",
       "v": " at the top level of a component hands back an array holding exactly two entries. Which pair is it?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The previous optimistic state, plus a ref holding what the server confirmed."
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The current optimistic state, plus a boolean that is true while a submit runs."
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "The current optimistic state, plus a set function that changes it during an Action."
       }
      ],
      "shape": "long"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "A pending flag, plus the optimistic state React shows once the waiting is over."
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__2039184",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Which React 19 hook reports whether the parent "
      },
      {
       "t": "code",
       "v": "<form>"
      },
      {
       "t": "text",
       "v": " is currently submitting, so a child button can disable itself?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "useFormSending"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "useFormStatus"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "useSubmitState"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "useFormPending"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__520",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "How do you handle a multi-select dropdown in React?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<select\n  multiple\n  value={selected}\n  onChange={e => {\n    const vals = Array.from(e.target.selectedOptions, o => o.value);\n    setSelected(vals);\n  }}\n>",
    "label": "forms-controlled.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Create separate select elements for each selectable option"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "Use multiple value props on the same select element"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Multi-select dropdowns are not supported in React"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Set "
       },
       {
        "t": "code",
        "v": "multiple"
       },
       {
        "t": "text",
        "v": " on select and read e.target.selectedOptions"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__5203849",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "What initial value should you pass to useState for a controlled text input that starts empty?"
      }
     ]
    }
   ],
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "An empty string, like "
       },
       {
        "t": "code",
        "v": "useState('')"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "A null literal, like "
       },
       {
        "t": "code",
        "v": "useState(null)"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A zero number, like "
       },
       {
        "t": "code",
        "v": "useState(0)"
       }
      ],
      "shape": "code"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The value undefined, like "
       },
       {
        "t": "code",
        "v": "useState()"
       }
      ],
      "shape": "code"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__5203848",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 1,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Inside an input's onChange handler, what does "
      },
      {
       "t": "code",
       "v": "e.target.value"
      },
      {
       "t": "text",
       "v": " give you?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<input onChange={e => setName(e.target.value)} />",
    "label": "forms-controlled.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "The text the user has currently typed into the input"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "The name attribute assigned to this input element"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "A boolean showing whether the input is focused now"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "The previous text the input held before this keystroke"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__4162369",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 3,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "This component is rendered without StrictMode. The button is pressed exactly once, and saveChanges resolves to 'c'. What does the console print, and in what order?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "import { useState, useOptimistic, startTransition } from 'react';\n\nfunction App() {\n  const [value, setValue] = useState('a');\n  const [optimistic, setOptimistic] = useOptimistic(value);\n  console.log(optimistic, value);\n\n  function handleClick() {\n    startTransition(async () => {\n      setOptimistic('b');\n      const next = await saveChanges(); // resolves to 'c'\n      startTransition(() => setValue(next));\n    });\n  }\n\n  return <button onClick={handleClick}>go</button>;\n}",
    "label": "forms-controlled.tsx"
   },
   "widget": {
    "kind": "predict_output",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "\"a a\", then \"b a\", then \"c c\": three lines, nothing between the last two"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "\"a a\", then \"b a\", then \"b c\", then \"c c\": four lines as each part lands"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "\"a a\", then \"b b\", then \"c c\": three lines, both halves move together"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "\"a a\", then \"b a\", then \"a a\", then \"c c\": four lines, a revert in between"
       }
      ],
      "shape": "short"
     }
    ]
   }
  },
  {
   "questionId": "react.forms_controlled__521",
   "topic": "react",
   "subSkill": "forms_controlled",
   "difficulty": 2,
   "stem": [
    {
     "type": "p",
     "runs": [
      {
       "t": "text",
       "v": "Why is wrapping inputs in a semantic form element important even for controlled inputs?"
      }
     ]
    }
   ],
   "code": {
    "lang": "tsx",
    "code": "<form onSubmit={handleSubmit}>\n  <input value={name} onChange={handleChange} />\n  <button type=\"submit\">Save</button>\n</form>",
    "label": "forms-controlled.tsx"
   },
   "widget": {
    "kind": "mcq",
    "options": [
     {
      "id": "o1",
      "label": [
       {
        "t": "text",
        "v": "Forms are needed just for traditional server-side submission"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o2",
      "label": [
       {
        "t": "text",
        "v": "It enables keyboard submission, assistive tech, and semantics"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o3",
      "label": [
       {
        "t": "text",
        "v": "Form elements provide improved JavaScript performance overall"
       }
      ],
      "shape": "short"
     },
     {
      "id": "o4",
      "label": [
       {
        "t": "text",
        "v": "Wrapping in a form lets React batch the field updates into one flush"
       }
      ],
      "shape": "short"
     }
    ]
   }
  }
 ]
}
