React interview questions
Practice 9 questions on react. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
9 questions
- JavaScriptCoding exercise
Accordion Compound Components
MEDIUMImplement an accessible single-open accordion from context-powered compound components with linked triggers and panels.
25 minPremium questionPractice - JavaScriptCoding exercise
ControllableInput
MEDIUMImplement one input component that correctly supports both controlled and uncontrolled state without leaking its reserved props.
25 minPractice - JavaScriptCoding exercise
createSuspenseResource
MEDIUMBuild a keyed promise cache and render wrapper that integrates asynchronous data with React Suspense.
25 minPremium questionPractice - JavaScriptCoding exercise
createZustandStore
MEDIUMBuild a tiny Zustand-style store whose initializer defines state and actions, with an attached vanilla API and React selector hook.
25 minPremium questionPractice - JavaScriptCoding exercise
ErrorBoundary
MEDIUMImplement a reusable React error boundary with fallback rendering, error reporting, manual reset, and reset-key recovery.
25 minPremium questionPractice - JavaScriptCoding exercise
Portal
MEDIUMImplement a React Portal that owns a body host or borrows a caller-provided container with safe cleanup.
25 minPractice - JavaScriptCoding exercise
ThemeProvider
MEDIUMImplement a context-backed React theme provider with stable controls, functional updates, nesting, and a strict consumer hook.
25 minPractice - JavaScriptCoding exercise
ToggleRenderProps
MEDIUMImplement a render-props toggle component that exposes reusable state and stable controls while leaving all markup to its child function.
25 minPractice - JavaScriptCoding exercise
withLoading
MEDIUMImplement a higher-order component that selects loading UI, forwards ordinary props and refs, and exposes a useful display name.
25 minPremium questionPractice