All jobs / Embedded / hardware / Debugging
Embedded / hardware interview question · 0–1 years
A bug vanishes when you add printf. What did you learn?
The strongest answer
You changed timing — I treat the print as a probe that hides races, not as a fix
Why it works
Exactly. Heisenbugs. Prints in ISRs are a second bug.
What a good answer covers
- Printf changes timing.
- It is a probe, not a fix.
- No forever ISR prints.
- Do not ship a Heisenbug.
Answers that fall short
- Close, but not the strongest: The bug was shy; ship with prints
Shipping a probe is not a root cause. - Weak: I leave prints in the ISR forever
ISR prints wreck latency. - Red flag: I add more prints until the product is a console
A console is not an architecture.
Who gets asked this
More Debugging questions
- When do you reach for a logic analyser, and when for an oscilloscope?
- HardFault on Cortex-M. What do you capture before you “add a print”?
- What should a field build do on a failed assert?
- Datasheet says 400 kHz I2C; the line looks filthy at 100. What wins?
- A struct field changes value minutes into a run, and nothing in the code writes to it. How do you find the…
- What do you log in the field when flash is tiny?
- A fleet starts resetting in the wild. First staff hour?
- What is SWD, and how does it differ from JTAG?