At least 10 questions — mix of concept, syntax, practical, and logic. Score ≥80% (enforced by the API) to save progress.
15 questions · concept 5 · syntax 3 · practical 4 · logic 3
1. What does a React challenge usually test? Concept
Designing normalized SQL schemas for the UI Configuring the frontend CI pipeline Writing end-to-end tests before any component Applying state, lists, and events correctly under constraints
2. If state updates don’t show? Syntax
Check you’re replacing state immutably and using setters Add a key to force the component to remount Wrap the setter in useMemo so it batches Move the value into a ref so it updates faster
3. List challenge with edits? Practical
Stable keys and lifted state for the list owner Array index keys with per-row local state A separate context for each row’s state Keep list state in each child with no lifting
4. Derived UI in challenges? Logic
Sync derived values into state inside an Effect Memoize derived values in a ref updated on change Compute during render instead of Effect mirrors Recompute derived values in an event handler only
5. Forms in challenges? Concept
Uncontrolled inputs read via refs on submit Controlled inputs with validation UX defaultValue with validation only on blur via the DOM Native form submission with a full page reload
6. Component boundaries? Practical
Lift every piece of state to the root component Split components by file size rather than responsibility Extract presentational pieces; keep state where it belongs Duplicate shared state into each child component
7. Passing callbacks? Syntax
Children mutate the parent’s state object by reference Children call parent setters via props Children dispatch to a shared store instead of props Parents read child state through a ref each render
8. When stuck on a challenge? Logic
Reproduce the bug with console/React tools; simplify Add more state to work around the symptom Rewrite the whole component from scratch immediately Wrap the code in try/catch to hide the error
9. Purity reminder? Concept
Fetching during render is fine if wrapped in useMemo Don’t fetch/setState unconditionally during render Mutating props is fine as long as you clone them first Reading context during render breaks purity
10. Success criteria mindset? Practical
Match the reference screenshot pixel-for-pixel Pass the linter and formatter with no warnings Cover every line with unit tests first Meet the stated UX/behavior checks, not just ‘it looks fine’
11. Starting at 0, what is count after one click? Concept advanced
function onClick() {
setCount(count + 1);
setCount(count + 1);
}2 0 3 1 — both reads see the same snapshot; use the updater form
12. Why might the list not re-render? Syntax intermediate
function add(item) {
items.push(item);
setItems(items);
}push returns the new length, not the array, so state is wrong setItems needs a second render to flush the push Mutating the same array keeps the same reference; use [...items, item] You must call setItems twice for arrays to update
13. Why does this delete immediately on render? Practical intermediate
<button onClick={deleteItem(id)}>Delete</button>React binds the handler on mount, so it runs then deleteItem(id) is called during render; wrap it in () => deleteItem(id) Wrapping it in useCallback would defer the call The id argument must be passed via a data attribute
14. What is the cleaner fix in this challenge? Logic advanced
const [items, setItems] = useState([]);
const [count, setCount] = useState(0);
useEffect(() => setCount(items.length), [items]);Add count to the dependency array so it stays in sync Wrap setCount in useCallback to avoid the loop Store count in a ref and update it in the Effect Derive const count = items.length during render and drop the Effect
15. Why is key={i} risky here? Concept intermediate
{rows.map((r, i) => <Row key={i} row={r} />)}
// rows can be sorted; Row has local stateLocal Row state sticks to the index, not the item, after sorting Index keys force a full remount of every row on sort Index keys stop the rows from re-rendering after sort Using the index drops the list’s scroll position on sort
Submit quiz Checking your session…