0% found this document useful (0 votes)
28 views

Embedded Systems Questions

The document discusses storage classes in C programming language. It explains the different types of storage classes - auto, extern, static, and register and their properties like scope, location, lifetime and accessibility of variables. It also provides examples of each storage class.

Uploaded by

Mithul Manoj
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Embedded Systems Questions

The document discusses storage classes in C programming language. It explains the different types of storage classes - auto, extern, static, and register and their properties like scope, location, lifetime and accessibility of variables. It also provides examples of each storage class.

Uploaded by

Mithul Manoj
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

1)What is dirac delta function and its Fourier transform and its importance?

DMA deals with which address (physical/virtual addresses)?*.


2)Why do we need a infinite loop in embedded systems development? What
are the different ways by which you can code in a infinite loop?*.
3)Is it necessary to start the execution of a program from the main() in C?*.
4)Explain what are the different storage classes in C?*.

A storage class represents the visibility and a location of a variable. It tells


from what part of code we can access a variable. A storage class is used to
describe the following things:

 The variable scope.


 The location where the variable will be stored.
 The initialized value of a variable.
 A lifetime of a variable.
 Who can access a variable?

Thus a storage class is used to represent the information about a variable.

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'.

Auto storage class

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.

A keyword auto is used to define an auto storage class. By default, an auto


variable contains a garbage value.

e.g:- auto int b=48;


Extern storage class

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.

Keyword extern is used to declaring a global variable or function in another


file to provide the reference of variable or function which have been already
defined in the original file.

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();

Static storage class

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.

Example: static int count = 10;

Keep in mind that static variable has a default initial value zero and is
initialized only once in its lifetime.

Register storage class

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.

Example: register int age;


The keyword register is used to declare a register storage class. The
variables declared using register storage class has lifespan throughout the
program.

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.

#include <stdio.h> /* function declaration */

main() {

{register int weight;

int *ptr=&weight ;/*it produces an error when the compilation occurs ,we
cannot get a memory location when dealing with CPU register*/}

What is watchdog timer?*.

What are little endian and big endian types of storage? How can you identify which type of allocation
a system follows?*.

Scope of static variables?*.

What is the difference between testing and verification of vlsi circuit?*.

What is the size of the int, char and float data types?*.

What is the difference between a ‘thread’ and a ‘process’?*.

Explain why cannot arrays be passed by values to functions?*.

Explain can microcontroller work independently?

What is interrupt latency?*.

What type of registers containsan (INTEL) CPU?.

Can structures be passed to the functions by value?*.

How to define a structure with bit field members?


what is an anti aliasing filter? Why is it required?*.

Advantages and disadvantagesof using macro and inline functions?*

Explain Scope of static variables?*.Explain what are the different qualifiers in C?*

What are hard and soft Real time systems?*.

How is function itoa() written inC?*.

What is difference between micro processor & micro controller?*.

Explain Order of constructor and destructor call in case of multiple inheritance?*.

Explain What will this return malloc(sizeof(-10))?*.

What do you mean by interrupt latency?*.

What is a semaphore? what arethe different types of semaphore?*.

Explain Can structures be passed to the functions by value?*.

IS 8085 an embedded system?*

What are the advantages and disadvantages of using macro and inline functions?*

Explain What are the 5 differenttypes of inheritance relationship?*.

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?*.

Explain what is interrupt latency?*.

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 Concurrency? Explain with example Deadlock and Starvation.*

Explain the properties of a Object oriented programming language.*

Explain can we have constant volatile variable?*.

What is the difference between embedded systems and the system in which rtos is running?*.

Explain the working of Virtual Memory?*.

What is a memory leak? What is a segmentation fault?*.

While writing interrupt handlers(ISR), which are points needed to be considered?*.

What is the difference between fifo and the memory?*.

Explain what is interrupt latency? How can we reduce it?*.


What is the use of having the const qualifier?*.What is plc system?*.

Explain Operations involving unsigned and signed? Unsigned will be converted to signed?*.

Explain What happens when recursion functions are declared inline?*.

What is the volatile keyword used for?*.

What are recursive functions? Can we make them in line?*.

What is difference between using a macro and a in line function?*.

Explain what is the difference between embedded systems and the system in which RTOS is running?
*.

Explain Difference between object oriented and object based languages?*.

Why cannot arrays be passed by values to functions?*.

Can we use semaphore or mutex or spin lock in interrupt context in linux kernel?*

What is meant by a forward reference in C?*.

ow are variables mapped across to the various memories by the C compiler?

How to implement a fourth order Butterworth LP filter at 1kHz if sampling frequency is 8kHz?*.

What is the scope of a function that is declared as static?*.

Write a constant time consuming statement lot finding out If a given number Is a power of 2

C & C Puzzles

1. C Vs Embedded C vs C++ What is the difference between C and embedded C?


2. C compilation steps
3. Know about “static, global/extern, auto, register, const and volatile” very well.
When do you use static keyword for a global variable?
4. Use of volatile keyword?
5. Know about “structure, union and enum”.
6. What is the difference between Structure and union? Where do we use union?
Structs and Unions and their paddings.
7. Know about basic pointers concepts. Double Pointers. Pointer aliasing, Multiple
indirection.
8. Function pointers and Callback functions
9. Char ptr, int ptr & their sizes? pointer aliasing.
10. Null ptr, void ptr and their uses?
11. malloc vs calloc vs realloc.
12. File operations in linux
13. Typecasting
14. Inline function. Difference between Inline and macro.
15. Preprocessor directives.
16. Bit manipulation - Set, Get, Clear, Toggle, Shift, Display Bits
17. Bit Fields in C
18. Difference between heap and stack? Write a function to figure out if stack
grows up or down.
19. Memory leak
C Program to

1. Reverse bits in a number.


2. Count the number of set bits in a byte/word/dword/qword
3. Swap nibbles in a byte
4. Reverse a string.
5. Print the diagonal elements of a matrix.
6. Strip whitespace from a string in-place.
7. Remove duplicate chars from a string ("AAA BBB" -> "A B")
8. Find the first non-repeating character in a string ("ABCA" -> B)
9. Dynamic Memory allocation of a 2D array
10. Transpose of a Matrix
11. Different ways of swapping two numbers.
12. Find size of a data type without sizeof operator.
13. Find little endian or big endian.
14. prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead
of the number and for the multiples of five print "Buzz". For numbers which are
multiples of both three and five print "FizzBuzz".
Data structures

1. Linked List and its flavors


2. Stack – implementation using arrays and linked list
3. Queue – implementation using arrays and linked list
4. Implement the following functions for a binary tree:
Insert
PrintInOrder
PrintPreOrder
PrintPostOrder
Implement a non-recursive PrintInOrder
Algorithms

1. Know about Time and Space Complexity of basic algorithms


2. Sorting and Searching algorithms.
3. Reverse a linked list, circular linked list
4. To find factorial with and without recursion.
5. To identify the Pythagoras triangle.
6. To identify palindrome.
7. To generate Fibonacci sequence.
8. Find if a linked list has a cycle in it. Now do it without marking nodes (detect
loop in linked list)
9. Find the middle of a linked list. Now do it while only going through the list
once (same solution as finding cycles)
Computer Architecture – Microprocessor, Microcontrollers (8051), ARM, DSP and
other SoC peripherals / Controllers

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. When do you need an OS?


2. When do you need a RTOS?
3. RTOS VS Time Shared OS?
4. Give some examples of GPOS and RTOS.
5. Soft real-time vs Hard real-time
6. What is Real time and what is RTOS?
7. Difference between various kernels. monolithic kernel, micro kernel, nano
kernel, exo kernel, hybrid kernel, resource kernel.
8. What is priority inversion? Why priority inversion occurs and solutions for it?
9. What is priority inheritance?
10. Process vs threads
11. IPC mechanisms
12. Threads- Mutex, semaphore, conditional variables
13. Preemptive vs Non preemptive Scheduling
14. What is scheduling? And its types?
15. What is priority scheduling?
16. What is super loop?
17. Process states
18. Demand paging
19. Kernel
20. Thread
21. What are device-drivers?
22. What are interrupts?
23. What are short-term, medium-term and Long-term Schedulers?
24. What is SMP (Shared Multi-Processing)?
25. What is context switch?
26. What are the information in the PCB?
27. Cpu Bound vs I/O Bound?
28. Memory layout of a process
29. Multithreads
30. Deadlock?
31. Conditions for deadlock?
32. Detecting and avoiding deadlocks?
33. Livelock?
34. Spinlock?
35. Race Condition?
36. Semaphores?
37. Mutex?
38. Binary semaphore vs Count semaphore
39. Semaphore vs Mutex
40. Difference between Mutexes and Critical Sections?
What are Reentrant Locks? Implement a Reentrant Lock with Mutexes.
41. Paging
42. Segmentation
43. Swapping
44. Fragmentation
45. Thrashing
46. What is Top half & bottom half of a kernel?
Linux Concepts

1. Unix Design Philosophy


2. Piping and redirection
3. Linux commands & shell scripting
4. Linux Kernel Stack
5. Boot process
6. Systemd
7. What are different types of shell and why bash?
8. POSIX API. How pthreads are different from RTOS threads?
Communication / DSP / Networking Concepts

1. Sampling, sampling period & sampling rate


2. cut-off frequency
3. Frequency bandwidth
4. Nyquist theorem
5. Aliasing and Anti-aliasing
6. Signal to Noise Ratio
7. Truncation/ rounding
8. Convolution
9. Correlation
10. FFT
11. FIR, IIR Filters
12. OSI Layers
13. TCP/IP Layers
14. Difference between TCP and UDP? When would you want to use one over the
other?
15. Piggybacking
16. ARP
17. DHCP
18. Other basic concepts of Communication
Short range Wireless & On-Chip/Board Communication Protocols

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. Significance of 32.768KHz frequency as clock source?


2. Different Flip flops, Counters.
3. Sequential Circuit, Combinational Circuit.
4. Binary to Octal, Hexadecimal Conversion.
5. What are Fan in and Fan out?
6. What is Tristate logic?
7. What are error levels?
8. Transition times in gate?
9. MUX, DEMUX, Encoder, Decoder
10. Implement some cicuit with transistor and basic opamp concepts.
11. Frequency divider circuit.
12. Draw 200Hz waveform and then draw 50 Hz wave form wid ref to 200Hz.
13. VLSI Design Flow
14. DAC
15. PWM
16. ADC - Bit resolution during conversion.
17. PLL, Op-Amps, Analog MUX.
18. Designing basic gates using NMOS and PMOS.
19. Draw current gain amplifier using BJT and MOSFET.
General

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

1) Explain what is embedded system in a computer system?


An embedded system is a computer system that is part of a larger system or machine. It
is a system with a dedicated function within a larger electrical or mechanical system.

2) Mention what are the essential components of embedded system?

Essential components of embedded system includes

 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

4) Why embedded system is useful?

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.

5) Explain what are real-time embedded systems?


Real-time embedded systems are computer systems that monitor, respond or control an
external environment. This environment is connected to the computer system through
actuators, sensors, and other input-output interfaces.

6) Explain what is microcontroller?

The microcontroller is a self-contained system with peripherals, memory and a processor


that can be used as embedded system.

7) Mention what is the difference between microprocessor and microcontroller?

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

8) What does DMA address will deal with?

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.

9) Explain what is interrupt latency? How can you reduce it?

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?

For embedded system, the buses used for communication includes

 I2C: It is used for communication between multiple ICs


 CAN: It is used in automobiles with centrally controlled network
 USB: It is used for communication between CPU and devices like mouse, etc.
While ISA, EISA, PCI are standard buses for parallel communication used in PCs,
computer network devices, etc.

11) List out various uses of timers in embedded system?

Timers in embedded system are used in multiple ways

 Real Time Clock (RTC) for the system


 Initiating an event after a preset time delay
 Initiating an even after a comparison of preset times
 Capturing the count value in timer on an event
 Between two events finding the time interval
 Time slicing for various tasks
 Time division multiplexing
 Scheduling of various tasks in RTOS
12) Explain what is a Watchdog Timer?

A watchdog timer is an electronic device or electronic card that execute specific


operation after certain time period if something goes wrong with an electronic 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?

Some of the commonly found errors in embedded systems are

 Damage of memory devices static discharges and transient current


 Address line malfunctioning due to a short in circuit
 Data lines malfunctioning
 Due to garbage or errors some memory locations being inaccessible in storage
 Inappropriate insertion of memory devices into the memory slots
 Wrong control signals
 What is the need for an infinite loop in Embedded systems?
 How does combination of functions reduce memory requirements in embedded
systems?
 A vast majority of High Performance Embedded systems today use RISC
architecture why?
 Why do we need virtual device drivers when we have physical device drivers?
 What is the need for DMAC in ES?
 What is Endianness of a system and how do different systems communicate with
each other?
 How are macros different from inline functions?
 What could be the reasons for a System to have gone blank and how would you
Debug it?
 Explain interrupt latency and how can we decrease it?
 How to create a child process in linux?
 Significance of watchdog timer in Embedded Systems
 If you buy some RTOS, what are the features you look for in ?
 Why is java mostly used in embedded systems?
 Differentiate between mutexes vs semaphores
 What are the commonly found errors in Embedded Systems?
 What is the need for having multibyte data input and output buffers in case of
device ports?
 these r some of the questions ,mainly prepare on MICROPROCESSOR AND
MICRO CONTROLLERS

You might also like