This question evaluates front-end React skills including controlled components, state synchronization, interdependent input validation, keyboard accessibility/ARIA, and unit testing for UI behavior, and it sits in the Front-end/UI development domain (Other/Miscellaneous) with an emphasis on practical implementation rather than purely conceptual reasoning. It is commonly asked because interviewers use it to verify an engineer's ability to enforce input constraints, integrate dropdowns with existing form state and submission flows, maintain accessibility with native controls, and provide test coverage for validation and disabled-option behavior.
You are working on a hotel reservation form in a React codebase. The form needs two new, controlled dropdowns for selecting months: one for Check-in and one for Check-out. The selections must respect constraints based on the current month and each other. Assume the form already has state management and an onSubmit handler; you will integrate with it via controlled props/callbacks or context.
Notes/Assumptions:
Login required