PracHub
QuestionsLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Waymo

Build a Debounced Autocomplete Search Bar

Last updated: Jul 25, 2026

Quick Overview

Build a debounced autocomplete search bar that remains correct under rapid typing, deletion, focus changes, selection, and out-of-order network responses. Define explicit UI states, cancellation guards, combobox accessibility, keyboard behavior, caching, IME handling, and deterministic tests.

  • medium
  • Waymo
  • Software Engineering Fundamentals
  • Frontend Engineer

Build a Debounced Autocomplete Search Bar

Company: Waymo

Role: Frontend Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

# Build a Debounced Autocomplete Search Bar Design and implement an autocomplete search bar that waits briefly after typing before requesting suggestions. It must remain correct when users type quickly, delete text, move focus, select a result, or receive responses out of order. ### Constraints & Assumptions - Suggestions come from a remote endpoint and are keyed by the complete query string. - Empty or whitespace-only input closes the result list and makes no request. - The debounce interval is configurable; 250 milliseconds is a reasonable starting point, not a correctness requirement. - Suggestions have stable IDs and accessible display labels. - Network requests may fail, finish out of order, or complete after the component unmounts. ### Clarifying Questions to Ask - What minimum query length and result limit should apply? - Should identical recent queries use a cache, and how stale may it be? - Does selection navigate immediately or only fill the input? - Which keyboard, screen-reader, mobile, and international-input behaviors are required? - Should a blur close the list before or after a pointer selection is processed? ### Hints - Debouncing request creation does not by itself prevent stale responses. - Keep highlighted option identity separate from its current array index. - Define loading, empty, error, and closed states explicitly. ### What a Strong Answer Covers - Controlled input state and timer cleanup with no lost keystrokes. - Cancellation or request-generation guards so an older response cannot replace newer results. - A small state machine for closed, waiting, loading, success, empty, and error states. - Keyboard navigation, focus and blur ordering, combobox semantics, live announcements, and stable option IDs. - Cache policy, duplicate-query handling, composition events, testing with fake timers, and observability. ### Follow-up Questions 1. Why is canceling the debounce timer insufficient to prevent every stale result? 2. How would you preserve the highlighted option when cached results are refreshed? 3. How should the component behave during an input method editor composition session? 4. When would server-side rate limiting still be necessary even with client debouncing?

Quick Answer: Build a debounced autocomplete search bar that remains correct under rapid typing, deletion, focus changes, selection, and out-of-order network responses. Define explicit UI states, cancellation guards, combobox accessibility, keyboard behavior, caching, IME handling, and deterministic tests.

Related Interview Questions

  • Design and Implement a Cross-System Object Tracker - Waymo (medium)
  • Build an Interactive Filtered Tree View - Waymo (medium)
  • Run Promise Tasks with Bounded Concurrency - Waymo (medium)
  • Debug an Angular UI from User Reports - Waymo (medium)
|Home/Software Engineering Fundamentals/Waymo

Build a Debounced Autocomplete Search Bar

Waymo logo
Waymo
May 11, 2026, 12:00 AM
mediumFrontend EngineerOnsiteSoftware Engineering Fundamentals
1
0

Build a Debounced Autocomplete Search Bar

Design and implement an autocomplete search bar that waits briefly after typing before requesting suggestions. It must remain correct when users type quickly, delete text, move focus, select a result, or receive responses out of order.

Constraints & Assumptions

  • Suggestions come from a remote endpoint and are keyed by the complete query string.
  • Empty or whitespace-only input closes the result list and makes no request.
  • The debounce interval is configurable; 250 milliseconds is a reasonable starting point, not a correctness requirement.
  • Suggestions have stable IDs and accessible display labels.
  • Network requests may fail, finish out of order, or complete after the component unmounts.

Clarifying Questions to Ask Guidance

  • What minimum query length and result limit should apply?
  • Should identical recent queries use a cache, and how stale may it be?
  • Does selection navigate immediately or only fill the input?
  • Which keyboard, screen-reader, mobile, and international-input behaviors are required?
  • Should a blur close the list before or after a pointer selection is processed?

Hints

  • Debouncing request creation does not by itself prevent stale responses.
  • Keep highlighted option identity separate from its current array index.
  • Define loading, empty, error, and closed states explicitly.

What a Strong Answer Covers Guidance

  • Controlled input state and timer cleanup with no lost keystrokes.
  • Cancellation or request-generation guards so an older response cannot replace newer results.
  • A small state machine for closed, waiting, loading, success, empty, and error states.
  • Keyboard navigation, focus and blur ordering, combobox semantics, live announcements, and stable option IDs.
  • Cache policy, duplicate-query handling, composition events, testing with fake timers, and observability.

Follow-up Questions Guidance

  1. Why is canceling the debounce timer insufficient to prevent every stale result?
  2. How would you preserve the highlighted option when cached results are refreshed?
  3. How should the component behave during an input method editor composition session?
  4. When would server-side rate limiting still be necessary even with client debouncing?
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Waymo•More Frontend Engineer•Waymo Frontend Engineer•Waymo Software Engineering Fundamentals•Frontend Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.