← Applied intuition Interview Insights

Applied intuition·Mobile Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Applied Intuition mobile engineer interview with a coding problem around button press classification. Pretty embedded/systems-flavored for a mobile role, which I wasn't expecting.

Questions Asked (1)

Q1

Design a button click detector that reads a stream of samples (1=pressed, 0=released, sampled every 10ms) and classifies each press as a single click (under 200ms) or long click (over 500ms), handling multiple buttons concurrently and consecutive presses.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

The ambiguous zone between 200ms and 500ms is what got me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases, then propose a state machine per button that tracks press duration and classifies clicks based on thresholds. Discuss concurrency handling, debouncing, and how to manage consecutive presses without blocking the stream.

Pro tip: Emphasize the importance of non-blocking, event-driven design and mention that thresholds should be configurable to accommodate different hardware and user preferences.

1. Clarify Requirements and Edge Cases

Ask about sampling rate, button count, expected click durations, and how to handle simultaneous presses or rapid consecutive clicks. Confirm whether classification should be real-time or after release.

2. Design State Machine per Button

Define states (IDLE, PRESSED, LONG_PRESS) and transitions based on sample values and elapsed time. Use timestamps to measure duration and classify on release or when threshold is exceeded.

3. Handle Concurrency and Multiple Buttons

Maintain separate state for each button, process samples in a single loop or via event-driven callbacks. Ensure thread safety if using multiple threads, or use a single-threaded event loop for simplicity.

4. Address Consecutive Presses and Debouncing

Implement debouncing to ignore spurious transitions and reset state after each click. For consecutive presses, ensure the state machine can handle a new press immediately after release without losing events.

5. Discuss Trade-offs and Optimizations

Compare polling vs. interrupt-driven approaches, memory vs. accuracy, and configurability of thresholds. Mention potential issues like missed samples or timing jitter and how to mitigate them.

Key Points to Mention

  • State machine design with states like IDLE, PRESSED, and LONG_PRESS
  • Time-based classification using sample timestamps and thresholds (200ms, 500ms)
  • Concurrency handling: per-button state, thread safety, or event loop
  • Debouncing to filter noise and ensure reliable detection
  • Handling consecutive presses without blocking or missing events
  • Configurable thresholds and sampling rate for flexibility

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.