All jobs / Embedded / hardware / Firmware Architecture
Embedded / hardware interview question · 0–1 years
You wait for a bit in a `while (1)` with no timeout. What is wrong?
The strongest answer
A silent forever if the bit never arrives — I want a timeout, a counter, and a path to a safe state
Why it works
Exactly. Hardware can miss. A kicked watchdog around a dead wait hides the bug.
What a good answer covers
- Timeout every hardware wait.
- Safe state on expiry.
- Do not kick the dog in the spin.
- Optimisation level ≠ a timeout.
Answers that fall short
- Close, but not the strongest: Nothing; hardware always arrives
Always-arrives is hope. - Weak: I add a watchdog kick inside the spin so it can spin forever
Kicking in the wait is how the dog never sees the hang. - Red flag: I compile with -O0 so the spin is “more reliable”
-O0 is not a timeout.
Who gets asked this
More Firmware Architecture questions
- When is `delay_ms(100)` acceptable, and when is it a smell?
- Describe how a super-loop firmware should be structured.
- Why split bootloader and application?
- A peer writes `while(!ready);` with no other path. Strongest critique?
- The app team wants to “just patch the bootloader in the field.” Your pushback?
- You are receiving framed packets over UART. How do you structure the parser?
- What must an OTA design have before the first customer update?
- Marketing wants “secure boot” on the box. What do you actually build?