Embedded Systems interview questions: interrupts, RTOS, memory and peripherals

Reviewed by Mark Dickie · Last updated

5 questions on this page you can answer and see marked on the spot. Go to the first one

Embedded systems are computers built into a device to do one dedicated job, usually on a microcontroller with fixed memory, tight timing and direct access to hardware. Interviews check whether you can reason about interrupts, memory layout, concurrency under an RTOS and peripheral protocols such as I2C, SPI and UART. Expect C first, some assembly or register-level reading, and a debugging story or two.

What does an embedded systems interview test?

Questions tend to cluster into a few areas. The table shows where each one shows up and the kind of detail interviewers listen for.

AreaWhat gets probed
InterruptsISR length, why volatile matters on shared flags, nested priorities on Cortex-M NVIC
MemoryStack vs heap vs .bss/.data, linker scripts, why malloc is often avoided
RTOSPriority inversion, mutex vs semaphore, FreeRTOS task states, tick period
BusesI2C clock stretching and pull-ups, SPI modes (CPOL/CPHA), UART baud mismatch
Low-level CBit masking of registers, struct padding, alignment faults, endianness
ReliabilityWatchdog timers, brown-out reset, stack overflow detection

How should I prepare for embedded systems interview questions?

Work through these steps in order, using a dev board if you have one.

  1. Blink an LED by writing to GPIO registers directly, without a vendor HAL.
  2. Add a button interrupt, then fix the bug that appears when the flag lacks volatile.
  3. Read a sensor over I2C and confirm the waveform on a logic analyser.
  4. Create two FreeRTOS tasks sharing a resource, then reproduce and fix a priority inversion.
  5. Read the map file and explain where each variable ended up in flash or RAM.
  6. Trigger a watchdog reset on purpose and explain what the reset cause register reports.

Answer each quiz question out loud before you check it. Interviewers care about your reasoning on timing and failure modes as much as the final answer.

Key facts

  • Tarmac has 93 Embedded Systems interview questions on this topic, 10 of them on this page, at difficulty 1–4 of 5.
  • Tarmac last reviewed these Embedded Systems interview questions on 5 December 2026.

At a glance

Questions10 shown · 93 in the bank
Difficulty1–4 of 5
FormatsTrue / false, Multiple choice, Find the bug, Short answer, Ordering, Multiple answer, Fill in the blank, Code output, Flashcard

What you'll review

  1. emb boot sequence
  2. emb bootloaders
  3. emb jtag swd
  4. emb hil testing

Practice questions

Try one before you open the answer. Pick an option and press Check; it's marked on the spot.

On an ARM Cortex-M microcontroller, the first two words of the vector table at reset hold the initial stack pointer value and the address of the reset handler.#

Options

Show answer

The statement is true. At reset, an ARM Cortex-M core reads the first word of the vector table as the initial main stack pointer value. It reads the second word as the address of the reset handler and loads it into the program counter. Execution then starts in the reset handler, which usually runs the C runtime startup code before calling main().

Why:

At reset, a Cortex-M core loads the main stack pointer (MSP) from word 0 of the vector table and the program counter from word 1, which is the reset handler's address. Only after that does it begin running code. This is why the vector table has to sit at the boot address, usually 0x00000000 or an aliased flash address.

In a typical bare-metal embedded C program, global variables with nonzero initial values are already in RAM at power-up, so the startup code does not have to copy anything before calling main().#

Options

Show answer

The statement is false. RAM holds undefined contents at power-up. The startup code copies the initial values of initialized globals (the .data section) from flash into RAM, and it clears the .bss section to zero. Only then does it call main(). If those steps are skipped, globals start with garbage values.

Why:

RAM contents are undefined at power-up. The initial values of initialized globals (the .data section) are stored in flash, and the startup code copies them into RAM. It also zero-fills the .bss section. Only after both steps does it call main().

In a microcontroller-based embedded system, what is the primary job of a bootloader?#

Options

Show answer

An embedded bootloader is the small program that runs first after reset. It does basic setup, can receive or check a firmware update, and then jumps to the main application. That jump-to-application step is what makes field firmware updates possible without a hardware programmer.

Why:

A bootloader is a small program that runs right after reset. It sets up the minimum hardware it needs, can check for or accept a new firmware image, and then jumps to the main application. Scheduling tasks is the RTOS's job, compiling happens on the host machine, and heap management belongs to the runtime library.

Here is a planned wiring list for connecting a standard ARM SWD debug probe to a target MCU. Which line contains the wiring mistake?#

Probe VTref  -> Target VDD (3.3V sense)
Probe GND    -> Target GND
Probe SWDIO  -> Target SWCLK
Probe SWCLK  -> Target SWCLK
Probe nRESET -> Target NRST
Show answer

The bug is on line 3.

Why:

Line 3 connects the probe's SWDIO to the target's SWCLK. SWDIO is the two-way data line and has to go to the target's SWDIO pin. Wired this way, the target's SWDIO pin gets nothing and two probe outputs end up on one clock pin, so SWD can't work. Every other line is correct: VTref senses the target voltage, ground is shared, SWCLK goes to SWCLK, and nRESET goes to NRST.

In a bare-metal C program, what does the startup code do with the .bss section before calling main(), and why does that matter?#

Show answer

Startup code fills the whole .bss region in RAM with zeros, using the start and end symbols from the linker script. The C standard says that globals and statics with no initializer, or initialized to zero, start at zero. Those variables take up no space in the flash image, so nothing sets them unless the startup code zeroes RAM. Without that step they would hold whatever garbage was in RAM at power-up.

Why:

The .bss section takes no space in the flash image. The startup code has to zero it in RAM so that globals and statics without an initializer start at zero, as the C language requires.

Put these stages of embedded firmware verification in the order they normally run in a CI pipeline, from earliest and cheapest to latest and closest to the real product.#

Put these in order

Show answer

Embedded firmware verification normally runs host unit tests first, then software-in-the-loop (SIL), then hardware-in-the-loop (HIL), and finally field or vehicle tests. Each stage brings in more real hardware and costs more. That is why cheap, fast simulated tests catch logic bugs before expensive real-hardware time is used.

Why:

Verification follows the V-model and the X-in-the-loop progression. Host unit tests check isolated logic in seconds and need no hardware. SIL tests run the integrated firmware against a plant model, still entirely on the host. HIL then puts the real target hardware in the loop, with simulated sensors and actuators, so timing, I/O and driver behaviour get exercised. Field tests on the complete physical system come last because they are the most expensive, the slowest and the hardest to repeat.

On an ARM Cortex-M microcontroller, a bootloader at flash address 0x08000000 validates an application image stored at 0x08008000 and then hands control to it. Which steps belong in a correct jump-to-application sequence? Select all that apply.#

Options

Pick every one that applies.

Show answer

A Cortex-M bootloader jumps to an application in four steps: shut down the peripherals and interrupts it was using, point VTOR at the application's vector table, load MSP from the table's first word, and branch to the reset handler address in the second word. Branching to the image base address itself is wrong, because that word holds the initial stack pointer, not an instruction.

Why:

A Cortex-M vector table begins with the initial stack pointer value, followed by the reset handler address. The bootloader therefore loads MSP from word 0 and branches to the address stored in word 1. VTOR has to point at the application's table, or interrupts will vector into the bootloader's handlers. Peripherals and interrupts that the bootloader left running, such as SysTick, can fire before the application is ready for them, so they should be shut down first. Branching straight to 0x08008000 is wrong because that word holds a stack-pointer value, not code.

Arm Serial Wire Debug (SWD) is a two-signal debug transport that uses a bidirectional data line called _____ and a clock line called _____. IEEE 1149.1 JTAG instead uses the mandatory signals TCK, TMS, TDI and TDO, plus an optional asynchronous TAP reset signal. Give that optional reset signal's name as written in the standard, without an 'n' prefix or suffix and without an asterisk: _____.#

Show answer

Arm Serial Wire Debug (SWD) is a two-signal debug transport that uses a bidirectional data line called SWDIO and a clock line called SWCLK. IEEE 1149.1 JTAG instead uses the mandatory signals TCK, TMS, TDI and TDO, plus an optional asynchronous TAP reset signal. Give that optional reset signal's name as written in the standard, without an 'n' prefix or suffix and without an asterisk: TRST.

Why:

SWD carries debug traffic on the bidirectional SWDIO pin and is clocked by SWCLK. On Arm parts these pins are commonly shared with JTAG TMS and TCK. IEEE 1149.1 defines four mandatory signals, TCK, TMS, TDI and TDO, and an optional active-low asynchronous reset for the TAP controller, named TRST in the standard. The prompt pins the spelling so that variants such as nTRST do not apply.

A HIL rig feeds a sampled GPIO stimulus into a Python model of the firmware's input debouncer so the test can check edge timestamps. What does this script print?#

def debounce(samples, n):
    state, count, edges = 0, 0, []
    for t, s in enumerate(samples):
        if s != state:
            count += 1
            if count >= n:
                state = s
                count = 0
                edges.append(t)
        else:
            count = 0
    return state, edges

stim = [0,1,1,0,1,1,1,0,0,1,0,0,0]
print(debounce(stim, 3))
Show answer
(0, [6, 12])
Why:

The counter only goes up while the sample is different from the debounced state, and any sample that matches the state resets it to 0. The glitch at t=1–2 reaches a count of 2, then the 0 at t=3 resets it. Samples t=4–6 are three 1s in a row, so the state changes to 1 at t=6. Next, t=7–8 count 2 toward 0, but the 1 at t=9 resets the counter. Samples t=10–12 are three 0s in a row, so the state goes back to 0 at t=12. The final state is 0 and the edges are at [6, 12].

On ARMv7-M/ARMv8-M (Cortex-M3/M4/M7/M33), a bootloader jumps to an application image located at a non-zero flash offset. Besides loading MSP and branching to the app's reset handler, what core register must be set so that the application's interrupts go to its own vector table, and what alignment constraint applies?#

Show answer

Write the application's vector table base address into SCB->VTOR (Vector Table Offset Register). The table must be aligned to its size rounded up to the next power of two, and at least 128 bytes (32 words), so a table with many IRQ entries may need 256/512/1024-byte alignment. Barriers (DSB/ISB) after the write are recommended.

Why:

Without updating VTOR, exceptions keep vectoring through the bootloader's table, which points into bootloader code. VTOR's low bits are ignored or reserved, so the table needs the stated natural alignment; a misaligned table silently vectors to wrong addresses.

Related interview questions

The other 83 questions

This page shows 10 and marks what you pick. That's as far as a page can go. A free account opens the other 83 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.

Start with this topic

Free · the whole bank · 100 answers per 30 days, each marked with written feedback

Interview booked? Practise the job ad instead

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.