Top 10 Embedded Systems Interview Questions & Answers
Preparing for an embedded systems interview means knowing both theory and practical applications. Below are the top questions with clear explanations, plus coding examples or diagrams to strengthen your preparation.
1. What is an Embedded System?
An embedded system is a dedicated computing solution designed for specific tasks inside a larger device. It combines hardware (processor, memory, and peripherals) with software, often working under real-time constraints.
Example:
A microwave oven controller uses an embedded system to manage heating, display, and timing functions.
[ User Input ] → [ Embedded Controller ] → [ Heating & Display Control ]
2. Difference between Microcontroller and Microprocessor
- Microcontroller: CPU + Memory + Peripherals in one chip (e.g., STM32, PIC).
- Microprocessor: CPU only; requires external memory and peripherals (e.g., Intel i5).
Example Table:
| Feature | Microcontroller | Microprocessor |
|---|---|---|
| Integration | High | Low |
| Applications | IoT, appliances | PCs, servers |
| Cost | Low | High |
3. What are Interrupts and Why are They Important?
Interrupts stop the main program temporarily to handle urgent tasks via an ISR.
Example in C:
ISR(TIMER1_COMPA_vect) {
// Code to execute on interrupt
}
Real-world use: A temperature sensor sends an interrupt when overheating is detected.
4. What is an RTOS and Why is it Used?
An RTOS ensures predictable and timely task execution—ideal for time-critical systems.
Example Task Scheduling Diagram:
Task A → Task B → Task C → Repeat
(Each task runs within a fixed time slot)
Sample RTOS Code:
xTaskCreate(Task1, "LED Task", 1000, NULL, 1, NULL);
vTaskStartScheduler();
5. Purpose of volatile Keyword
volatile prevents compiler optimizations for variables that may change unexpectedly.
Example in C:
volatile int flag = 0;
This ensures the compiler always reads the latest value of flag.
6. What is a Watchdog Timer?
A watchdog timer resets the system if the software hangs.
Example in C (STM32 HAL):
IWDG->KR = 0xAAAA; // Refresh watchdog
If the refresh is missed, the system reboots automatically.
7. What is Memory-Mapped I/O?
Peripherals are assigned memory addresses for CPU access.
Example Address Mapping:
0x4000_0000 → GPIO Port A
0x4000_0400 → GPIO Port B
The CPU can write to these addresses to control hardware.
8. Difference Between I²C and SPI
- I²C: 2 wires, multiple devices, slower.
- SPI: 4 wires, faster, full-duplex.
Example Diagram:
I²C: Master → SDA/SCL → Multiple Slaves
SPI: Master → MOSI/MISO/SCLK/SS → Slave
9. What is a Circular Buffer?
A buffer that wraps around when full, useful for streaming data.
Example in C:
buffer[head] = data;
head = (head + 1) % BUFFER_SIZE;
10. What is a Real-Time Clock (RTC)?
An RTC keeps accurate date and time even without power (battery-backed).
Example Use Case: Logging sensor readings with timestamps.
Quick Reference Table
| # | Topic | Key Takeaway |
|---|---|---|
| 1 | Embedded System | Dedicated function device |
| 2 | Microcontroller vs. Microprocessor | Integrated vs. separate CPU |
| 3 | Interrupts | Quick event handling |
| 4 | RTOS | Predictable scheduling |
| 5 | volatile | Prevents unwanted optimization |
| 6 | Watchdog Timer | Auto system reset |
| 7 | Memory-Mapped I/O | Access peripherals like memory |
| 8 | I²C vs. SPI | Speed vs. wiring |
| 9 | Circular Buffer | Continuous data handling |
| 10 | RTC | Maintains time |




Leave a Reply