← All articles
EmbeddedFirmwareCInterruptsInterview

Embedded Systems and Firmware Interview Questions for Junior Engineers

Prepare for embedded firmware interviews with practical questions on C, interrupts, memory-mapped registers and debugging.

November 23, 2026·3 min read

Embedded interviews can combine C programming with the behavior of physical peripherals. A good answer states the target architecture and peripheral assumptions instead of treating hardware registers like ordinary memory.

Q1. What does volatile do?

volatile tells the compiler that accesses have observable effects and must follow the language's volatile access rules. It is commonly used for memory-mapped registers. It does not make an operation atomic, guarantee inter-thread synchronization, or replace hardware memory barriers.

Q2. Is incrementing a shared counter safe in an interrupt handler?

Not necessarily. An increment can be a read-modify-write sequence, and access width or alignment may exceed the processor's atomic capability. Identify both contexts and the platform's guarantees; use an appropriate atomic primitive or a short, correctly restored interrupt-masked critical section.

Follow-up: Disabling interrupts does not necessarily synchronize another CPU core or DMA engine.

Q3. How do you set one bit in a peripheral register?

For an ordinary readable/writeable register, a read-modify-write can preserve unrelated bits. First read the peripheral manual: write-one-to-clear bits, read side effects and concurrent hardware updates can make read-modify-write unsafe. Dedicated set/clear registers, if provided, may be preferable.

For example, assume a platform supplies CTRL as a 32-bit volatile register lvalue, bit 3 is ordinary read/write, and no interrupt, other core or hardware modifies it concurrently:

#include <stdint.h>
 
/* CTRL is provided by the platform's device header. */
CTRL = CTRL | (UINT32_C(1) << 3);

The expression sets bit 3 and writes back the other bits as read. It is a read followed by a write, not an atomic operation; the assumptions must be checked against the device manual.

Q4. What should an interrupt service routine do?

Handle the time-critical part, acknowledge the interrupt as the peripheral requires and defer longer work when appropriate. Exact ordering depends on the device; failing to clear a level-triggered source can cause repeated interrupts.

Q5. How would you debug a device that does not respond?

Check supply and ground, reset and clocks, configuration, physical connections and signal timing. Compare observations with the device specification. Form competing hypotheses and change one variable at a time. For waveform-oriented examples see SPI, I²C and UART questions.

Q6. What is the difference between polling and interrupts?

Polling repeatedly checks status and can be simple and predictable, but consumes execution time and may miss events without proper buffering. Interrupts notify software but introduce latency and concurrency concerns. The right choice depends on timing, power and event rate.

Q7. What is an endianness issue?

Endianness describes byte ordering in multi-byte representations. A protocol's wire order and CPU memory order are separate conventions. Decode a byte stream explicitly rather than assuming a direct cast is portable; alignment and aliasing rules matter too.

Q8. What should you test at a boundary?

Test zero, maximum size, wraparound, concurrent updates and error paths. For a ring buffer, define whether one slot is reserved to distinguish full from empty and test wraparound with producer and consumer interleavings.

Practice hardware interview questions

Build an interview routine with ChipPrep's existing Practice experience.