These Embedded Interview questions cover a wide range of topics, including microcontrollers, programming languages, communication protocols, real-time operating systems, and hardware design.
When using these questions, consider the specific requirements of the embedded systems position and tailor the questions accordingly. Practical exercises or asking candidates to solve real-world problems can also be valuable in assessing their hands-on skills.
- https://aruneworld.com/embedded/interview-questions-uart/
- https://aruneworld.com/embedded/interview-questions-i2c/
- https://aruneworld.com/embedded/interview-questions-spi/
- https://aruneworld.com/embedded/interview-questions-can/
- https://aruneworld.com/embedded/interview-questions-ethernet/
- https://aruneworld.com/embedded/interview-questions-tcp/
- https://aruneworld.com/embedded/interview-questions-udp/
- https://aruneworld.com/embedded/interview-questions-mqtt/
- https://aruneworld.com/embedded/8051-mcu/interview-question-8051/
Embedded C
volatile
What is volatile variables?
- When we use the Volatile keyword for variable, compiler wont optimize that. Beacues that variable can be change any time by externel interface.
- The volatile keyword forces the compiler to not store a copy of the variable in the registers and fetch it each time from memory.
- In embedded, mostly volatile can be use for Memory-mapped peripheral registers, Global variables modified by an interrupt service routine, Global variables within a multi-threaded application.
Can you have constant volatile variable?
Yes, you can have a volatile pointer
Endian System
What is the big-endian format?
What is the Little-endian format?
How to decide whether a given processor is using a little-endian format or a big-endian format?
Write a program to convert little-endian to Big-endian vice versa?
how many register can use in CPU register?
Answere
| Architecture | General-Purpose Registers (GPRs) | Total Registers (GPRs + Special) |
|---|---|---|
| x86 (32-bit) | 8 GPRs (EAX, EBX, etc.) | ~16 including segment, instruction pointer, flags |
| x86-64 (64-bit) | 16 GPRs (RAX, RBX, R8โR15) | 32+ (with XMM/YMM SIMD regs too) |
| ARM (ARMv7) | 13 GPRs (R0โR12), R13 SP, R14 LR, R15 PC | 16 total core regs (+ CPSR status register) |
| ARM64/AArch64 | 31 GPRs (X0โX30), SP | 32 total (+ 32 SIMD/NEON vector regs) |
| MIPS32 | 32 GPRs ($0โ$31) | 32 total (+ special regs like HI/LO) |
| RISCV32/64 | 32 GPRs (x0โx31) | 32 total (+ control and floating regs) |
| AVR (8-bit) | 32 8-bit regs (R0โR31) | 32 total (+ SREG status register) |
Others
What is the need for an infinite loop in Embedded systems?
Embedded systems need infinite loops for repeatedly processing/monitoring the state of the program
- Example: While(Boolean True) OR for(;;); { //Code }
- For e.g.
- Customer care Telephone systems where in a pr-recorded audio file is played in case the dialer is put on hold..
- Also circuits being responsible for indicating that a particular component is active/alive during its operation by means of LED’s.
What is the use of bit wise operators in embedded system?
- The bit-wise shift operators are used to move all of the operand left or right a given number of times.
Embedded Micro Controller & Processor
Chapter-1
The abbreviation of CPU is what?
- CPU– Central Processing Unit
What is MicroController?
- A microcontroller is a compact integrated circuit (IC) that includes a central processing unit (CPU), memory (RAM and/or ROM), input/output peripherals, and various support components. Unlike a general-purpose microprocessor (as found in personal computers), a microcontroller is designed for specific embedded applications, where it serves as the brain of the system.
What is Microprocessor ?
- A microprocessor is a central processing unit (CPU) that acts as the brain of a computer or electronic system. It is an integrated circuit that executes instructions of a computer program, performing arithmetic and logic operations, managing data transfer between memory and input/output devices, and controlling other peripherals.
Difference between RISC and CISC processor.
- RISC – Reduced Instruction Set Computer
- CISC – Complex Instruction Set Computer
If the CPU have RISC-32 and CISC-32 then which is better?
Answere
- RISC-32 is usually better for embedded, low-power, modern designs.
- CISC-32 is mostly for compatibility with existing software and dense instruction encoding.
Difference between Harvard and Von Neumann computer architectures
- There are basically two types of digital computer architectures. The first one is called Von Neumann architecture and later Harvard architecture was adopted for designing digital computers.

Chapter-2
Difference Between 8 Bits,16 Bits, 32 Bits, and 64 Bits Microcontrollers?
What is the difference between embedded systems and the system in which RTOS is running?
- RTOS requires much more constraint on the time and scheduling
Why is called 8,16,32,64 Bit microcontrollers? or What is the difference between 8,16,32 and 64 bit controller?
- The terms 8-bit, 16-bit, 32-bit, and 64-bit refer to the width of the data bus and the internal registers within a microcontroller or microprocessor. This specification indicates the amount of data that the processor can handle in a single operation
Tell About Embedded System?
- Embedded system is combination of software + hardware.
- Example : Air-Conditioner, Washing machine, TV, Mobile phone, etc.
What is SPIFFS?
- SPIFFS – Serial Peripheral Interface Flash File System
Communication
What are the major type of wired communication in embedded system?
- Serial Communication
- Paralel Communication
What is Asyncronous Communication?
Data transfer between two device with be sync with different clock source but same frequency or bit rate or baud rate
What is Syncronous Communication?
Data transfer between two device with be sync with same clock source.
Write your answer for known question in command box
| Questions | Answers |
| Which wired communication is faster? | Ethernet |
| Which wired communication is slower? | I2C |
| Which wireless communication is faster? | Wifi |
| Which wireless communication is slower? | RF |
| List out wired communication protocols? | I2C, SPI, UART, USB,Ethernet, Optical Fiber |
| List out wireless communication protocols? | Wifi, RF, Bluetooth |
| List out synchronous communication protocols? | I2C, SPI, |
| List out asynchronous communication protocols? | UART |
| List out half duplex communication protocols? | UART |
| List out full duplex communication protocols? | SPI, UART, |
| What’s the difference between IยฒC and SPI? | |
| What is the abbreviation of SD card? | Secured Digital card |
Difference between UART vs I2C vs SPI?
| Category | UART | I2C | SPI |
|---|---|---|---|
| Sync or Async | Asynchronous Communication | Synchronous Communication | Synchronous Communication |
| Lines | Tx, Rx, Gnd | SCL, SDA, Gnd | MOSI, MISO, SCL, CS, Gnd |
| Trigger | – | Level Triggering | Edge Driggering |
| Low Speed | 300bits/Seconds | 10Kbps (Slow Mode) | |
| High Speed | 115200bits/Second | 5Mhz (Ultra Fast Mode) | |
| Error Checking | Yes (parity Errors) | based on Ack/NACK Bits | No |
| Start Bit | High to Low transition when SCL is High | High to Low transition when SCL is High | Based on SPi Mode |
| Stop Bit | Low to High transition when SCL is High | Low to High transition when SCL is High | Based on SPi Mode |
Wifi, SPI and I2c same time communicate?
- Yes
ISR Interview Question
Interview Question Chapter–1
What is polling methode?
Polling is a technique where the CPU repeatedly checks the status of a device at regular intervals to see if it needs attention.
- How it works: The processor runs a loop to monitor a hardware flag or memory location that indicates the deviceโs status (ready, busy, etc.).
- Advantage: Simple to implement.
- Disadvantage: Wastes CPU time if the device is idle, because the CPU keeps checking instead of doing other tasks.
- Example: Continuously checking a keyboard buffer in a loop to see if a key is pressed.
WHat is Interrupt Method?
The interrupt method allows the device to notify the CPU when it needs attention, rather than the CPU checking constantly.
- How it works: When a device is ready or an event occurs, it sends an interrupt signal to the CPU. The CPU stops its current task, executes an Interrupt Service Routine (ISR) to handle the event, and then resumes its previous work.
- Advantage: Efficient โ CPU is free to do other work until interrupted.
- Disadvantage: More complex to implement, requires interrupt controller setup.
- Example: Keyboard generating an interrupt when a key is pressed so the CPU can process it immediately.
What is ISR?
- ISR is an interrupt service routine. Which is a short routine used to handle interrupts.
- When an interrupt occurs, at that time, this service will be enabled to execute the actions specified by the interrupt functions.
What is return type of ISR?
- The ISR does not return anything; moreover, it does not have any parameters.
- Example : void timer0 (void) ; // ISR interrupt Function Defination.
Can we use any function inside ISR?
- If a function could be re-entrant, then we could use it. Since during the ISR, another interrupt may occur.
- IIf we turn off the interrupts, then I believe we can call other functions.
Can we use printf inside ISR?
- We generally avoid using printf because it’s not valid for reentrants.
- Furthermore, an ISR is expected to be short, but printf consumes too much time.
What is interrupt latency?
- The interval of time between the occurrence of an interrupt and the initiation of the ISR (Interrupt Service Routine) execution is referred to as interrupt latency. or Interrupt latency is the time between the generation of interrupt and the time for interrupt handler to process it.
How you can optimize interrupt latency?
- We may use polling and message passing for interrupt to handle interrupt immediately.
Interview Question Chapter-1
Explain interrupt latency and how can we decrease it?
- Interrupt latency essentially describes the time duration between the generation of an interrupt and its service by the appropriate routine, typically the interrupt handler.
- External signals, some conditions in the program, or the occurrence of some event, could be the reasons for the generation of an interrupt.
- We can mask interrupts to ignore them, even if an event occurs for which a routine needs execution.
- To reduce latency, one could follow the following steps:
- ISRs are simple and short.
- Servicing interrupts immediately.
- Avoiding those instructions that increase the latency period.
- Also by prioritizing interrupts over threads.
- Avoiding use of inappropriate APIs.
Can we put breakpoint inside ISR?
- Yes, we can.
- I believe we can set breakpoints only in an emulator where hardware is emulated.
- During the ISR process, it will occupy the CPU resource.
WatchDog Timer
How to implement a WD timer in software?
- Implementing a software-based watchdog timer involves periodically resetting or “feeding” the timer to prevent it from timing out and triggering a system reset
Significance of watchdog timer in Embedded Systems.
- The watchdog timer functions as a timing device, set for a predefined time interval, with an expectation that an event should occur within that timeframe. The device generates a timeout signal if it detects no activity during the specified interval.
- One widely used application is in scenarios where a mobile phone hangs, and no activity occurs. In such cases, the watchdog timer triggers a system restart, coming to the rescue of users.
- It serves to reset the system to its original state when inappropriate events occur, such as the simultaneous execution of too many commands or other activities leading to GUI malfunction. Counter devices typically operate it..
Memory
Of the 128-byte internal RAM how many bytes are bit addressable?
- Only 16 bytes of the 128 bytes of RAM are bit addressable.
- The bit addressable RAM locations are 20H to 2FH.
- They are addressed as 0 to 127 (decimal) or 00 to 7F.
- Also the internal RAM locations 20 to 2FH are both byte and bit addressable.
- These 16 bytes can be by single bit instructions using only direct addressing mode.
RTOS Interview Question Chapter-1
What is RTOS?
- RTOS – Real Time Operating System
Difference between hard real-time and soft real-time OS?
- ard real-time system has strict limit on the deadline, while soft real-time OS has comparably loose requirement
What type of scheduling is there in RTOS?
- There are many types: static and dynamic. Earliest deadline first, round robin etc
What is meant by priority inversion?
- It means a task with lower priority will run in front of the task with higher priority in some circumstances.
Tell About priority inheritance?
- Priority inheritance is a synchronization technique used in real-time and embedded systems to address the priority inversion problem. The priority inversion problem occurs when a higher-priority task is blocked waiting for a resource held by a lower-priority task. Priority inheritance ensures that the priority of a task temporarily inherits the priority of the task holding a required resource, preventing unnecessary delays.
How many types of IPC mechanisms you know?
- Share memory,
- Procedure call,
- Semaphore,
- Message passing.
What is semaphore?
- A semaphore is a synchronization primitive used in concurrent programming and multi-threaded environments to control access to a shared resource. It is a signaling mechanism that allows threads or processes to communicate with each other and coordinate their actions to avoid conflicts
What is spin lock?
- It’s like busy waiting, it will check condition continuously in a while loop until the condition is met. This is resource wasting.
RTOS Interview Question Chapter-2
What is the difference between binary semaphore and mutex?
- Binary semaphore only has two state its upper limit is 1. Mutex has higher limit up to a point, but the lower is the same binary semaphore which is 0.
Difference Between Mutex and Semaphore
- Typically, mutexes serialize access to a section of re-entrant code that cannot be executed concurrently by more than one thread. A mutex object only allows one thread into a controlled section, forcing other threads that attempt to gain access to that section to wait until the first thread has exited from that section
- Semaphore – A semaphore restricts the number of simultaneous users of a shared resource up to a maximum number. Threads can request access to the resource (decrementing the semaphore), and can signal that they have finished using the resource (incrementing the semaphore)
What is virtual memory?
- the program will view the memory as if it has the whole memory space. It’s indirect access, the OS will keep a mapping which maps virtual memory address to physical memory address.
Linux
What is Top half & bottom half of a kernel?
- When handling interrupt, we divide the routine into two half. Top half will respond quickly, and call bottom half which will continue to handle the interrupt.
Others
What is configuration management?
It is a system Engineering process for establishing and maintaining consistency of a products performance, functional and physical attributes with its requirements, design and optional information throughout its life . See more
- SCM (Software Configuration Management)
- HCM (Hardware Configuration Management)
What is kernel paging?
- Ideally, kernel will put all its routine inside the memory, so that they could be fetched quickly which they are called. But sometimes the memory does not have enough space, so the kernel will swap part of the services to hard drive, and fetches them if they are needed.
Microcontroller, Peripherals, Hardware
Explain successive approximation in ADC.
Answere
Converts analog to digital by binary search on comparator output.
Sensors output range higher than ADC input?
Answere
Use a divider or amplifier with proper scaling so output fits ADC range.
How to connect more sensors than ADC channels?
Answere
Use analog multiplexer or I/O expanders.
Why use EEPROM over flash?
Answere
EEPROM supports more write cycles and byte-wise erase/write; flash is page-wise.
What is pull-up resistor value for I2C?
Answere
Typical 4.7 kฮฉ for 5V and 10 kฮฉ for 3.3V.
Why SPI faster than I2C?
Answere
SPI is full-duplex with separate clock; I2C is half-duplex and clock-stretched.
What is interrupt latency?
Answere
Time between interrupt occurrence and ISR execution.
What is a watchdog timer?
Answere
A timer resets the MCU if it isnโt periodically refreshed.
C Language and Memory
Difference between int *const ptr and int const *ptr?
โ int *const ptr: pointer is const; int const *ptr: value is const.
What is a void pointer?
โ A generic pointer; can hold address of any data type.
What happens if you do ptr++ on void pointer?
โ Error in strict C (no size), must cast before arithmetic.
strcpy() vs strncpy()?
โ strncpy() allows specifying max number of chars; strcpy() copies until null.
Stack vs heap?
โ Stack is for local vars/functions; heap is for dynamic allocation.
volatile vs const?
โ volatile: value may change externally; const: cannot change in code.
What is padding in structures?
โ Compiler adds unused bytes to align data members.
#pragma pack usage?
โ Controls structure alignment and packing.
What is dangling pointer?
โ Pointer to freed or invalid memory.
strlen() vs sizeof()?
โ strlen() returns string length; sizeof() returns buffer size.
Bitwise Operators & Operators
Toggle a bit?
โ val ^= (1 << bit);
Check bit status?
โ if (val & (1 << bit)) { /* bit set */ }
Shift left and right?
โ a << 2 multiplies by 4; a >> 2 divides by 4.
?: conditional operator?
โ cond ? val_if_true : val_if_false;
Protocols and Communication
What is the max number of devices on 7-bit I2C?
โ 2^7 = 128 addresses.
What is 10-bit I2C?
โ Extended addressing supports up to 2^10 = 1024 devices.
AT+CMGS=? meaning?
โ GSM query for allowed parameters for sending SMS.
GSM and controller interface?
โ Uses UART; send AT commands and wait for OK responses.
RTOS and SDLC
What is RTOS?
โ Real-Time OS provides deterministic task scheduling.
SDLC waterfall vs agile?
โ Waterfall: sequential; Agile: iterative and incremental.
Debugging and Tools
What is ICSP?
โ In-Circuit Serial Programming โ to program microcontroller directly.
Role of debugger?
โ Step through code, check registers, breakpoints.
Memory optimization techniques?
โ Use smaller data types, const for read-only data, place in flash, optimize algorithms.
Example Project Q&A
How to handle more than 14 sensors on 14-channel ADC?
Multiplex or switch using analog multiplexer.
Why ground is important in UART?
Common reference level is required for data integrity.
What is bit-banging?
Manually toggling GPIO pins in software to emulate a serial protocol.
GPIO pin set
#include<stdio.h>
int GPIO_Mode(int pin,int mode)
{
int pin_val = (1<<pin);
printf("pin_val : %X\n",pin_val); //0000 00001 0000 0010
pin_val |= pin_val;
printf("pin_val : %X",pin_val); //0000 00001 0000 0010
//printf("%d", pin_val);
}
int main()
{
GPIO_Mode(10,1);
return 0;
}
Difference between 8-bit and 16-bit MCU?
8-bit processes 8 bits per cycle; 16-bit can process larger data faster.
Why EEPROM over flash?
EEPROM supports fine-grained read/write with higher endurance.
More Interview Questions
Function
- What is a function?
- A block of reusable code that performs a specific task.
- Function syntax?
return_type name(parameters) { /* code */ }
- Function declaration/prototype?
return_type name(parameters);
- Function call?
name(arguments);
- Function parameters?
- Values passed into a function.
- Function return statement?
return value;returns a value to the caller.
- Array to function?
- Pass array as parameter, e.g.
func(int arr[]).
- Pass array as parameter, e.g.
Pointer
- Pointer?
- Variable storing address of another variable.
- Address-of operator (&)?
- Gives the address of a variable.
- Value-of operator (*)?
- Dereferences pointer to get value.
- Pointer to pointer?
- A pointer that holds address of another pointer.
- Pointer types?
null,wild,void,dangling.
- Function pointer?
- Pointer to a function address.
Preprocessor
- Preprocessor commands?
- Statements starting with
#, like#include,#define.
- Statements starting with
- Total preprocessor commands?
- 11 standard commands.
Macro
- What is a macro?
- Preprocessor directive to replace code before compilation.
- Macro function?
- Macro that looks like a function (
#define SQR(x) ((x)*(x))).
- Macro that looks like a function (
Structure
- What is structure?
- User-defined data type grouping variables.
- Structure padding?
- Adding extra bytes for alignment.
- Structure packing?
- Removes padding (
#pragma pack).
- Removes padding (
Union
- Union?
- Shares one memory region for all its members.
Structure vs Union
- Difference?
- Structure allocates separate memory per member; union shares one block.
String
- Find length without strlen?
- Loop till
'\0'.
- Loop till
- strlen vs sizeof?
strlen: chars till'\0';sizeof: buffer size.
- String memory allocation?
- In data segment if global, stack if local.
Swapping
- With bitwise operator?
a ^= b; b ^= a; a ^= b;
- With third variable?
temp=a; a=b; b=temp;
Typecast
- What is typecast?
- Convert one data type to another (
(int)float_var).
- Convert one data type to another (
Memory Allocation
- Text segment?
- Holds program instructions.
- Data segment?
- Holds initialized global/static vars.
- BSS segment?
- Holds uninitialized globals.
- Heap?
- Memory for dynamic allocation (
malloc).
- Memory for dynamic allocation (
- Stack?
- Memory for local vars and function calls.
- Static allocation?
- Fixed at compile time.
- Dynamic allocation?
malloc(),calloc(),realloc(),free().
Little vs Big Endian
- Little Endian?
- LSB at lower address.
- Big Endian?
- MSB at lower address.
Static Analysis Tool checks
- Checks for:
- Buffer overruns, null pointers, memory leaks, unused vars, unsafe functions.
Microcontroller & Microprocessor
- 8-bit controller?
- CPU processes 8 bits per cycle.
- Harvard vs Von Neumann?
- Harvard: Separate instruction/data buses.
- Von Neumann: Shared instruction/data bus.
- CISC vs RISC?
- CISC: Complex instructions.
- RISC: Simple instructions.
- Microcontroller vs Microprocessor?
- Microcontroller: CPU+RAM+Peripherals on one chip.
- Microprocessor: Requires external RAM/ROM.
Shift Operators
- Left shift (
<<) and right shift (>>)?- Multiply or divide by powers of 2.
Array allocation using pointer?
- Syntax?
int *ptr = malloc(n * sizeof(int));
Project-Related
- Explain project?
- Overview of hardware and software components.
- ADC working?
- Converts analog to digital signal.
- Sensors use?
- Convert physical parameters to electrical signals.
- Input/output of sensors?
- Input: physical parameter. Output: analog/digital signal.
- UART communication?
- Serial async data transfer with TX/RX.
- Timer working?
- Counts clock pulses to generate delay or events.
- Timer vs counter?
- Timer: Counts clock ticks; Counter: Counts external events.
- Timer interrupt?
- Interrupt triggered on timer overflow.
Standards & Networking
- C-Standard for static analysis?
- MISRA-C or C99/C11 often used.
- Multicast in Ethernet?
- One sender to multiple receivers.
- Inline function?
- Compiler expands code at the call site.
- Symbol table?
- Compiler’s table of variables/functions and addresses.
- Symbol in C?
- Name representing a variable, function, etc.
C
- Find the structure’s base address using one of the member’s addresses. (ex container_of macro)
- Multiply by 15 using bitwise operator (without addition and multiplication)
- How the volatile keyword works?
- Bit swapping
- Wild pointer and Dangling Pointer
- Storage class
- Write one function to copy data from source memory to destination memory. And Destination address falls into the region of source memory.
- How the negative numbers stored
- Flexible Array member in structure
Communication
- I2C Arbitration and Clock Stretching
- How clock works when more than one master sending clock to slave?
- How master communicates when multiple slaves has same address?
- I2c vs SPI
- What are all the modes in SPI?
- How the data is transferred in UART?
- How they are checking data error in UART?ย
Micro Controller
- NVIC and ISR
- Return value of ISR
- PC, SP, LR
- ARM boot sequence
- How functions are getting called?
- Weak function?
RTOS
- Deadlock
- Mutex
- Priority Inversion and its work around
- Context switch and preemption
- Mutex vs semaphore
- How scheduler works
Refer Website :
- www.careerride.com/embedded-systems-interview-questions.aspx
- https://career.guru99.com/top-18-embedded-systems-interview-questions/
- http://ryf123.blogspot.com/2012/02/embedded-system-interview-question.html
- https://ryf123.blogspot.com/2012/02/embedded-systems-interview-questions.html
- https://aticleworld.com/embedded-c-interview-questions-2/
NEXT
| C Quiz and Interview Questions |
| Embedded Interview Questions |
| I2C Interview Question |
| UART Interview Questions |
| SPI Interview Questions |
| ESP8266 Resource |
| MQTT Interview Questions |
You must be logged in to post a comment.