Embedded Systems Interview Questions for Engineering freshers Basics Guide
http://ingenuitydias.blogspot.com/2015/06/embedded-systems-interview-questions.html
How are macros different from inline functions?
Macros are normally used whenever a set of instructions/tasks have to be repeatedly performed. They are small programs to carryout some predefined actions.We normally use the #define directive in case we need to define the values of some constants so in case a change is needed only the value can be changed and is reflected throughout.
#define mul(a,b) (a*b)
The major disadvantage of macros is that they are not really functions and the usual error checking and stepping through of the code does not occur.
Inline functions are expanded whenever it is invoked rather than the control going to the place where the function is defined and avoids all the activities such as saving the return address when a jump is performed. Saves time in case of short codes.
Macros are normally used whenever a set of instructions/tasks have to be repeatedly performed. They are small programs to carryout some predefined actions.We normally use the #define directive in case we need to define the values of some constants so in case a change is needed only the value can be changed and is reflected throughout.
#define mul(a,b) (a*b)
The major disadvantage of macros is that they are not really functions and the usual error checking and stepping through of the code does not occur.
Inline functions are expanded whenever it is invoked rather than the control going to the place where the function is defined and avoids all the activities such as saving the return address when a jump is performed. Saves time in case of short codes.
inline float add(float a,float b)
{
{
return a+b;
}
}
Inline is just a request to the compiler and it is upto to the compiler whether to substitute the code at the place of invocation or perform a jump based on its performance algorithms.
What could be the reasons for a System to have gone blank and how would you Debug it?
Possible reasons could be,PC being overheated.Dust having being accumulated all around.CPU fans not working properly .Faulty power connections.Faulty circuit board from where the power is being drawn.Support Drivers not having being installed.Debugging steps which can be taken are:Cleaning the system thoroughly and maintaining it in a dust free environment.Environment that is cool enough and facilitates for easy passage of air should be ideal enough.By locating the appropriate support drivers for the system in consideration and having them installed.
Model transformations And Interaction Semantics
Interrupt DMA and Watchdog Timer
Mutexes Vs Semaphores
Explain interrupt latency and how can we decrease it?
Interrupt latency basically refers to the time span an interrupt is generated and it being serviced by an appropriate routine defined.,usually the interrupt handler.External signals,some condition in the program or by the occurrence of some event,these could be the reasons for generation of an interrupt.Interrupts can also be masked so as to ignore them even if an event occurs for which a routine has to be executed.Following steps could be followed to reduce the latency isrs being simple and short.Interrupts being serviced immediately Avoiding those instructions that increase the latency period.Also by prioritizing interrupts over threads.Avoiding use of inappropriate APIs.
How to create a child process in linux?
Prototype of the function used to create a child process is pid_t fork(void);Fork is the system call that is used to create a child process. It takes no arguments and returns a value of type pid_t. If the function succeeds it returns the pid of the child process created to its parent and child receives a zero value indicating its successful creation.
On failure, a 1 will be returned in the parent's context, no child process will be created, and errno will be set.The child process normally performs all its operations in its parents context but each process independently of one another and also inherits some of the important attributes from it such as UID, current directory, root directory and so on.
Explain Significance of watchdog timer in Embedded Systems.
What could be the reasons for a System to have gone blank and how would you Debug it?
Possible reasons could be,PC being overheated.Dust having being accumulated all around.CPU fans not working properly .Faulty power connections.Faulty circuit board from where the power is being drawn.Support Drivers not having being installed.Debugging steps which can be taken are:Cleaning the system thoroughly and maintaining it in a dust free environment.Environment that is cool enough and facilitates for easy passage of air should be ideal enough.By locating the appropriate support drivers for the system in consideration and having them installed.
Model transformations And Interaction Semantics
Interrupt DMA and Watchdog Timer
Mutexes Vs Semaphores
Explain interrupt latency and how can we decrease it?
Interrupt latency basically refers to the time span an interrupt is generated and it being serviced by an appropriate routine defined.,usually the interrupt handler.External signals,some condition in the program or by the occurrence of some event,these could be the reasons for generation of an interrupt.Interrupts can also be masked so as to ignore them even if an event occurs for which a routine has to be executed.Following steps could be followed to reduce the latency isrs being simple and short.Interrupts being serviced immediately Avoiding those instructions that increase the latency period.Also by prioritizing interrupts over threads.Avoiding use of inappropriate APIs.
How to create a child process in linux?
Prototype of the function used to create a child process is pid_t fork(void);Fork is the system call that is used to create a child process. It takes no arguments and returns a value of type pid_t. If the function succeeds it returns the pid of the child process created to its parent and child receives a zero value indicating its successful creation.
On failure, a 1 will be returned in the parent's context, no child process will be created, and errno will be set.The child process normally performs all its operations in its parents context but each process independently of one another and also inherits some of the important attributes from it such as UID, current directory, root directory and so on.
Explain Significance of watchdog timer in Embedded Systems.
Watchdog timer is basically a timing device that is set for predefined time interval and some event should occur during that time interval else the device generates a time out signal. One application where it is most widely used is when the mobile phone hangs and no activity takes place,in those cases watchdog timer performs a restart of the system and comes to the rescue of the users.It is used to reset to the original state whenever some inappropriate events take place such as too many commands being given at the same time or other activities that result in malfunctioning of the GUI.It is usually operated by counter devices.
If you buy some RTOS, what are the features you look for in It ?
Deterministic operating system having guaranteed worst case interrupt latency and context switch times.Documentation providing for the minimum, average, and maximum number of clock cycles required by each system call Interrupt response times should be very minute.Context switch time should be very low.Compatibility with several plugin devices.Overall it should be very reliable.
Why is java mostly used in embedded systems?
Java was mainly designed and conceptualized for code that can work on different platforms without any hassles and also for being secure enough so as to not harm or corrupt other modules of code.Features like exception handling,simple syntax and Automatic Garbage collection all work in its favor as the language for use in ES's.Also that it is widely used in the form of Java applets makes it very popular confining it to the limits of JVM.It is Dynamic in nature.Its use is also being exploited in enterprise systems in the form of J2EE ,J2SE. J2ME in case of mobile applications.
If you buy some RTOS, what are the features you look for in It ?
Deterministic operating system having guaranteed worst case interrupt latency and context switch times.Documentation providing for the minimum, average, and maximum number of clock cycles required by each system call Interrupt response times should be very minute.Context switch time should be very low.Compatibility with several plugin devices.Overall it should be very reliable.
Why is java mostly used in embedded systems?
Java was mainly designed and conceptualized for code that can work on different platforms without any hassles and also for being secure enough so as to not harm or corrupt other modules of code.Features like exception handling,simple syntax and Automatic Garbage collection all work in its favor as the language for use in ES's.Also that it is widely used in the form of Java applets makes it very popular confining it to the limits of JVM.It is Dynamic in nature.Its use is also being exploited in enterprise systems in the form of J2EE ,J2SE. J2ME in case of mobile applications.