Start by trying a native select, since you get keyboard support, focus management and screen reader behavior for free. If the design rules that out, implement the listbox or combobox pattern properly: manage focus yourself, support arrow keys, Home, End, Escape and type ahead, wire up aria-expanded, aria-activedescendant and the correct roles, and return focus to the trigger on close.
Why interviewers ask this
Accessibility separates developers who ship for everyone from developers who ship for a mouse. The interviewer is checking whether you know that ARIA is a contract you have to implement, not an attribute that adds behavior, and whether you would reach for the native element first. Mentioning how you test, with a keyboard and an actual screen reader, is what turns a theoretical answer into a credible one.
How to structure your answer
- Say you reach for the native element first and why.
- List the keyboard interactions the pattern requires.
- Explain that ARIA describes state and does not add behavior.
- Describe how you would test it.
Example answer
My first move is to push back on building one at all, because a native select gives you keyboard handling, mobile pickers and screen reader announcements with zero code, and most designs can be met with styling around it. When we genuinely needed a custom one, for a multi select with avatars, I built it against the ARIA authoring practices listbox pattern rather than improvising. That meant the trigger is a real button with aria-expanded and aria-controls, the popup has role listbox with options that have role option and aria-selected, and I track the active option with aria-activedescendant so focus stays on the input. Keyboard wise you need up and down, Home and End, Escape to close and restore focus to the trigger, Enter or Space to select, and type ahead to jump. The important thing I tell people is that ARIA only announces state; it adds no behavior at all, so a div with role button and no key handler is worse than useless. I test with the keyboard only, then with a screen reader, before it goes near a review.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you announce that the option list has updated?
- What contrast ratio do you need for the focus indicator?
- When is aria-label the wrong choice compared to a visible label?
Related full stack developer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions