Debounce a Search-Box Keystroke Stream
Asked at Mobile · Mobile Engineering (Android/iOS) · Difficulty: Medium
A search-as-you-type box must not fire a network request on every keystroke. **Debouncing** waits until the user pauses typing for `delay` ms, then fires one request. (On iOS this is Combine's `.debounce`; on Android, Flow's `.debounce`.) Given the keystroke timestamps, output when the debounced requests actually fire.
Loading the problem…
More Mobile interview questions
- Activity Lifecycle Configuration Changes and Process Death
- Design an Image Loading and Caching Library
- SwiftUI State Management Property Wrappers
- ARC Retain Cycles and weak vs unowned
- Jetpack Compose Recomposition State and Stability
- GCD vs Swift async-await Concurrency