Skip to content

Lesson quiz bank

Select one answer for each question. Use the starter code bank to experiment before answering.

Lesson 1 — App anatomy and JSX

#

A React component is best described as:

#

Why must the render function stay pure?

#

Where should createRoot mount the application?

Lesson 2 — Rendering, lists, and conditional UI

#

Why can index keys corrupt state?

#

When does React preserve component state?

#

What is the risk of items.length && <List />?

Lesson 3 — Props, composition, and component contracts

#

When is prop drilling clearer than Context?

#

What makes a component API stable?

#

Why does a new callback identity on every render matter?

Lesson 4 — Hooks, reducer state, and derived data

#

Why can an event handler observe stale state?

#

When is a reducer preferable to several useState calls?

#

Why should derived data usually not live in an effect?

Lesson 5 — Context and dependency boundaries

#

What causes a Context consumer to re-render?

#

When is Context the wrong abstraction?

#

How would you inject a fake repository in a test?

Lesson 6 — React Router and lazy routes

#

Hash router versus browser router: what is the main operational tradeoff?

#

Where should loading and error boundaries live?

#

What state belongs in the URL?

Lesson 7 — Typed controlled forms and validation

#

When should you prefer a controlled form?

#

When should authoritative validation run?

#

How do you prevent duplicate async submissions?

Lesson 8 — Fetching and async state

#

Why does fetch not reject on a 404 or 500?

#

How can an old, slow request overwrite newer data?

#

Which concern belongs to server-state caching?

Lesson 9 — Effects, cancellation, and event reasoning

#

When should you use an effect instead of an event handler?

#

What does the useEffect dependency list represent?

#

Why is ignoring the exhaustive-deps rule risky?

Lesson 10 — Vitest and React Testing Library

#

What should you avoid mocking in a React test?

#

getBy, findBy, or queryBy — which do you use for async content?

#

How do you test accessibility without claiming full compliance?

Lesson 11 — Rendering performance and profiling

#

Why can memo make performance worse?

#

What is the difference between useMemo and useCallback?

#

What does startTransition do?

Lesson 12 — Architecture and production boundaries

#

Where are the most important trust boundaries?

#

When does SSR most clearly improve a product?

#

How do you evolve an app across teams?

Lesson 13 — Capstone change request

#

How should you treat a shared URL payload?

#

How do you handle future requirements like auth or collaboration?

#

What makes a design record useful?