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/
Contents
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?
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
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 |
ISR Interview Question
Interview Question Chapter–1
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.
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 |