Design a secure, fail-safe over-the-air firmware update system for a fleet of IoT devices.
What the interviewer wants to hear
- A/B slots or bootloader with a separate download slot
- Signature verification with keys anchored in immutable storage
- Anti-rollback version checks
- Trial boot with health check and automatic rollback
- Resumable, power-loss-safe download
- Staged rollout and fleet monitoring
Model answer
I use a small, immutable bootloader such as MCUboot with two image slots. The running image downloads the new one into the inactive slot in resumable chunks, so power loss or a dropped connection only means continuing later. Images are signed, and the bootloader verifies the signature with a public key stored in protected flash or OTP, plus a security version counter to block rollback to vulnerable releases. After switching, the new image boots in trial mode and must pass a health check, such as connecting to the server and running self-tests, before confirming itself. If it crashes or the watchdog fires before confirmation, the bootloader reverts to the previous slot. On the server side I roll out in stages, starting with a small percentage of the fleet, monitor crash and reconnect rates, and pause automatically if metrics get worse. Delta updates can reduce bandwidth.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Embedded Systems Engineer questions
- Design the firmware for a battery-powered sensor that must run for 5 years on a coin cell and report data every 15 minutes.
- How would you secure an IoT device's firmware against tampering and cloning?
- How do you make sure a real-time system always meets its deadlines?
- How do you build a strong automated testing strategy for embedded firmware?
- How do you choose a microcontroller for a new product?
- You receive the first prototype of a new custom board. How do you bring it up?
- What changes when you write firmware for a safety-critical product, such as automotive or medical?
- How do you safely share data between interrupt handlers and tasks while keeping interrupt latency low?
- 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?