Embedded Systems Engineer question bank
683 questions. Filter by level and skill, track what you've solved, and see how many people get each one right.
- Why use volatile
- Setting a register bit
- Protocol with addresses
- Floating input pin
- Keeping ISRs short
- Dynamic memory on small MCUs
- PWM duty cycle
- What a watchdog does
- Reading a hex register value
- Clearing one register bit
- Toggling an LED pin
- Testing a status flag
- Adding to a uint8_t counter
- Where const goes in a pointer
- What lives in .bss
- A static local counter
- Converting an ADC reading
- UART bytes per second
- Why I2C needs pull-ups
- Talking to two SPI devices
- Timer prescaler maths
- Absolute maximum ratings
- Choosing scope or logic analyser
- Why a cross-compiler
- Keeping a table out of RAM
- First byte in memory
- Integer division results
- The interrupt vector table
- Sizing an LED resistor
- What a bootloader does
- A macro without parentheses
- Delaying inside an RTOS task
- CAN bus termination
- Why enable brown-out reset
- Incrementing a uint32_t pointer
- Passing an array to a function
- Returning a local buffer
- A register access macro
- Toggling an LED bit
- sizeof a pointer and an array
- Subtracting two pointers
- Accessing a member through a pointer
- Writing through an unset pointer
- A read-only buffer parameter
- A designated array initialiser
- Zeroing a local struct
- Why swap needs pointers
- Where .data starts out
- Which way the stack grows
- static on a global variable
- Sharing a global between files
- A big buffer inside a function
- Recursion in firmware
- Default value of a static local
- Default value of a local
- Why include guards
- An undefined reference error
- The register keyword today
- Shrinking a struct by reordering
- Choosing -Os for flash
- What goes in .rodata
- ELF file or BIN file
- Why use uint32_t over unsigned long
- Storing -1 in a uint8_t
- Storing 0x1234 in a byte
- Converting a float to int
- A float comparison that fails
- A leading zero in a number
- Adding one to UINT32_MAX
- Heavy work in an interrupt
- printf in an interrupt
- What MISRA C is for
- A missing break
- Guarding a pointer in one test
- First words read after reset
- Why registers are volatile
- Value of an uninitialised global
- Where initialised globals come from
- Signals used by SWD
- Garbage characters on the console
- I2C lines sitting at 0 V
- What a watchdog timer does
- ELF file or raw binary
- Reading the linker map file
- Placing decoupling capacitors
- UART idle line level
- RAM region overflowed
- Programming flash bits
- Knowing which build is on a device
- Why keep two image slots
- Signing or encrypting firmware
- Which key goes on the device
- Comparing version numbers
- Kicking the watchdog in a timer ISR
- Mutex compared with semaphore
- Waiting inside an RTOS task
- Resuming a broken download
- Start of the chain of trust
- What a delta update needs
- Before starting an update
- Doing heavy work in an ISR
- printf inside an interrupt
- Rolling out to the whole fleet
- One press, many interrupts
- What functional safety means
- Safety standard for cars
- Choosing a safe state
- Why teams follow MISRA C
- Highest automotive integrity level
- Board draws 1 A at power-up
- Powering a new board first time
- Resets when the board is touched
- Protecting exposed connectors
- Tracing requirements to tests
- Testing joints under a BGA
- Catching a rare glitch
- What an open-drain output can do
- Button wired to ground with pull-up
- Meaning of an NRST pin
- Setting bit 5 of a register
- GPIO alternate function mode
- Polling versus interrupts
- Hooking an ISR in CMSIS startup code
- 16-bit timer overflow time
- Why UART is called asynchronous
- SPI shifts both ways at once
- Size of the 7-bit I2C address space
- Why CAN uses two wires
- Purpose of a DMA controller
- What a watchdog timer protects against
- Steps in a 12-bit ADC
- Light sleep compared with deep sleep
- Edge versus level triggered inputs
- Two interrupts at different priorities
- Crystal or internal RC oscillator
- PLL output frequency
- Peripheral registers ignore writes
- Memory-mapped peripheral registers
- What lives in flash and SRAM
- What 8N1 means
- Choosing RS-485 over TTL UART
- Running a DC motor from a pin
- Diode across a relay coil
- A 5 V sensor output into a 3.3 V MCU
- PWM frequency from timer settings
- What SysTick is used for
- Using the built-in ROM bootloader
- SWD compared with JTAG
- Byte order of a 32-bit value
- Saving RAM with a lookup table
- What interrupt latency measures
- Role of the ADC reference voltage
- Width of a standard CAN ID
- UART line when nothing is sent
- Why I2C has a repeated start
- Schmitt trigger on a GPIO input
- Capacitors next to each VDD pin
- What real-time really means
- Hard versus soft deadlines
- FreeRTOS task waiting on a queue
- Which task the scheduler runs
- Two tasks at the same priority
- Job of the idle task
- Converting milliseconds to ticks
- Running a task at a fixed rate
- Mutex versus binary semaphore
- Guarding a pool of 4 buffers
- When to use a recursive mutex
- Waiting for three conditions at once
- Where a FreeRTOS timer callback runs
- What a FreeRTOS queue stores
- Sending to a full queue
- Meaning of portMAX_DELAY
- Units of the stack size argument
- Zephyr thread priority numbers
- Sleeping a Zephyr thread
- Creating a Zephyr thread at build time
- Enabling a Zephyr feature
- Building a Zephyr app for a board
- Passing fixed-size messages in Zephyr
- Deferring ISR work in Zephyr
- What a context switch saves
- Short critical section in FreeRTOS
- vTaskSuspendAll compared with a critical section
- Choosing a FreeRTOS heap scheme
- Tasks with no heap at all
- A low-priority task never runs
- Two tasks stuck forever
- Checking how much stack a task used
- Turning on configASSERT
- Catching out-of-heap errors
- Putting the CPU to sleep when idle
- When a super loop is enough
- Cooperative versus preemptive scheduling
- Code after vTaskStartScheduler
- FreeRTOS kernel licence
- Zephyr project licence
- Signalling a Zephyr thread from an ISR
- Zephyr mutex in interrupt context
- Priority ceiling protocol
- Priority order under rate monotonic
- What jitter means for a periodic task
- Changing a task priority later
- What k_yield does in Zephyr
- Checking Zephyr thread stack use
- Running Zephyr code on a PC
- Always keeping the latest value
- Limit of FreeRTOS stream buffers
- Priority inversion
- Buffering UART data
- I2C device not responding
- Counter shared with an ISR
- SPI returns garbage
- One press, many events
- Size of a struct
- Passing data between tasks
- Adding two uint8_t values
- Comparing int with unsigned
- Bit-fields for hardware registers
- sizeof on an array parameter
- Measuring a signal frequency
- Waking a task from an ISR
- C++ features often disabled
- Lighter than a semaphore
- Choosing task stack sizes
- Describing hardware in Zephyr
- Ring buffer index with a mask
- Slave holds SCL low
- Reading from an SPI slave
- UART framing errors
- Who wins CAN arbitration
- What filled the flash
- Dropping unused functions
- Initialised global reads garbage
- Stuck in Default_Handler
- Unit testing driver logic
- Unused pins and sleep current
- Clock speed and power
- Atomic GPIO writes
- Cortex-M interrupt priority numbers
- Multiplying Q15 numbers
- Feeding the watchdog with an RTOS
- Declaring a function pointer
- A command dispatch table
- Callbacks with a context pointer
- Arithmetic on void pointers
- Extracting a register field
- Writing a register field
- Returning a pointer through a parameter
- const and volatile together
- A variable changes by itself
- Changing a string literal
- strncpy and the missing terminator
- Shifting bytes inside a buffer
- Row-major layout of a 2D array
- What offsetof gives
- A linked list without malloc
- State machine with function pointers
- Pointer size on an 8-bit AVR
- A NULL check after use
- A struct over peripheral registers
- What *p++ does
- Calling an unset callback
- Building a value from bytes
- Heap and stack meeting
- Same global in two files
- The MEMORY block of a linker script
- Putting a buffer in a special RAM
- The first two vector table words
- What runs before main
- Weak handlers in startup files
- Per-function stack figures
- const tables still in RAM on AVR
- Is returning a literal safe
- Fixed-size block pool
- malloc fails with free memory
- A variable-length array
- A struct copy inside an ISR
- Small helpers in a header
- How startup finds .data
- Where newlib gets heap memory
- Library order on the link line
- What LTO adds
- Reading bytes of a value via a union
- char on ARM and x86
- Shifting a negative number right
- A timeout that survives wraparound
- Raw ADC count to millivolts
- Rounding an integer division
- Remainder of a negative number
- i = i++ and similar
- Two reads in one call
- A volatile counter loses counts
- Reading a 64-bit tick on a 32-bit MCU
- A formatter used by main and an ISR
- A MAX macro with side effects
- Why do { } while (0)
- A config flag set to 0
- Checking a struct size at build time
- Widening a negative byte
- Adding without wrapping
- Only a few breakpoints allowed
- Is a CRC enough for an update
- App dies on first interrupt
- Counter read gives odd values
- Lost GPIO pin changes
- Sample rate for SPI capture
- Ringing seen on the scope
- Works only with the debugger
- Variable shows "optimized out"
- Lookup table eating RAM
- Logging without slowing the loop
- Debugger drops in low-power mode
- Probe cannot attach any more
- Magic value lost across reset
- Interrupts stop during erase
- Where the app must start
- Why did it reset
- Brownout and corrupt settings
- Halted in Default_Handler
- Board stuck at clock setup
- Is HTTPS enough for OTA
- Confirming a new image
- Overwrite versus swap updates
- What actually gets signed
- Verify once or every boot
- High-priority task starves
- Two tasks stop forever
- Blocking call in an ISR
- Watchdog for many tasks
- Reset from refreshing too soon
- Cellular data for a fleet update
- Time to send an image over BLE
- Image built for another board
- RTOS tick in a sleepy device
- Measuring sleep and burst current
- Debugging crashes in the field
- What asserts do in release
- malloc fails after days
- Bug disappears when you look
- Two tasks share strtok
- Probe stops the oscillator
- What diagnostic coverage is
- Testing RAM at start-up
- Guarding a critical variable
- Two sensors disagree
- malloc in safety code
- What static analysis adds
- Resets when the radio sends
- SPI data off by one bit
- Finding which part is shorted
- Fault that comes and goes
- Inputs for an ASIL rating
- Independent watchdog for safety
- Proving an output switched
- Battery voltage from an ADC count
- What flash ECC can fix
- What SPI mode 3 means
- Datasheet gives address 0xD0
- NACK at the end of an I2C read
- Baud error with an integer divider
- Reading a quadrature encoder
- Center-aligned PWM period
- Dead time in a half bridge
- Continuous ADC capture with DMA
- DMA increment settings for UART TX
- ADC reads low from a 100 kΩ divider
- Extra resolution by oversampling
- Refreshing a window watchdog too early
- Independent watchdog timeout
- Code runs slow after waking from stop
- Where code resumes after standby
- WFI compared with WFE
- Sleep-on-exit for an event-driven app
- Why RTC crystals are 32.768 kHz
- Time quanta in a CAN bit
- CAN FD payload size
- A CAN node alone on the bus
- Which IDs a CAN filter accepts
- Estimating CAN bus load
- CAN bit stuffing
- Second SPI slave breaks the first
- What RTS/CTS flow control does
- Receiving variable-length UART messages
- UART overrun error
- RS-485 reply loses its last byte
- GPIO speed setting for a slow LED
- Interrupts on PA0 and PB0
- Preemption priority versus subpriority
- Tail-chaining on Cortex-M
- Registers saved on interrupt entry
- Nested disable and enable of interrupts
- Masking only some interrupts
- Work done before main
- Raising clock speed and flash latency
- Writing over existing flash data
- Saving a counter to flash every minute
- Exact ADC sample rate
- SysTick reload for a 1 ms tick
- Battery voltage from an ADC code
- Current through a held button
- Distance from an ultrasonic echo
- Centring a hobby servo
- Sleep current high only under debug
- Board hangs without the debugger
- HAL_Delay inside an interrupt
- Why did the field unit reboot
- Loop rate with vTaskDelay
- How long vTaskDelay(1) waits
- When a 32-bit tick count wraps
- Timeout check that survives wrap
- Why portYIELD_FROM_ISR is needed
- Lost interrupts with a binary semaphore
- First take of a new binary semaphore
- Releasing another task mutex
- Mutex held during a long wait
- Limits of priority inheritance
- How many bits an event group holds
- Three tasks meeting at a point
- Event bit stays set and loops
- Setting event bits from an ISR
- Blocking inside a timer callback
- xTimerStart returns pdFAIL
- A 2.5 ms software timer
- Queueing pointers to large buffers
- Waiting on two queues and a semaphore
- Overhead in a message buffer
- Stream buffer trigger level
- ulTaskNotifyTake as a counter
- When task notifications do not fit
- Gatekeeper task for a shared UART
- Deleted tasks leak memory
- Idle task and priority 0 tasks
- Waking a task out of a long delay
- Measuring CPU use per task
- CPU load from run-time stats
- Seeing task switches over time
- Allocation fails with free memory left
- Heap across two RAM banks
- Calling malloc from several tasks
- Task crashes after adding printf
- errno shared between tasks
- Context of a Zephyr k_timer expiry function
- Running a job 500 ms later in Zephyr
- One work item slows all others
- Waiting on several Zephyr objects
- Data put in a Zephyr FIFO gets corrupted
- A Zephyr thread with priority -1
- k_sched_lock compared with irq_lock
- Setting a flag from ISR and thread in Zephyr
- Checking a Zephyr device before use
- Moving a sensor to another I2C bus
- Logging inside a fast ISR in Zephyr
- Running init code before main in Zephyr
- Finding Zephyr Kconfig options
- Running Zephyr tests across boards
- Adding a bootloader for firmware updates
- Protecting data on a dual-core Zephyr SoC
- Pinning a task to one core
- Priority assumptions on two cores
- Wi-Fi jitter on an ESP32 control task
- Isolating an untrusted task
- Limiting a Zephyr thread to its own memory
- An interrupt the kernel never masks
- Lock-free ring buffer from ISR to task
- Avoiding malloc after start-up
- Long critical section and interrupt latency
- Measuring task switch time
- Raising the tick rate to 10 kHz
- Priority of an interrupt handler task
- Using timeouts on every block
- Embedded Linux or an RTOS
- Utilisation limit under EDF
- Total CPU utilisation of a task set
- Testing FreeRTOS code on a PC
- Spotting a stuck task
- Random HardFaults
- Corruption in one task
- DMA data looks stale
- Battery dies too fast
- Bricked devices after an update
- Reading a 32-bit field
- Missed motor control interrupts
- Works at -O0, fails at -O2
- An overflow check that vanishes
- Reading a float from a packet
- Packed struct crashes a Cortex-M0
- ISR runs twice per event
- A lock-free ISR ring buffer
- Rate monotonic utilisation test
- Taking a mutex in an ISR
- Garbled log text from two tasks
- A CAN node goes silent
- I2C bus stuck after reset
- A phantom 100 Hz signal
- Slow maths on a Cortex-M4F
- Jitter in a control loop ISR
- Proving the stack is big enough
- Downgrading to signed old firmware
- Firmware read over SWD
- Comparing a message authentication code
- FromISR call from a high priority ISR
- Flash wearing out in a week
- Settings lost on power cut
- Sleep current 60 times too high
- The tick keeps waking the CPU
- Timestamp jumps backwards
- Inverting a uint8_t
- Reading NULL does not crash
- Lost GPIO updates from an ISR
- What restrict promises
- Reading a float as uint32_t
- An array exactly the string length
- Detecting snprintf truncation
- A flexible array member
- Recovering the parent struct
- Ordering pointers from different arrays
- Writing to a const table
- Aligning a DMA buffer
- Reading a string from AVR flash
- Pointer to an array of eight
- Storing a pointer in an integer
- sizeof a member through a null pointer
- Reading arm-none-eabi-size
- Keeping a value across a reset
- App interrupts go to the bootloader
- One table, flash and RAM
- printf of a double prints garbage
- Erasing flash from flash
- Initialising a global with a call
- Catching stack overflow at once
- Two stack pointers on Cortex-M
- Vector table vanished from the image
- Bit-band alias addresses
- DMA reads zeros from a buffer
- A string table that uses RAM
- Load address and run address
- An odd function address
- Multiplying two uint16_t values
- Building a bit 31 mask
- Shifting by 32
- One million on an 8-bit MCU
- ADC maths gives wrong millivolts
- Atomics on a Cortex-M0
- Flag cleared as the last ISR line
- Enum size differs between builds
- A ready flag that is always false
- abs of the most negative int
- Converting 300.0 to a byte
- Dividing by zero on Cortex-M3
- Baud rate error from rounding
- Finding the faulting instruction
- Which stack holds the frame
- Reading a precise bus fault
- Fault PC points to the wrong line
- Crystal stops in the field
- Aligning a relocated vector table
- Receiving frames of unknown length
- FromISR call trips an assert
- Cast pointer faults on M0
- Size of a header struct
- Designing an image header
- C++ globals never constructed
- Who is overwriting this variable
- DMA data looks stale on M7
- One AES key for every device
- Battery life from duty cycle
- Power cut in the middle of a swap
- A signing key has leaked
- Where the signing key lives
- Verified but swapped afterwards
- Glitching past the check
- Is this task set schedulable
- Critical section loses bytes
- Barriers after core config
- Rollback after a settings change
- One cloud password for all units
- Update resets halfway through
- Crash only when printing floats
- Updating with dual-bank flash
- Reacting within the FTTI
- What MC/DC coverage proves
- Safety code beside non-safety code
- Largest pull-up for 400 kHz I2C
- Probing a high-side gate safely
- Emission peaks every 25 MHz
- Display freezes after an ESD zap
- Failure rate for SIL 3
- Why use lockstep cores
- Redundancy that is not redundant
- State machine with no default
- ADC reads low through a divider
- Elapsed ticks across a timer wrap
- Clearing an EXTI flag with |=
- Bit-band alias of an SRAM bit
- Jumping from bootloader to app
- PWM glitch when changing the period
- Battery life of a duty-cycled node
- Longest SysTick period at 168 MHz
- Porting BASEPRI code to Cortex-M0
- Timing an ISR in CPU cycles
- Finding the line that faulted
- Imprecise bus fault address
- SPI chip select released too early
- Write position in a circular UART DMA buffer
- Time to read 6 bytes over I2C
- Time to send 4 KB over SPI
- Two CAN nodes using the same ID
- Stack frame with FPU context
- Catching stack overflow with the MPU
- Watchdog resets a sleeping device
- Phantom interrupts from a long cable
- Calling printf from an ISR
- ADC noise synced to PWM
- External crystal fails in the field
- USB fails on the internal oscillator
- Setting STM32 read protection level 2
- Negative swing on an ADC pin
- One ADC channel affects another
- Errors on a long 500 kbit/s CAN bus
- RTC loses 2 minutes a month
- DMA buffer declared as a local
- ADC DMA data size mismatch
- Receiving UART data while in stop mode
- Missed wake-up just before sleep
- Timeouts fail in HAL callbacks
- Devices fail to boot on weak batteries
- Reading stale data after a flash write
- Pump turns on briefly at power-up
- A precise 10 µs trigger pulse
- Worst-case response time of the lowest task
- Above the RM bound but still schedulable
- Adding mutex blocking to response time
- Task reads garbage from a main local
- Parameter from a function that returns
- Why FreeRTOS uses PendSV for switching
- Two stack pointers in an RTOS on Cortex-M
- Inheritance through two mutexes
- The Mars Pathfinder resets
- Critical sections on FreeRTOS SMP
- Blocking while the scheduler is suspended
- Interrupt fires before the scheduler starts
- xQueueSend inside a timer ISR
- Critical section inside an ISR
- What stack overflow checking catches
- Inversion with a semaphore used as a lock
- Software timers fire late under load
- Detecting a missed period
- Burst of runs after a long stall
- Allowed NVIC priorities for FreeRTOS calls
- Recovering from a lock order bug
- Seeing queue contents in a debugger
- Race between equal-priority tasks
- Sizing a queue for a burst
- Float use in tasks on Cortex-M4F
- Driver and app share a notification
- Tick count after a tickless sleep
- Periodic Zephyr thread from a k_timer
- Lowest-latency interrupts in Zephyr
- Limit on Zephyr mutex priority boost
- Using a Zephyr condition variable
- Waking many Zephyr threads at once
- Crash after adding a large local in main
- Catching thread stack overflow in Zephyr
- Time slicing in Zephyr
- Allocating memory from a Zephyr ISR
- Powering down an idle Zephyr peripheral
- Storing config values across reboots in Zephyr
- Aborting a thread that holds a mutex
- Network throughput collapses
- Setting configMAX_PRIORITIES to 64
- Running a function in the daemon from an ISR
- Two ISRs and a task share a buffer
- What breaks first in overload
- Harmonic task periods
- Jitter of tick-driven periodic tasks
- Timer callback waits on a mutex
- Deadline shorter than period
- Calling pvPortMalloc in an ISR
- Debugger shows only one call stack
- RTOS for an IEC 61508 product
- Cooperative Zephyr thread hogs the CPU
- Active object design in an RTOS