Embedded Systems Interview Questions & Answers

3 avg. rating (60% score) - 6 votes

Embedded Systems Interview Questions & Answers

Searching for another job can be so tedious that it can turn into a job itself. If you are expertise in with embedded development tools, debuggers and protocol analyzers then prepare well for the job interviews with to get your dream job. Here's our recommendation to prepare well for the job interview to achieve your career goals in an easy way. Get ready for the embedded interview questions on different topics like Networking and exposure to Wi-Fi Direct (P2P), WPA Supplicant / Hostapd / CAPWAP and Wi-Fi Display / Miracast / any Wi-Fi Application to win in your job search.Wisdom jobs job interview questions page publishes important information for your job search. Follow our embedded systems job interview questions and answers site to get through your job interview in first attempt.

Embedded Systems Interview Questions

Embedded Systems Interview Questions
    1. Question 1. What Is The Difference Between Embedded Systems And The System In Which Rtos Is Running?

      Answer :

      Embedded system is just combination of s/w and h/w that is some embedded system may have os some may not and rtos is an os.

                                                                        OR

      Embedded system can include RTOS and cannot include also. it depends on the requirement. if the system needs to serve only event sequentially, there is no need of RTOS. If the system demands the parallel execution of events then we need RTOS.

    2. Question 2. What Is Pass By Value And Pass By Reference? How Are Structure Passed As Arguments?

      Answer :

      The parameter to a function can be a copy of a value that is represented by variable or can be a reference to a memory space that stores value of variable. The former is referred to as pass by value and the latter is referred to as pass by reference. The difference is that when parameters are passed by value the changes made to the variable value within the function is not reflected in the caller function, but when passed as reference changes are reflected outside the called function. The structures are always passed by reference.

    3. Question 3. What Is Difference Between Using A Macro And Inline Function?

      Answer :

      The macro are just symbolic representations and cannot contain data type differentiations within the parameters that we give. The inline functions can have the data types too defined as a part of them. The disadvantage in using both is that the inclusion of condition checks may lead to increase in code space if the function is called many times.

    4. Question 4. What Is The Volatile Keyword Used For?

      Answer :

      The volatile keyword is used to represent variables that point to memory in other mapped devices. In such a case the value of the variable can be changed outside of a program. The compiler does not do additional optimizations to the code if there is volatile keyword.

    5. Question 5. What Are Hard And Soft Real Time Systems?

      Answer :

      The hard real time systems are the one that depend on the output very strictly on time. Any late response or delay cannot be tolerated and will always be considered a failure. The soft real time systems on the other are not very rigid as the hard real time systems. The performance of the system degrades with the lateness of response, but it is bearable and can be optimized to a certain level for reuse of the result.

    6. Question 6. What Is A Semaphore? What Are The Different Types Of Semaphore?

      Answer :

      The semaphore is an abstract data store that is used to control resource accesses across the various threads of execution or across different processes. There are two types of semaphores:
      • The binary semaphore which can take only 0,1 values. (used when there is contention for a single resource entity). 
      • The counting semaphore which can take incremental values to certain limit (used when number of resources is limited).

    7. Question 7. Write A Constant Time Consuming Statement Lot Finding Out If A Given Number Is A Power Of 2?

      Answer :

      If n is the given number, then the expression (n & (n-1)) = 0 gives the logical output depicting if it is a power of 2 or not, if (n & (n-1) == 0) printf (“The given number is a power of 2”);

    8. Question 8. What Are Recursive Functions? Can We Make Them Inline?

      Answer :

      The recursive functions refer to the functions which make calls to itself before giving out the final result. These can be declared as in-line functions and the compiler will allocate the memory space intended for the first call of the function.

    9. Question 9. What Is The Size Of The Int, Char And Float Data Types?

      Answer :

      The size of the char and int are always dependent on the underlying operating system or firmware. This is limited to the number of address lines in the address bus. The int usually takes up a value of 2 bytes or 4 bytes. The char can take up a space of 1 or 2 bytes. The float data type takes up a value of 4 bytes.

    10. Question 10. What Does Malloc Do? What Will Happen If We Have A Statement Like Malloc(sizeof(0));

      Answer :

      Malloc is the function that is used for dynamically allocating memory to the different variables. The malloc returns a memory pointer of void type (void *). The statement malloc(sizeof(0)) returns a valid integer pointer because sizeof(0) represents the size of memory taken up by the integer value of 0. The memory allocated by memory is not automatically cleaned up by the compiler after execution of the functions and should be cleaned up by the programmer using the free() function.

    11. Question 11. What Is Meant By A Forward Reference In C?

      Answer :

      The forward reference refers to the case when we point an address space of a smaller data type with a pointer of a bigger data type. This can be pictured as allocating memory in single bytes and accessing it with integer pointer as chunks of 4.

    12. Question 12. What Is The Order Of Calling For The Constructors And Destructors In Case Of Objects Of Inherited Classes?

      Answer :

      The constructors are called with base class first order and the destructors are called in the child first order. That is, the if we have 2 levels of inheritance A (base)-> B (inherit 1)-> C (inherit 2) then the constructor A is called first followed by B and C. The C destructor is called first followed by B and A.

    13. Question 13. Explain The Properties Of A Object Oriented Programming Language.

      Answer :

      • Encapsulation: The data that are related to the specific object are contained inside the object structure and hidden from the other entities of the environment.  
      • Polymorphism: The mechanism by which the same pointer can refer to different types of objects, which are basically linked by some generic commonality.
      •  Abstraction: Hiding the data and implementation details from the real objects. The framework of reference is still present to be used by the other objects.
      •  Inheritance: The way to take out the common features and have them as separate object entities only to be reused by the other objects in a modular fashion.

    14. Question 14. What Do You Mean By Interrupt Latency?

      Answer :

      Interrupt latency refers to the time taken for the system to start the handler for the specific interrupt. The time from the time of arrival of interrupt to the time it is being handled.

    15. Question 15. What Typecast Is Applied When We Have A Signed And An Unsigned Int In An Expression?

      Answer :

      The unsigned int is typecast into the signed value.

    16. Question 16. How Are Variables Mapped Across To The Various Memories By The C Compiler?

      Answer :

      The compiler maintains the symbol table which has the related information of all the variable names along with the length of the allocated space, the access unit length for the pointer (type of pointer) and the starting address of the memory space.

    17. Question 17. What Is A Memory Leak? What Is A Segmentation Fault?

      Answer :

      The memory leak refers to the uncleared memory may builds up across lifetime of the process. When it comes to a huge value system stalls its execution due to unavailability of the memory. The segmentation fault on the other hand refers to condition when our program tries to access a memory space that has already been freed up.

    18. Question 18. What Is Isr? Can They Be Passed Any Parameter And Can They Return A Value?

      Answer :

      ISR refers to the Interrupt Service Routines. These are procedures stored at specific memory addresses which are called when certain type of interrupt occurs. The ISRs cannot return a value and they cannot be passed any parameters.

    19. Question 19. A=7; B=8; X=a++-b; Printf("%d", X ); What Does This Code Give As Output?

      Answer :

      The compiler understands the statement expression a--b by taking off as much operators as it makes sense to a variable. So (a++) is taken as a parameter and then the expression becomes 8-8 which in turn gives the x value as 0. Thus the output value is 0.

    20. Question 20. What Are Little Endian And Big Endian Types Of Storage? How Can You Identify Which Type Of Allocation A System Follows?

      Answer :

      The little endian memory representation allocates the least address to the least significant bit and the big endian is where the highest significant bit takes up the least addressed memory space. We can identify the system’s usage by defining an integer value and accessing it as a character.

      int p=0x2; 
      if(* (char *) &p == 0x2) printf (“little endiann”); 
      else printf (“big endiann”);

    21. Question 21. What Is The Scope Of A Function That Is Declared As Static?

      Answer :

      The static function when declared within a specific module is scoped only in that module and can only be accessed from it.

    22. Question 22. What Is The Use Of Having The Const Qualifier?

      Answer :

      The const qualifier identifies a specific parameter or variable as read-only attribute to the function or to the entire program. This can come in handy when we are dealing with static data inside function and in a program.

    23. Question 23. 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?

      Answer :

      The infinite loops are coded in to give a delay or sleep to the program execution for a specific amount of clock ticks. They can be implemented as:

      while(;;); 
      for(); 
      (or) 
      Loop: 
      goto Loop;

    24. Question 24. What Is A 'volatile' Variable?

      Answer :

      Volatile is a keyword to specify the compiler that this variable value can change any time, so compiler should always read its value from its address, and not to use temporary registers to store its value and use in later part of the code. This is especially important to handle the memory mapped registers which are mapped as some variables or structures in embedded systems, such as hardware status registers etc, whose value can be changed anytime, depending on the hardware state.

      Examples of volatile variables are,
      • Hardware registers in peripherals (for example, status registers)
      • Non-automatic variables referenced within an interrupt service routine
      • Variables shared by multiple tasks in a multi-threaded application

    25. Question 25. Can A Volatile Be Constant?

      Answer :

      volatile const a;
      Yes it can be, it means that, it can be changes by hardware state change, but its read only register in hardware, so code should not try to modify it.

    26. Question 26. Can A Pointer Be Volatile ?

      Answer :

      Yes, although this is not very common. An example is when an interrupt service routine modifies a pointer to a buffer.

    27. Question 27. What Is A 'const' Variable?

      Answer :

      In simple terms 'const' means 'read only'. Its value is not changed by any part of the code executed. So compiler can optimize by taking this info, and also it will give warning when user try to change the value of this variable by mistake.

    28. Question 28. Which Is The Best Way To Write Loops?

      Answer :

      The best way is to write count down loops and compiler can generate better machine code for it than the count up loops. In count down at loop termination, it needs to generate one instruction (SUBS), which subtracts as well as check the zero flag, but in count up case it has to add and compare with a constant, which takes two instructions.

    29. Question 29. What Is Loop Unrolling?

      Answer :

      Small loops can be unrolled for higher performance, with the disadvantage of increased codesize. When a loop is unrolled, a loop counter needs to be updated less often and fewer branches are executed. If the loop iterates only a few times, it can be fully unrolled, so that the loop overhead completely disappears.

      int CountBitOne(uint n)
      {     
        int bits = 0;
          while (n != 0)
          {
              if (n & 1) bits++;
              n >> = 1;
          }
        return bits;
      }
       
      int CountBitOne(uint n)
      {
         int bits = 0;
          while (n != 0)
          {
          if (n & 1) bits++;
          if (n & 2) bits++;
          if (n & 4) bits++;
          if (n & 8) bits++;
          n >> = 4;
          }
        return bits;
      }
      

    30. Question 30. How Are Local And Global Variables Are Allocated By Compiler.

      Answer :

      Normally, cpu registers are allocated for local variables, but if the address of that local variable is used by some code, then it won’t allocate register but access from memory, thus result in un-optimized code. Gobal variables always use memory, so access is slower, so always use global only when it is absolutely necessary.

    31. Question 31. Which Is Better A Char, Short Or Int Type For Optimization?

      Answer :

      Where possible, it is best to avoid using char and short as local variables. For the types char and short the compiler needs to reduce the size of the local variable to 8 or 16 bits after each assignment. This is called sign-extending for signed variables and zero extending for unsigned variables. It is implemented by shifting the register left by 24 or 16 bits, followed by a signed or unsigned shift right by the same amount, taking two instructions (zero-extension of an unsigned char takes one instruction).

      These shifts can be avoided by using int and unsigned int for local variables. This is particularly important for calculations which first load data into local variables and then process the data inside the local variables. Even if data is input and output as 8- or 16-bit quantities, it is worth considering processing them as 32bit quantities

    32. Question 32. How To Reduce Function Call Overhead In Arm Based Systems

      Answer :

      •  Try to ensure that small functions take four or fewer arguments. These will not use the stack for argument passing. It will copy into registers.
      •  If a function needs more than four arguments, try to ensure that it does a significant amount of work, so that the cost of passing the stacked arguments is outweighed.
      •  Pass pointers to structures instead of passing the structure itself.
      •  Put related arguments in a structure, and pass a pointer to the structure to functions. This will reduce the number of parameters and increase readability.
      •  Minimize the number of long long parameters, as these take two argument words. This also applies to doubles if software floating-point is enabled.
      •  Avoid functions with a parameter that is passed partially in a register and partially on the stack (split-argument). This is not handled efficiently by the current compilers: all register arguments are pushed on the stack.
      •  Avoid functions with a variable number of parameters. Varargs functions.

    33. Question 33. What Is A Pure Function In Arm Terminology?

      Answer :

      Pure functions are those which return a result which depends only on their arguments. They can be thought of as mathematical functions: they always return the same result if the arguments are the same. To tell the compiler that a function is pure, use the special declaration keyword __pure.

      __pure int square(int x)
      {
          return x * x;
      }

    34. Question 34. What Are Inline Functions?

      Answer :

      The ARM compilers support inline functions with the keyword __inline. This results in each call to an inline function being substituted by its body, instead of a normal call. This results in faster code, but it adversely affects code size, particularly if the inline function is large and used often.

    35. Question 35. Infinite Loops Often Arise In Embedded Systems. How Does You Code An Infinite Loop In C?

      Answer :

      There are several solutions to this question. One is,

      while(1)
      {
      } 

      Other is using for loop, but here things are not pretty clear as to what is going on.

      for(;;)
      {
      }

      Even though both serve the same purpose, its always better to know why you are using the first or second. So when you are asked about such questions you must answer with confidence that both are right, and just matter which way you wish to code it, anyways finally compiler would optimize and generate the same code for it. So don’t ever say, I was taught to do it this way, and so never thought about the other ways.
      There is another way of doing it, i.e. by using goto statement, goto is very basic keyword, which is more like an assembly jump instruction, if one finds more comfortable with goto then possibly he works closely with assembly language, or with FORATN.

      loop:
      ...
      ...
      goto loop;

    36. Question 36. Data Declarations?

      Answer :

      Examples of data declarations:

      a) int a;
      An integer

      b) int *a;
      A pointer to an integer

      c) int **a;
      A pointer to a pointer to an integer

      d) int a[10];
      An array of 10 integers

      e) int *a[10];
      An array of 10 pointers to integers

      f) int (*a)[10];
      A pointer to an array of 10 integers

      g) int (*a)(int);
      A pointer to a function a that takes an integer argument and returns an integer

      h) int (*a[10])(int);
      An array of 10 pointers to functions that take an integer argument and return an integer

    37. Question 37. What Are The Uses Of The Keyword Static?

      Answer :

      •  A variable declared static within the body of a function maintains its value between function invocations .
      • A variable declared static within a module, (but outside the body of a function) is accessible by all functions within that module. It is not accessible by functions within any other module. That is, it is a localized global.
      •  Functions declared static within a module may only be called by other functions within that module. That is, the scope of the function is localized to the module within which it is declared.

    38. Question 38. Accessing Fixed Memory Locations?

      Answer :

      Embedded systems are often characterized by requiring the programmer to access a specific memory location. On a certain project it is required to set an integer variable at the absolute address 0x67a9 to the value 0xaa55. The compiler is a pure ANSI compiler. Write code to accomplish this task.

      This problem tests whether you know that it is legal to typecast an integer to a pointer in order to access an absolute location. The exact syntax varies depending upon one's style. However, I would typically be looking for something like this:

      int *ptr;
      ptr = (int *)0x67a9;
      *ptr = 0xaa55;  
      

      A more obscure approach is:

      *(int * const)(0x67a9) = 0xaa55;

    39. Question 39. Explain What Happens When Recursion Functions Are Declared Inline?

      Answer :

      Inline functions property says whenever it will called, it will copy the complete definition of that function. Recursive function declared as inline creates the burden on the compilers execution. The size of the stack may/may not be overflow if the function size is big.

    40. Question 40. Explain Scope Of Static Variables?

      Answer :

      • Static variables can only be accessed in the files were they are declared.
      • Static variable within the scope of a function store it's values in consecutive calls of that function.
      • Static functions can only be called within the file they are defined.

    41. Question 41. What Is Interrupt Latency?

      Answer :

      Interrupt latency refers to the amount of time between when an interrupt is triggered and when the interrupt is seen by software.

    42. Question 42. Explain Order Of Constructor And Destructor Call In Case Of Multiple Inheritance?

      Answer :

      constructors top-down, destructors bottom-up.
      eg:

      • in parent's constructor
      • in child's constructor
      • in grandchild's constructor
      • in grandchild's destructor
      • in child's destructor
      • in parent's destructor

    43. Question 43. Explain Difference Between Object Oriented And Object Based Languages?

      Answer :

      Object based languages doesn’t support Inheritance where as object oriented supports. c# is a object oriented language because it supports inheritance and asp.net is not a language it is a technology. If the language supports only 3 features i;e (data encapsulation, data abstraction and polymorphism).then it is said to be object based programming language. If the language supports all the 4 features i;e (encapsulation, abstraction, polymorphism and also inheritance ) then it is said to be object oriented programming language.

    44. Question 44. What Are The Advantages And Disadvantages Of Using Macro And Inline Functions?

      Answer :

      Advantage:
      Macros and Inline functions are efficient than calling a normal function. The times spend in calling the function is saved in case of macros and inline functions as these are included directly into the code.
      Disadvantage:
      Macros and inline functions increased the size of executable code.

    45. Question 45. Explain Why Cannot Arrays Be Passed By Values To Functions?

      Answer :

      Because in C when you say the name of the array it means the address of the first element.
      example :

      int a[];
      func (a);
      int func(int a[]);
      

      In this when you call the function by passing the argument a actually &a[0](address of first element) gets passed. Hence it is impossible to pass by value in C.

       

    46. Question 46. Explain What Is Interrupt Latency? How Can We Reduce It?

      Answer :

      Interrupt latency is the time required to return from the interrupt service routine after tackling a particular interrupt. We can reduce it by writing smaller ISR routines.

    47. Question 47. Explain What Are The Different Qualifiers In C?

      Answer :

      1) Volatile:
      A variable should be declared volatile whenever its value could change unexpectedly. In practice, only three types of variables could change:
      ► Memory-mapped peripheral registers
      ► Global variables modified by an interrupt service routine
      ► Global variables within a multi-threaded application

      2) Constant:
      The addition of a 'const' qualifier indicates that the (relevant part of the) program may not modify the variable.

    48. Question 48. Explain What Are The 5 Different Types Of Inheritance Relationship?

      Answer :

      5 level types are as under:

      • single: B derived from A.
      • multilevel: derived from B and B derived from A.
      • multiple: C derived from A and B.
      • Hierarchical: B derived from A and C derived from A.
      • hybrid: combination of above types.

    49. Question 49. Explain What Will This Return Malloc(sizeof(-10))?

      Answer :

      It will return a 4 byte address value.
      Because -10 is a signed integer(varies from compiler to compiler).

    50. Question 50. Explain Can Structures Be Passed To The Functions By Value?

      Answer :

      Yes structures can be passed to functions by value. Though passing by value has two disadvantages:
      1) The charges by the calling function are not reflected.
      2) It’s slower than the pass by reference function call.

    51. Question 51. Explain Can We Have Constant Volatile Variable?

      Answer :

      Const and volatile keywords should not be used together because both are opposite in nature. A variable is declared as "const" means it's value is not able to be changed but if it is declared as "Volatile" then it is not under control.

    52. Question 52. Explain What Are The Different Storage Classes In C?

      Answer :

      Four types of storage classes are there in c.
      1.Auto
      2.Register
      3.Static
      4.Extern or Global

    53. Question 53. Explain What Is Forward Reference W.r.t. Pointers In C?

      Answer :

      Pointer use's to reference to value a into int a=10 to memory add this value and 10 is add p value added this data in memory location for p.

    54. Question 54. How Is Function Itoa() Written In C?

      Answer :

      #include<stdlib.h>
      #include<stdio.h>
      int main()
      {
      int n = 6789;
      char p[20];
      itoa(n,s,10);
      printf("n=%d,s=%s",n,s);
      return 0;
      } 

    55. Question 55. How To Define A Structure With Bit Field Members?

      Answer :

      You can define structure bit field members with Dot operators.

      EXAMPLE:

      #include <stdio.h>
      int main()
      {
      Struct bit_field
      {
      Int x.4; // it allocates only 4 bits to x
      Char C.6; // it allocates only 6 bits to C;
      };
      return 0;
      } 

    56. Question 56. What Is The Difference Between Fifo And The Memory?

      Answer :

      Fifo(First In Last Out) is a memory structure where data can be stored and retrieved (in the order of its entry only). This is a queue,wheras Memory is a storage device which can hold data dynamically or at any desired locations and can be retrieved in any order.

    57. Question 57. Is It Necessary To Start The Execution Of A Program From The Main() In C?

      Answer :

      "Normally you are at liberty to give functions whatever names you like, but "main"' is special - your program begins executing at the beginning of main. This means that every program must have a main somewhere." 

    58. Question 58. What Is An Anti Aliasing Filter? Why Is It Required?

      Answer :

      Anti aliasing filter reduces errors due to aliasing. If a signal is sampled at 8 kS/S, the max frequency of the input should be 4 kHz. Otherwise, aliasing errors will result. Typically a 3.4kHz will have an image of 4.6 khz, and one uses a sharp cut off filter with gain of about 1 at 3.4kHz and gain of about 0.01 at 4.6 kHz to effectively guard against aliasing. Thus one does not quite choose max frequency as simply fs/2 where fs is sampling frequency. One has to have a guard band of about 10% of this fmax, and chooses max signal frequency as 0.9*fs/2.

    59. Question 59. How To Implement A Fourth Order Butterworth Lp Filter At 1khz If Sampling Frequency Is 8 Khz?

      Answer :

      A fourth order Butterworth filter can be made as cascade of two second order LP filters with zeta of 0.924 and 0.383. One can use a bilinear transformation approach for realizing second order LP filters. Using this technique described well in many texts, one can make two second order LP filters and cascade them.

    60. Question 60. Is 8085 An Embedded System?

      Answer :

      its not a embedded system...because it will be a part of a embedded system and it does not work on any software.

    61. Question 61. What Is The Role Of Segment Register?

      Answer :

      In the x86 processor architecture, memory addresses are specified in two parts called the segment and the offset. One usually thinks of the segment as specifying the beginning of a block of memory allocated by the system and the offset as an index into it. Segment values are stored in the segment registers. There are four or more segment registers: CS contains the segment of the current instruction (IP is the offset), SS contains the stack segment (SP is the offset), DS is the segment used by default for most data operations, ES (and, in more recent processors, FS and GS) is an extra segment register. Most memory operations accept a segment override prefix that allows use of a segment register other than the default one.

    62. Question 62. What Type Of Registers Contains An (intel) Cpu?

      Answer :

      Special function registers like accumulator, Program controller(PC),data pointer(DPTR),TMOD and TCON (timing registers),3 register banks with r0 to r7,Bit addressable registers like B.

    63. Question 63. What Is Plc System?

      Answer :

      Programming logical control system.

    64. Question 64. What Is Difference Between Micro Processor & Micro Controller?

      Answer :

      •  Microprocessor is a manager of the resources (I/O, Memory) which lie out-side of its architecture.
      • Micro-controllers have I/O, Memory etc. built into it and specially designed for Control applications.

    65. Question 65. Can We Use Semaphore Or Mutex Or Spin Lock In Interrupt Context In Linux Kernel?

      Answer :

      We cannot sleep in interrupt context so semaphores and mutex can't be used. Spinlocks can be used for locking in interrupt context.

    66. Question 66. Dma Deals With Which Address (physical/virtual Addresses)?

      Answer :

      DMA deals with Physical addresses.

      • Only when CPU accesses addresses it refers to MMU(Memory Management Unit) and MMU converts the Physical address to Virtual address.
      • But, DMA controller is a device which directly drives the data and address bus during data transfer. So, it is purely Physical address. (It never needs to go through MMU & Virtual addresses).
      • That is why when writing the device drivers, the physical address of the data buffer has to be assigned to the DMA.

    67. Question 67. What Is Dirac Delta Function And Its Fourier Transform And Its Importance?

      Answer :

      • Dirac delta is a continuous time function with unit area and infinite amplitude at t=0 the fourier transform of dirac delta is 1.
      • using dirac delta as an input to the system, we can get the system response. it is used to study the behavior of the circuit.
      • we can use this system behavior to find the output for any input.

    68. Question 68. What Is The Difference Between Testing And Verification Of Vlsi Circuit?

      Answer :

      • Verification is a front end process and testing is a post silicon process.
      • Verification is to verify the functionality of the design during the design cycle.
      • Testing is finding manufacturing faults.

    69. Question 69. While Writing Interrupt Handlers (isr), Which Are Points Needed To Be Considered?

      Answer :

      Avoid sleep, use GFP_ATOMIC instead of GFP_KERNEL in kmalloc.

    70. Question 70. Explain Can Microcontroller Work Independently?

      Answer :

      Obviously, it can work independently. But to see the output we need certain output devices like LED, Buzzer can be connected to check its functionality. Without the help of any o/p device connected we can check the functionality of Microcontroller.

    71. Question 71. What Is Watchdog Timer?

      Answer :

      A watchdog timer (or computer operating properly timer) is a computer hardware timing device that triggers a system reset if the main program, due to some fault condition, such as a hang, neglects to regularly service the watchdog. The intention is to bring the system back from the hung state into normal operation.

    72. Question 72. What Is Semaphore?

      Answer :

      In computer science, a semaphore is a protected variable or abstract data type which constitutes the classic method for restricting access to shared resources such as shared memory in a parallel programming environment. A counting semaphore is a counter for a set of available resources, rather than a locked/unlocked flag of a single resource.

    73. Question 73. What Is Mutex?

      Answer :

      Mutual exclusion (often abbreviated to mutex) algorithms are used in concurrent programming to avoid the simultaneous use of a common resource, such as a global variable, by pieces of computer code called critical sections.

    74. Question 74. Can Structures Be Passed To The Functions By Value?

      Answer :

      yes structures can be passed by value. But unnecessary memory wastage.

    75. Question 75. Why Cannot Arrays Be Passed By Values To Functions?

      Answer :

      When a array is passed to a function, the array is internally changed to a ‘pointer’. And pointers are always passed by reference.

    76. Question 76. Advantages And Disadvantages Of Using Macro And Inline Functions?

      Answer :

      Advantage: Macros and Inline functions are efficient than calling a normal function. The times spend in calling the function is saved in case of macros and inline functions as these are included directly into the code.
      Disadvantage: Macros and inline functions increased the size of executable code.

    77. Question 77. Difference In Inline Functions And Macro

      Answer :

      •  Macro is expanded by preprocessor and inline function are expanded by compiler.
      •  Expressions passed as arguments to inline functions are evaluated only once while _expression passed as argument to inline functions are evaluated more than once.
      • More over inline functions are used to overcome the overhead of function calls.
      • Macros are used to maintain the readability and easy maintenance of the code.

    78. Question 78. What Happens When Recursion Functions Are Declared Inline?

      Answer :

      It is illegal to declare a recursive function as inline. Even a function is declared as inline compiler judges it to be inline or not. Many compilers can also inline expand some recursive functions; recursive macros are typically illegal.

    79. Question 79. Scope Of Static Variables?

      Answer :

      Scope of static variable is within the file if it is static global. Scope of static variable is within the function if variable is declared local to a function. But the life time is throughout the program.

    80. Question 80. What Is A Inode?

      Answer :

      In computing, an inode is a data structure on a traditional Unix-style file system such as UFS. An inode stores basic information about a regular file, directory, or other file system object.

    81. Question 81. Explain The Working Of Virtual Memory?

      Answer :

      Virtual memory is a computer system technique which gives an application program the impression that it has contiguous working memory (an address space), while in fact it may be physically fragmented and may even overflow on to disk storage. Systems that use this technique make programming of large applications easier and use real physical memory (e.g. RAM) more efficiently than those without virtual memory.

    82. Question 82. What Is Concurrency? Explain With Example Deadlock And Starvation.

      Answer :

      Concurrency is nothing but execution of different transactions simultaneously on one single resource.
      Dead lock :
      A group of threads are waiting for resources held by others in the group. None of them will ever make progress.
      Example :
      An example of a deadlock which may occur in database products is the following. Client applications using the database may require exclusive access to a table, and in order to gain exclusive access they ask for a lock. If one client application holds a lock on a table and attempts to obtain the lock on a second table that is already held by a second client application, this may lead to deadlock if the second application then attempts to obtain the lock that is held by the first application.
      Starvation :
      A thread may wait indefinitely because other threads keep coming in and getting the requested resources before this thread does. Note that resource is being actively used and the thread will stop waiting if other threads stop coming in.
      Example :
      High priority thread:

      while(1);

      if the system is priority based system then low priority thread never gets a chance.

       

Linux Embedded Systems Tutorial

Embedded Systems Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Linux Embedded systems Tutorial