← Applied Intuition Interview Insights

Applied Intuition·Mobile Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Applied Intuition mobile engineer interview with a coding problem around button press classification. The problem was more nuanced than it sounds and the ambiguity in the middle range (200-500ms) was clearly a test of how you handle undefined specs.

Questions Asked (1)

Q1

Design and implement a button click detector that reads a stream of press/release samples (polled every 10ms) and classifies each press as a single click or long click based on duration thresholds. It should support multiple buttons running concurrently and handle consecutive clicks and idle periods.

System DesignAlgorithms & Data StructuresAdaptability & Ambiguity
Author's notes

The thresholds themselves were easy enough: under 200ms is a single click, over 500ms is long.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then outline a state machine per button that tracks press/release events and timestamps. Discuss how to handle concurrency, edge cases like debouncing and consecutive clicks, and propose a clean, testable implementation.

Pro tip: Emphasize the importance of debouncing and hysteresis to avoid false triggers, and suggest using a monotonic clock to prevent issues with system time changes.

1. Clarify Requirements and Constraints

Ask about polling frequency, duration thresholds for single vs. long click, debouncing needs, and whether multiple buttons can be pressed simultaneously. Confirm the expected output format (e.g., events emitted).

2. Design the State Machine

Define states (IDLE, PRESSED, LONG_PRESSED) and transitions based on samples. Use timestamps to measure press duration and decide when to emit click events.

3. Handle Concurrency and Multiple Buttons

Instantiate a separate state machine per button, ensuring thread safety if samples arrive concurrently. Consider using a central dispatcher or event queue.

4. Address Edge Cases

Implement debouncing to ignore spurious transitions, handle consecutive clicks (e.g., double-click detection if needed), and manage idle periods without resource leaks.

5. Implement and Test

Write clean, modular code with unit tests for various scenarios: short press, long press, multiple buttons, rapid clicks, and noise. Discuss trade-offs of polling vs. interrupts.

Key Points to Mention

  • Debouncing techniques to filter out mechanical noise
  • Using a monotonic clock for reliable duration measurement
  • State machine design for clarity and extensibility
  • Thread safety and concurrency considerations for multiple buttons
  • Configurable thresholds and hysteresis for long click detection
  • Testing strategy including edge cases and performance

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