Interview questions
Key points for each answer are in the app's question bank.
- Explain the difference between const int *p, int *const p and const int *const p.Basic
- What does volatile do? Give two embedded situations where you need it.Basic
- What does static mean on a local variable, a global variable and a function?Basic
- Why does a compiler add padding to structs? How do you minimise it?Intermediate
- Write a function that detects whether the CPU is little-endian.Basic
- Write a function to swap the byte order of a 32-bit value.Basic
- Write macros or inline functions to set, clear, toggle and test bit n of a register.Basic
- Count the set bits in a 32-bit integer. Give two approaches.Basic
- How do you check if an unsigned number is a power of two in one expression?Basic
- Reverse the bits of a byte efficiently.Intermediate
- Implement memcpy. Then explain how memmove differs and implement it.Intermediate
- Why is strcpy dangerous? What would you use instead?Basic
- What are dangling pointers, memory leaks and double frees? How do you prevent them in firmware?Basic
- Where do local variables, globals, static locals, string literals and malloc'd memory live?Basic
- What happens on an MCU between reset and main()?Intermediate
- Use function pointers to implement a table-driven state machine.Intermediate
- What's wrong with #define SQUARE(x) x*x? Fix it.Basic
- Compare inline functions and macros.Basic
- What does if (-1 < sizeof(int)) evaluate to, and why?Intermediate
- Give three examples of undefined behaviour in C that bite embedded code.Intermediate
- Implement a fixed-size circular buffer with put and get.Basic
- Reverse a singly linked list, then detect whether it has a loop.Intermediate
- When would you use a union in firmware, and what are the caveats?Intermediate
- Why are C bit-fields risky for mapping hardware registers?Intermediate
- What are .text, .data, .bss and .rodata, and what does a linker script do?Intermediate
- Explain extern and why you get multiple-definition linker errors.Basic
- Implement atoi with error handling for overflow and invalid characters.Intermediate
- Why is recursion usually avoided on microcontrollers?Intermediate
- How do hardware and software breakpoints differ?Intermediate
- A Cortex-M device hits a HardFault in the field. How do you find the cause?Advanced
- What's the size of a pointer on a 32-bit MCU, and what does sizeof return for an array passed to a function?Intermediate
- Code works at -O0 but fails at -O2. List the usual causes.Advanced
Hands-on challenges
UART receive ring bufferDrivers & ISRs · Medium · 4 bugs · ~6 minTick timeouts and delaysTiming · Warm-up · 3 bugs · ~4 minCasting a byte stream to a structMemory & C · Medium · 4 bugs · ~6 minInteger promotion trapsMemory & C · Medium · 3 bugs · ~5 minStrings on the stackMemory & C · Warm-up · 3 bugs · ~4 minArray helpers with memcpyMemory & C · Warm-up · 3 bugs · ~4 minHeap use in a message handlerMemory & C · Medium · 3 bugs · ~5 min64-bit microsecond timestampsTiming · Medium · 2 bugs · ~5 minFlags shared with an ISRDrivers & ISRs · Medium · 2 bugs · ~5 minData retained across resetsBoot & OTA · Hard · 3 bugs · ~6 minRegister access macrosMemory & C · Warm-up · 3 bugs · ~4 minProduction SRAM testTest & validation · Medium · 3 bugs · ~6 minSleep until there's workLow power · Hard · 3 bugs · ~7 minSynchronous request and replyRTOS · Hard · 3 bugs · ~8 minReport task stack overflowRTOS · Medium · 3 bugs · ~6 minPacking a log recordMemory & C · Medium · 3 bugs · ~6 minFixed-point speed loopTiming · Medium · 3 bugs · ~6 minFlow meter input captureTiming · Medium · 3 bugs · ~6 minStatus register as C bitfieldsMemory & C · Hard · 3 bugs · ~7 minEnd-of-line test firmwareTest & validation · Medium · 3 bugs · ~6 minHelpers shared by two tasksMemory & C · Medium · 3 bugs · ~6 minMicrosecond delays that hangTiming · Medium · 3 bugs · ~6 minAccelerometer readings make no senseProtocols · Warm-up · 3 bugs · ~5 min
Design rounds
Companies that emphasise it
BoschAutomotive supplier · India hiring: HighArmChipmaker · India hiring: MediumDensoAutomotive supplier · India hiring: MediumMedtronicMedical devices · India hiring: MediumSTMicroelectronicsChipmaker · India hiring: MediumAppleConsumer devices · India hiring: LowGarminConsumer devices · India hiring: LowTeslaAutomotive OEM · India hiring: Low
Practise these with an AI interviewer that asks the follow-up.
Start practising