Embedded Systems Fundamentals · Interview question

What is a watchdog timer and what problem does it solve?

A strong answer

A watchdog timer is a hardware countdown timer that automatically resets the MCU if the firmware fails to periodically reload ("kick") it before it expires. It solves the problem that embedded devices run unattended and firmware can hang, an infinite loop, a deadlock, a corrupted state machine, a peripheral call that never returns, with no human present to press reset. Healthy code kicks the watchdog regularly, keeping the counter from reaching zero; if the code hangs and stops kicking, the counter expires and the hardware forces a reset, rebooting the device into a known-good state. So it's a liveness mechanism and a last line of recovery: it doesn't fix the bug, but it ensures a wedged device recovers automatically instead of staying dead until someone power-cycles it. It's essentially mandatory in any unattended or safety-relevant product.

What a weak answer sounds like

You know the answer. Do you know what gets you dinged?

Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.

From the lesson

The Watchdog Timer

The hardware that resets a hung MCU: a countdown timer firmware must periodically kick, why you kick only from healthy code, and the window-watchdog twist.

More The Watchdog Timer questions

Browse all 472 interview questions
What is a watchdog timer and what problem does it solve? | EmbeddedPrep.io