Implement debounced async autocomplete input
CoinbaseSoftware Engineer · Technical ScreenLast updated
Implement debounced async autocomplete input evaluates requirements, assumptions, structured reasoning, trade-offs, and verification in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Implement an autocomplete input component from scratch. Requirements:
- Debounce user keystrokes to avoid excessive network calls.
- Perform asynchronous fetches for suggestions; handle loading, errors, and empty results; prevent stale responses from overwriting newer ones.
- Render a suggestions list under the input with proper focus management.
- Support keyboard navigation: Up/Down arrows move the active index, the active option is visually highlighted, and Enter selects/submits the active option.
- Describe your event-handler and state design (what states you keep, how they transition, and how you wire input, list, and keyboard events).
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.