Design a BLE Command Handler

Read the full interview experience this question came from →

Quick Overview

This question evaluates a candidate's understanding of BLE communication, concurrency control, command queuing and sequencing, timeout and failure policies, lifecycle and cancellation handling, and testability for production-grade mobile applications.

Design a BLE Command Handler

Company: Whoop

Role: iOS Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design a Bluetooth Low Energy (BLE) command handler for an iOS application. The app needs to send commands to a wearable device over BLE. Commands must be processed strictly one at a time: - A command may not be sent until all earlier commands have completed. - After sending a command, the handler must wait for either: - the expected response from the device, or - a timeout. - If a command times out, the handler should unblock the queue and continue handling subsequent commands according to a clearly defined failure policy. - Multiple parts of the app may enqueue commands concurrently. - The design should be suitable for production use in a mobile app, including lifecycle, cancellation, error handling, and testability considerations. Explain the architecture, key data structures, concurrency model, timeout handling, response matching, and how you would validate the design.

Overview: This question evaluates a candidate's understanding of BLE communication, concurrency control, command queuing and sequencing, timeout and failure policies, lifecycle and cancellation handling, and testability for production-grade mobile applications.

Read the full Whoop iOS Engineer interview experience this question came from

Whoop logo
Whoop
Apr 17, 2026
hardiOS EngineerTechnical ScreenSystem Design
11
0

Design a Bluetooth Low Energy (BLE) command handler for an iOS application.

The app needs to send commands to a wearable device over BLE. Commands must be processed strictly one at a time:

  • A command may not be sent until all earlier commands have completed.
  • After sending a command, the handler must wait for either:
    • the expected response from the device, or
    • a timeout.
  • If a command times out, the handler should unblock the queue and continue handling subsequent commands according to a clearly defined failure policy.
  • Multiple parts of the app may enqueue commands concurrently.
  • The design should be suitable for production use in a mobile app, including lifecycle, cancellation, error handling, and testability considerations.

Explain the architecture, key data structures, concurrency model, timeout handling, response matching, and how you would validate the design.