Forms Interview Questions
9 curated forms interview questions with detailed answers and examples.
← Browse all interview questionsLearn how :has() lets a parent be styled based on its descendants, replacing a whole category of JavaScript class toggling.
A controlled component has its value driven by React state. An uncontrolled component lets the DOM own the value, read via a ref on submit. Controlled enables real-time validation and formatting. Uncontrolled is mandatory for file inputs and is used by React Hook Form for performance.
Use a controlled radio group with useState to capture the selected value and reflect it in another element.
Use controlled inputs with useState to mirror user-typed text into another element in real time.
Controlled components let React own the input value through state. Uncontrolled components let the DOM own the value and read it via refs. Know when each is appropriate.
Track a select value in state and display it anywhere on the page. This is the controlled component pattern applied to dropdowns and is the foundation for summary panels and confirmation UIs.
React forms work through controlled inputs where state is the single source of truth. Understand the cycle, real-time validation, input formatting, and the multi-field pattern with a shared handler.
Build a reusable multi-step wizard in React with controlled state, validation per step, progress indicators, and persistence.
Build a multi-tab (wizard-like) form that persists data across tabs, auto-saves to localStorage or backend, handles validation per tab, and recovers on reload.