Embedded Systems Questions
Embedded Systems Questions
NOTE: A variable is not only associated with a data type, its value but also a
storage class.
There are total four types of standard storage classes. The table below
represents the storage classes in 'C'.
The variables defined using auto storage class are called as local variables.
Auto stands for automatic storage class. A variable is in auto storage class by
default if it is not explicitly specified.
The scope of an auto variable is limited with the particular block only. Once
the control goes out of the block, the access is destroyed. This means only
the block in which the auto variable is declared can access it.
Extern stands for external storage class. Extern storage class is used when we
have global functions or variables which are shared between two or more
files.
The variables defined using an extern keyword are called as global variables.
These variables are accessible throughout the program. Notice that the
extern variable cannot be initialized it has already been defined in the
original file. E.g:- extern void display();
The static variables are used within function/ file as local static variables.
They can also be used as a global variable
Static local variable is a local variable that retains and stores its value
between function calls or block and remains visible only to the
function or block in which it is defined.
Static global variables are global variables visible only to the file in
which it is declared.
Keep in mind that static variable has a default initial value zero and is
initialized only once in its lifetime.
You can use the register storage class when you want to store local variables
within functions or blocks in CPU registers instead of RAM to have quick
access to these variables. For example, "counters" are a good candidate to
be stored in the register.
It is similar to the auto storage class. The variable is limited to the particular
block. The only difference is that the variables declared using register storage
class are stored inside CPU registers instead of a memory. Register has faster
access than that of the main memory.
The variables declared using register storage class has no default value.
These variables are often declared at the beginning of a program.
main() {
int *ptr=&weight ;/*it produces an error when the compilation occurs ,we
cannot get a memory location when dealing with CPU register*/}
What are little endian and big endian types of storage? How can you identify which type of allocation
a system follows?*.
What is the size of the int, char and float data types?*.
Explain Scope of static variables?*.Explain what are the different qualifiers in C?*
What are the advantages and disadvantages of using macro and inline functions?*
What is ISR? Can they be passed any parameter and can they return a value?*.
What typecast is applied when we have a signed and an unsigned int in an expression?*.
What is the order of calling for the constructors and destructors in case of objects of inherited
classes?*.
a=7; b=8; x=a++-b; printf(“%d”, x ); What does this code give asoutput?*.What is the role of segment
register?*.
What is pass by value and passby reference? How are structure passed as arguments?*.
What does malloc do? What will happen if we have a statement like malloc(sizeof(0));*.
What is the difference between embedded systems and the system in which rtos is running?*.
Explain Operations involving unsigned and signed? Unsigned will be converted to signed?*.
Explain what is the difference between embedded systems and the system in which RTOS is running?
*.
Can we use semaphore or mutex or spin lock in interrupt context in linux kernel?*
How to implement a fourth order Butterworth LP filter at 1kHz if sampling frequency is 8kHz?*.
Write a constant time consuming statement lot finding out If a given number Is a power of 2
C & C Puzzles
1. CISC Vs RISC
2. Harvard vs Von Neuman Architecture
3. Flynn’s Taxonomy
4. DMA VS Polling vs Interrupts
5. I/O mapped I/O vs Memory Mapped I/O
6. Virtual Memory
7. Pipeline
8. Instruction Level Parallelism, Thread Level Parallelism.
9. Superscalar Architecture, VLIW Architecture, EPIC Architecture, SMT and Multi-
core
10. RAM Vs ROM
11. Various Addressing modes in 8086
12. What are interrupts? Types of interrupts?
13. What is ISR?
14. What is return type of ISR?
15. Can we use any function inside ISR?
16. Can we use printf inside ISR?
17. Can we put breakpoint inside ISR?
18. What is interrupt latency?
19. Types of Cache mapping.
20. what is Snooping Cache?
21. Watchdog Timer
22. Brown out Reset (COP Timer), Power On Reset
23. DRAM/ SDRAM Controller
24. e-Flash Controller
25. Interrupt Controller
26. Timers
27. DMA Controller
Operating System/ Real Time Concepts
1. I2C
2. SPI
3. CAN
4. LIN
5. UART
6. Bluetooth(Bluetooth Low Energy)
7. Ethernet
8. IEEE 802.11
9. ZigBee
10. PCI
11. LORA
12. Zwave
13. LTE
Analog & Digital Design Concepts – FPGA/ASIC
1. Questions from your project. How did you connect that particular sensor to the
board? Any protocol? Clock frequency of the used controller? pinouts of the
sensors?
2. Why did you choose that controller for your project and why not the other
one?
3. How will you debug a program?
4. What to do if your software in the SoC hangs?
5. Use of JTAG?
6. In-System Programming?
7. How do you use Oscilloscope, Logic Analyzer, Spectrum Analyser,
CANanalyzer?
8. Difference between a BIOS and UEFI boot process?
9. Difference between a PC Boot and Smartphone boot?
10. Writing portable code in C.
11. How do you make inline assembly code in C?
12. Explain how shared memory works? (A good candidate will know details like
why pointers are stored as offsets and how to protect memory regions using
semaphores. )
13. What happens on a system call? (A good answer will include a description of
processor interrupts and how the hardware handles them, scheduling
decisions, marshaling parameters, etc. (For embedded programmers a question
dealing with concurrent operations can be substituted.)
14. How would you read in a string of unknown length without risking buffer
overflow?
15. What is ABI/API?
If you want to impress the interviewer, try writing two solutions for C puzzles. 1. Most
obvious and simple solution and 2. Obfuscated C code
Hardware
Processor
Memory
Timers
I/O circuits
System application specific circuits
Software
It ensures the availability of System Memory
It checks the Processor Speed availability
The need to limit power lost when running the system continuously
Real Time Operating System
It runs a process as per scheduling and do the switching from one process to
another
3) Mention how I/O devices are classified for embedded system?
The I/O devices of embedded system are classified into two categories
With embedded system, it is possible to replace dozens or even more of hardware logic
gates, input buffers, timing circuits, output drivers, etc. with a relatively cheap
microprocessor.
Microprocessor is managers of the resources (I/O, memory) which lie outside of its
architecture
Microcontroller have I/O, memory, etc. built into it and specifically designed for control
DMA address deals with physical addresses. It is a device which directly drives the data
and address bus during data transfer. So, it is purely physical address.
Interrupt latency is a time taken to return from the interrupt service routine post
handling a specific interrupt. By writing minor ISR routines, interrupt latency can be
reduced.
10) Mention what are buses used for communication in embedded system?
13) Explain what is the need for an infinite loop in embedded systems?
Embedded systems require infinite loops for repeatedly processing or monitoring the
state of the program. For instance, the case of a program state continuously being
verified for any exceptional errors that might just happen during run-time such as
memory outage or divide by zero, etc.
14) List out some of the commonly found errors in Embedded Systems?