← Applied intuition Interview Insights

Applied intuition·Mobile Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

This was a follow-up coding round at Applied Intuition for a Mobile Engineer role, building on a previous button click detector problem. The twist this time was dropping the fixed sampling interval and working with real timestamps instead.

Questions Asked (1)

Q1

You've built a button click detector that assumed state updates arrive every 10ms. Now the updates arrive at arbitrary times. Rework your solution to use real timestamps from each sample (or a now() call at arrival time) while keeping the same single click and long click thresholds.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The first part felt manageable because fixed intervals let you just count samples.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that you will replace the fixed 10ms interval assumption with real timestamps captured at each sample arrival. Then describe how to compute elapsed time between samples and compare against the same single-click and long-click thresholds, handling edge cases like irregular gaps and timestamp jitter.

Pro tip: Mention that you would use monotonic timestamps (e.g., System.nanoTime() on Android) rather than wall-clock time to avoid issues with clock adjustments, and consider debouncing or filtering to handle noisy input.

1. Capture real timestamps

At each sample arrival, record the current time using a monotonic clock (e.g., now() or system uptime). Ensure the timestamp is taken as close to the event as possible.

2. Compute elapsed time

For each new sample, calculate the time difference from the previous sample (or from the initial press) using the captured timestamps.

3. Apply thresholds

Compare the accumulated elapsed time against the single-click and long-click thresholds. Determine if the click qualifies as a single click or long click based on the total duration.

4. Handle irregular intervals

Account for arbitrary gaps by not assuming a fixed interval. Use the actual elapsed time to decide if the click is still within the threshold or if it should be considered a long click.

5. Test and validate

Test with varying sample rates and irregular timings to ensure the logic correctly identifies single and long clicks. Consider edge cases like very short or very long gaps.

Key Points to Mention

  • Use monotonic timestamps (e.g., System.nanoTime()) to avoid wall-clock changes.
  • Compute elapsed time between samples rather than assuming fixed intervals.
  • Keep the same threshold values for single click and long click.
  • Handle cases where samples arrive with irregular gaps or jitter.
  • Consider debouncing or filtering to avoid false triggers from noisy input.
  • Ensure the solution is efficient and doesn't accumulate errors over time.

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