HeapCrash / Design rounds / Portable sensor driver layer

Portable sensor driver layer

Your company ships 12 products on three MCU families (STM32, NXP, Nordic), some bare-metal and some on FreeRTOS or Zephyr. Each team rewrote drivers for the same 15 sensors (I2C and SPI). Design a reusable driver layer so a sensor driver is written once.

What the interviewer wants

Constraints

If you ask the interviewer

How it's graded

The rubric a senior interviewer would use. Each item is scored 0 to 3 and weighted.

Layering and interfacesweight 3
Blocking and async modelweight 3
Shared buses and concurrencyweight 2
Driver API qualityweight 2
Testing without hardwareweight 2

How to structure your answer

  1. Requirements and assumptions: the numbers that drive the design.
  2. Architecture: blocks, tasks, data flow, memory.
  3. Key decisions and trade-offs, with the alternatives you rejected.
  4. Failure modes and recovery.
  5. Testing and validation.

More design rounds

Write your design in five sections and get it graded against this rubric, with a follow-up question from the AI interviewer.

Answer this round