Skip to content
Tech Interview Prep
Technical interview guide

Firmware & Bootloaders

What runs before application code, how a device updates itself in the field, and the linker script details that decide where everything ends up in memory.

Read
60 min
Practice MCQs
25
Interview Q&A
25
Edition
v3
Editorial status
Reviewed

Scope: Current MCUboot design/imgtool/recovery guidance; RFC 9019 and RFC 9124; NIST SP 800-193; CMSIS-Core 6 reviewed 2026-09-04.

Curated: · Written: · Reviewed:

25 questions

MCQ-21A firmware update routine writes 512-byte records into a 4 KiB erase block of NOR flash. The flash has a 256-byte program page and is rated for 10,000 erase cycles per block. Each record is updated in place every 10 seconds, and the code erases the entire 4 KiB block before every record update. The block begins returning write errors after roughly one day. What is the most likely cause?
MCQ-9A device stores a 64-byte record in a 4 KB flash page and updates it 10 times per hour. The flash is rated for 10,000 erase cycles per page, and the product must run for five years. Which update scheme keeps the page within its erase rating?
MCQ-2A fleet of IP cameras updates firmware over HTTPS. Each image carries a header with a CRC32 over the payload, and the bootloader accepts an image only when the recomputed CRC32 matches the header value. An attacker who compromised the update server modified the payload of a released image, recomputed the CRC32, and rewrote the header. Devices installed the modified image and booted normally. Which change stops this attack?
MCQ-1A vendor ships 40,000 devices. Each boot ROM hashes the first-stage bootloader with SHA-256 and compares the digest against a value burned into one-time-programmable fuses at manufacture. A firmware update re-signs the bootloader with the vendor's current release key; the signature verifies on the build workstation. The 1,200-device canary ring installs the update and every device in it fails to boot; the other 38,800 devices still run the previous firmware. What is the most likely cause?
MCQ-5A fleet of industrial gateways runs a bootloader that verifies each firmware image's RSA-3072 signature against a key fused into the SoC; that key has not leaked. A pen-test team flashes the vendor-signed 1.8.0 image onto a gateway currently running 2.3.1, and it boots. The team has physical access: they can rewrite any flash partition and can pull the coin cell that backs the RTC. Which change makes the bootloader refuse 1.8.0 on that gateway?
MCQ-6A fleet of 40,000 devices runs a bootloader that verifies each firmware image against the single signing key burned into an OTP slot, and only after that check passes does it read the image's key manifest and burn a replacement key into the slot. The current signing key K1 is compromised. The team signs firmware v2 with the new key K2 and ships a manifest that installs K2. What happens when v2 is pushed to the fleet?
MCQ-17A device keeps a monotonic anti-rollback counter in OTP, currently 12, and boots v12 from slot A, which verifies clean. An update to v13 was written to slot B but failed its hash check, so the bootloader fell back to slot A. A technician now holds the recovery button at boot and inserts a USB stick carrying v11, correctly signed with the vendor key; the ROM code verifies the recovery image before running it. What does the device do with the v11 image?
MCQ-25A fleet of devices runs a bootloader with two firmware slots and a monotonic anti-rollback counter burned into OTP. Slot A holds signed v4 and the counter reads 4. An OTA writes v5 to slot B; power fails at 60% of the write. On the next reset the bootloader finds slot B's signature invalid, slot A's signature valid, and the counter still at 4. The current code, on any verification failure, jumps to a USB recovery image that accepts any image signed with the development key. Telemetry shows 0.3% of devices in this state end up running a development-signed image. Which boot decision satisfies the production invariant?
MCQ-19A fleet of 40,000 field devices boots firmware images that are encrypted with AES-128-CBC and signed with Ed25519; the bootloader verifies the signature against a public key in ROM, then decrypts and boots. An attacker cannot forge a signature, but pulls a genuine v1.2 image, which carries a remote-code-execution bug fixed in v1.4: from a decommissioned device's flash and serves it to the fleet through a hijacked update server. Devices verify the signature, decrypt, boot v1.2, and become exploitable. Which change to the update pipeline would have stopped this?
MCQ-3A 32-bit bootloader parses a firmware manifest at base 0x08000000. The manifest declares total_size = 0x1000, and the signature over it is verified only after the entry table is parsed. Each entry is validated with `if (entry.offset + entry.length > manifest.total_size) reject;`, where offset and length are uint32_t. Entry 0 has offset = 0xFFFFF000 and length = 0x2000. What does the bootloader do with entry 0?
MCQ-14A Cortex-M4 bootloader occupies 0x08000000–0x08001FFF and runs on a 4 KB stack whose top is 0x20001000. It hands off with `((void (*)(void))0x08002000)();`: a plain branch to the application's reset handler. The application is linked at 0x08002000 with its stack top at 0x20020000, the top of 128 KB SRAM. After handoff the application runs, but a deep call chain corrupts the bootloader's .bss, and a debugger shows SP = 0x20000F80 inside the application's main(). What must the bootloader do before the branch?
MCQ-15A Cortex-M4 bootloader in ROM configures the PLL to 80 MHz, enables the IWDG with a 200 ms timeout, and jumps to an application. The application's SystemInit() has `if (RCC->CR & RCC_CR_PLLRDY) return;` so it skips PLL setup and leaves SystemCoreClock at 16 MHz. Its UART init computes BRR from SystemCoreClock, and its control loop uses SystemCoreClock for a 1 ms deadline that requires 80 MHz. On hardware, the UART transmits at 5x the expected baud and the board resets every 200 ms. The bootloader cannot be changed. Which change in the application makes the handoff contractual and fixes both symptoms?
MCQ-16An updater on an MCU erases one 128 KB flash sector as a single blocking call. The datasheet lists sector erase as 1 s typical and 4 s maximum. The independent watchdog (IWDG) has a 2 s timeout and is fed once per main-loop iteration; the erase blocks the loop for its entire duration. Which handling is correct?
MCQ-4A fleet runs one firmware image signed with the single production key. On 3,000 rev A units it boots in 900 ms. On 2,000 rev B units the same image passes signature verification, the boot ROM logs VERIFY_OK, then hangs and the watchdog resets at 1.2 s, before any console output. The image header carries the DDR training parameters and PMIC rail order for rev A; rev B uses a different DDR part and a different rail order. What does this failure show?
MCQ-12A fleet of 40,000 gateways runs firmware 2.7 in slot A. The bootloader is mask ROM, and the flash partition table it holds defines exactly one 4 KB config sector; application code has no other writable non-volatile region. That sector holds a 64-byte v1 record at offset 0: magic 0x43464731, 60 bytes of settings, then a CRC32 over those 64 bytes. The 2.7 loader checks the magic first, then the CRC; if either fails it loads factory defaults. Firmware 3.1, written to slot B, needs one extra byte, so on first boot it rewrites the record as a 68-byte v2 record: magic 0x43464732, 64 bytes of settings, CRC32 over 68 bytes. A week later the team flips the boot slot back to A. The 2.7 image is byte-identical to the shipped one, but every gateway that ran 3.1 comes up on factory-default radio settings. 2.7 cannot be changed. Which change to 3.1 makes the rollback load the existing settings?
MCQ-7A fleet of 200,000 LTE-connected controllers runs 48 MB firmware images on dual-bank flash. The bootloader streams each image straight into the inactive bank and flips the boot pointer as soon as the last byte lands. Field data: 4% of transfers stall mid-stream, and 0.7% of updated units come back bricked with a truncated image in the bank the bootloader now points at. Failures track the cellular link, not power. The team cannot afford a second full image copy. Which change removes the bricking?
MCQ-13An A/B firmware updater on a 64 KB-RAM MCU streams a 512 KB image into the inactive slot through a 4 KB flash-write buffer, then writes a 24-byte metadata record that marks the new slot active and bumps a sequence counter, then reboots. The last partial buffer flush and the metadata write are two separate flash operations. The bootloader is mask ROM and cannot be changed; it checks only the metadata record's CRC-32 and boots the slot the record names. On units that lost power between those two operations, the bootloader boots the new slot with up to 4 KB at the end of the image still erased (0xFF), and the metadata CRC passes. Which change fixes the failure?
MCQ-8A fleet of battery-powered sensors runs an MCU with 512 KiB flash: 32 KiB bootloader, 32 KiB metadata, and two 224 KiB firmware slots, A and B. An update writes a new image to B, verifies its hash, sets B's pending flag, and resets. The new image must confirm itself within 30 s or the bootloader rolls back. Ten seconds after the new image starts, power is lost before it confirms. What does the bootloader do on the next reset?
MCQ-11A device uses an A/B bootloader. Slot A holds confirmed firmware 3.4.1; slot B holds candidate 3.5.0. The bootloader keeps a persistent trial counter that starts at 0 when B is first marked trial. Before handing off to B, it increments the counter. The application must set a confirmation flag within 90 seconds; if it does not, the bootloader reboots. If the counter reaches 3 and the confirmation flag is still clear, the bootloader rolls back to A instead of booting B. The counter survives watchdog resets and power cycles. Right now the counter is 2. B has been booted twice; both times the application crashed with a watchdog reset before confirming. The user then power-cycles the device. What should the bootloader do on the next boot?
MCQ-10A fleet runs A/B updates. The bootloader keeps a boot counter in a shared misc partition: every time it boots a slot flagged unconfirmed it increments the counter, and when the counter reaches 4 it marks that slot bad and boots the other one. Userspace confirms a slot by writing a magic value to the misc partition and zeroing the counter. On the new image the first-boot sequence runs fsck, then a data migration, then the confirm write, and takes about 45 s end to end. A hardware watchdog resets the board if it is not kicked within 30 s of boot, and the service that kicks it starts only after the first-boot sequence finishes. After the OTA, devices boot the new slot, reset at roughly 30 s, and after four attempts come back up on the old slot. What is the cause?
MCQ-22A dual-bank updater on an MCU with 2 KB erase pages copies a 256 KB image into bank B in 1 KB chunks (about 1 ms per chunk). After every 16 KB it erases and rewrites a 16-byte progress record in a metadata page; the erase takes about 25 ms and the write about 50 µs. The bootloader resumes from the recorded offset when the record's magic and CRC check out, and otherwise restarts the download from zero. In a power-fail campaign, every cut that landed in the record-update window came back with an invalid record and restarted the download from zero. Which change removes that cost?
MCQ-20A fleet of 12,000 battery-powered sensors runs a five-image firmware set: bootloader 2.8, MCU app 4.0, radio stack 3.1, FPGA bitstream 1.6, schema 4. The OTA server pushes each image into the active slot in place as soon as it is transcoded: the 600 KB radio image lands first, the 64 KB bootloader last. Last campaign, 492 devices (4.1%) failed to boot; every failure had rebooted between the radio write and the bootloader write (60% power loss, 40% watchdog reset from the radio's higher current draw). Logs show bootloader 2.8 rejecting radio 3.2's signature. Which change to the campaign removes this failure mode?
MCQ-24A fleet of 20,000 battery-powered sensors runs A/B firmware updates. The bootloader can write a 256-byte record to a retained-RAM region that survives a watchdog reset but not a power cycle, and can append records to a 16 KB flash journal that is erased only when it fills. After a rollout, 3% of devices that failed an update reboot into the old slot, and support cannot tell whether the failure was a signature rejection, a truncated download, or a slot write error. The signing key stays in the secure element. What should the bootloader write, and where, so support can classify those failures without exposing secrets?
MCQ-23A company ships 200,000 Wi-Fi smart locks built by a contract manufacturer. The factory line already uses a shared Wi-Fi password and a single signing key for all devices. Security requires that physically dumping one lock's flash must not let an attacker impersonate another lock, and that ownership can transfer to a new owner without returning the lock to the factory. Which provisioning design should be used?
MCQ-18Your fleet pulls firmware from a CDN over pinned TLS, and the bootloader verifies the vendor signature before jumping to the image, costing about 40 ms per boot. Images also arrive through the offline flasher at the contract manufacturer and through a recovery slot the bootloader writes. The debug console is left enabled in production, and one privileged app can write the inactive slot. A teammate proposes dropping the bootloader check for CDN-delivered images to save the 40 ms. Which plan should ship?