Implement a multi-step form in React
StripeSoftware Engineer · OnsiteLast updated
This question evaluates a candidate's competence in React front-end development, including component state management, multi-step form validation, UI state control during asynchronous submissions, and error handling.
Build a multi-step form component for the web. Steps: (
- collect basic user information; (
- collect address information; (
- review and confirm submission. Requirements: implement basic field validation; allow step navigation and switching; control disabled states appropriately; show a loading state on submit; and display error messaging on failed submissions. Use React. Be ready to discuss: why choose a reducer-based state management approach versus multiple useState hooks; how you would organize the component structure as the number of steps grows large; how to design error messages to balance good UX with clear logic; and what performance optimizations you would apply (e.g., memoization, lazy rendering).
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.