Skip to content
RED SAGSkills
hardEmbedded Systems Engineer interview question

A variable is randomly overwritten in devices running in the field, but you cannot reproduce it on your desk. How do you find the cause?

What the interviewer wants to hear

  • Collect evidence: fault registers, crash dumps, logs in no-init RAM
  • Check stack overflow and buffer overruns near the variable using the map file
  • Use the MPU or data watchpoints to trap the bad write
  • Look for DMA, ISR races and dangling pointers
  • Reproduce field conditions: stress, temperature, power, timing

Model answer

I start by getting evidence from the field: a fault handler that saves registers, stack trace and fault status to no-init RAM or flash, plus logs that are uploaded after reboot. Then I look at the map file to see what is next to the corrupted variable, because overwrites usually come from a neighbour: an array overrun, a task stack that grew into it, or a DMA buffer with the wrong length. I add canaries around suspect buffers and enable stack overflow checks. To catch the write in the act, I use the Cortex-M data watchpoint unit, which can trigger on writes to that address even without a debugger, or configure the MPU to make the region read-only except in known code. I review ISR races, dangling pointers and DMA to freed buffers, and reproduce field conditions with stress tests, high traffic, temperature and power dips.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Embedded Systems Engineer questions