Skip to content
RED SAGSkills
mediumEmbedded Systems Engineer interview question

A device freezes randomly once every few days in the field. How do you debug it?

What the interviewer wants to hear

  • Gather data: logs, reset reason, conditions, units affected
  • Add fault handlers and save crash info in non-volatile or no-init memory
  • Watchdog to recover while you investigate
  • Check for stack overflow, memory corruption, deadlocks and race conditions
  • Reproduce with stress testing, environment changes and hardware tools

Model answer

First I collect data: which units, firmware versions and conditions, like temperature, power events or network loss. If possible I read the reset reason register and any logs. Next I make the device tell me more when it fails: a HardFault handler that saves the stacked PC, LR and fault registers to no-init RAM or flash, a task-level watchdog that records which task stopped checking in, and a small ring buffer of recent events. The watchdog also gets the device back online while I investigate. Then I look at the usual suspects: stack overflow, so I check high-water marks; heap fragmentation; deadlock between two mutexes; race conditions on shared data; counter overflows after 49 days with a 32-bit millisecond tick; and peripherals like I2C buses getting stuck. To reproduce, I run stress tests, speed up timers, and vary power and temperature, using a debugger, logic analyser or oscilloscope to catch it.

Can you answer it under time pressure?

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

Start mock interview

More medium Embedded Systems Engineer questions