Skip to main content

Embedded Interview questions 2

 

1. What is embedded system?

Explanation: An embedded system combines computer software and hardware designed to perform a specific function. Embedded systems can also function within a more extensive system or machine. They can be programmable or have a fixed functionality. Some examples of an embedded system are Industrial machines, consumer electronics, agricultural and processing industry devices, automobiles, mobile devices, etc.

2. Mention the essential components of the embedded system?

Explanation: An embedded system has the following essential components for working of its hardware:

  • Power Supply: The power supply is the essential part of an embedded system circuit.
  • Processor: A processor is the main brain inside an embedded systems=.
  • MemoryMemory is used to store data and instructions in an embedded system.
  • Timers: These are the counters.
  • Communication Ports.
  • Input and Output.
  • Application-Specific Circuits.

 

Embedded system software: Softwares in an embedded system are a set of codes written to carry out various/specific functions. Most embedded system software runs on micro-controllers. It checks on the availability of System Memory and Processor Speed.

Real-Time Operating System (OS): It runs a process as scheduled and performs switching from one process to another as and when required.

3. What is a real-time embedded system?

Explanation: Computer systems that monitor, respond to, or control an external environment are called real-time embedded systems. Actuators, sensors, and input-output interfaces connect this environment to the computer system.

4. What are microcontrollers?

Explanation: In an embedded system, a microcontroller is a small integrated circuit that governs a specific operation. On a single chip, a microcontroller contains a CPU, memory, and input/output (I/O) peripherals. A microcontroller is a self-sufficient system that may be used as an embedded system.

You can also read 8051 Microcontroller Pin Diagram here.

5. What are the differences between a microcontroller and a microprocessor?

Explanation: Here are the differences between Microprocessor and Microcontroller.

Microprocessor

Microcontroller

Microprocessors are the heart of any Computer system.Microcontrollers are the heart of any embedded system.
It is just a processor, so I/O and memory components are connected externally.Microcontrollers have a processor along with I/O and internal memory components.
I/O and memory are connected externally, so the internal circuit becomes complex.I/O and memory are present, and the internal circuit is small.
We can’t use it in compact systemsWe can use it in compact systems.
The cost for the entire system is highThe cost for the entire system is low
Total power consumption is high.Total power consumption is less.

6. What is the DMA address? And what does it deal with?

Explanation: Direct memory access (DMA) is speeding up memory operations by allowing an input/output (I/O) device to send or receive data directly to or from the main memory, bypassing the CPU.

DMA addresses deal with physical addresses. During data transfer, it is a device that directly drives the data and address bus. As a result, it's only a physical address.

7. What is interrupt latency? How to reduce it?

Explanation: The period between when an interrupt/process is triggered and when the interrupt handler begins to execute is known as interrupt latency. This is hardware-dependent and cannot be improved in software for a single isolated interrupt.

However, If a lower priority interrupt is triggered while a higher priority interrupts handler is active, the lower priority one will start later, increasing the interrupt latency. In this scenario, reducing interrupt handler execution time reduces the interrupt latency for equal or lower priority interruptions.

8. What are the buses used for communication in an embedded system?

Explanation: The buses used for communication in embedded systems include

  • I2C (Inter-Integrated Circuit) is used to communicate between numerous integrated circuits (ICs).
  • CAN (Controller Area Network) is a network protocol that's utilized in cars with a centrally controlled network.
  • USB (Universal Serial Bus) is a standard for communicating between a computer's processor and peripheral devices such as a mouse.

9. Explain the need for an infinite loop in an embedded system?

Explanation: For repeated processing or monitoring of the program's state, embedded systems require endless loops. Consider the example of a program that is constantly checked for any unusual mistakes that may occur during runtime, such as memory outage or dividing by zero, etc.

10. What is a semaphore?

Explanation: In a concurrent system, such as a multiprogramming operating system, a semaphore is an abstract data type or variable used to regulate access to a shared resource by many processes. Semaphores are used for two main purposes.

  • To be able to share a common recollection
  • To grant others access to files

11.  What are some applications of an embedded system?

Explanation: The following are the applications of embedded systems:

  • Using a speed-checker device, detect reckless driving on highways and alert traffic officials.
  • Control street lights and detect vehicle movement on highways.
  • A density-based traffic signal system regulates signal timing at intersections based on traffic density.
  • Using a GPS modem, determine the exact location of a car.
  • For a home automation system with a remote control based on an Android application.

12. What is a real-time embedded system?

Explanation: A real-time embedded system is a computer system that monitors, responds to, or controls external environments.

13. What are the uses of a timer?

Explanation: The various uses of timers in embedded systems are as follows:

  • It is the RTC (Real-Time Clock) for the system
  • It initiates an event after a provided time delay.
  • It captures the count value of an event.
  • It finds the time interval between any two events.
  • It reduces the time spent on various processes/tasks.
  • It schedules tasks in RTOS

14. What is a Watchdog timer?

Explanation: A watchdog timer is an electronic device dedicated to a specific operation after a specified time if anything goes wrong with the system.

15. What are some common errors in an Embedded system?

Explanation: Some of the common errors encountered in an embedded system are as follows:

  • Data lines malfunctioning.
  • Some memory locations become inaccessible.
  • Address line malfunctioning due to a short in the circuit.
  • Damage to memory devices.
  • Wrong control signals.

16. State the differences between a mutex and a semaphore?

Explanation: The differences between a mutex and a semaphore are listed below in the table:

MUTEXES 

SEMAPHORES 

It is only released by the acquired thread. It can be signalled by another thread or process.  
Mutexes have a known owner. The thread owner is not known. 
It provides a deadlock-free mutual exclusion. It is a synchronization tool that can overcome that critical section problem. 
They are binary semaphores. Their states are locked or unlocked. Semaphores are counter locks. 

17. What is a recursive function?

Explanation: The technique of repeating objects in a self-similar manner is known as recursion. A recursive call of the function occurs when a program permits you to call a function inside another function.

18. What are memory leaks?

Explanation: A memory leak is a resource leak that occurs when a computer software poorly controls memory allocations, preventing memory from being freed that is no longer needed. When an item is saved in memory but cannot be accessible by the running code, this is known as a memory leak.

19. What is the automotive embedded system?

Explanation: An automotive embedded system is a computer system that can act as a control system for electronic devices that affects the mechanism of the automobile or its data.

20. What is an embedded C?

Explanation: Embedded C is an extended version of the C programming language. We can use it to develop applications based on micro-controllers like device drivers (WIFI device drivers, Camera device drivers, etc.)

21. What causes segmentation fault error in embedded C?

Explanation: A segmentation fault error in embedded C is a runtime issue that can occur for a variety of reasons.

  • It's possible that a pointer doesn't have a proper address or memory location to point to.
  • If the user tries to access a memory location that is read-only.
  • If the user tries to release a memory that has already been freed (through a pointer).

22. Why do we use a ‘volatile’ keyword in embedded C?

Explanation: The volatile keyword prevents the compiler from doing any optimizations on objects that can change in ways that the compiler cannot predict. Objects marked as volatile are not optimized because their values can be modified at any time by code outside the scope of the present function.

23. What are Soft and Hard real-time systems?

Explanation: A hard-real-time system is one in which missing even a single deadline can result in total or catastrophic system failure.

A soft real-time system is one in which one or more failures to reach the deadline are not seen as complete system failures, but rather as decreased performance.

24. What are the various levels of testing in an embedded system?

Explanation: We have four levels of testing in an embedded system:

  • Unit testing.
  • Integration testing.
  • System testing.
  • User acceptance testing.

25. What are the phases of the Software Development Life Cycle?

Explanation: The software development life cycle is divided into five stages:

  • Customer Requirement: During this phase, the customer fills out a requirement form in which they write down exactly what they require from the product.
  • Analysis: The requirements are transformed into documents in this phase, which include all of the functional requirement specifications.
  • Design: During this phase, the product's design is finalised. The requirements are translated into a design for architecture. The following items are included in this phase:
    a.) Design Documentation at the Lowest Level (LLD)
    b.) Design Documentation at a High Level (HLD)
  • Coding: The requirements are transformed into a coded form during this phase.
  • Testing: During this phase, the software under development is put to the test to ensure that it is of high quality. There are two forms of this:
    a.) Testing in a static environment
    b.) Testing in a dynamic environment
  • Maintenance: During this phase, the product's maintenance is carried out.

26. What is software quality assurance?

Explanation: Software testing and quality assurance refer to the software development process:

  • Improving and monitoring the process
  • Ensuring that procedures and standards are followed
  • Ensuring that the problems are found and corrected or rectified.

27. What is equivalence partitioning?

Explanation: Equivalence partitioning means designing a test case to detect the error in a group or a class.

28. What are some common testing tools for embedded systems?

Explanation: Some common testing tools for embedded systems are:

  • QTP (Quick Test Professional)
  • LoadRunner
  • WinRunner
  • Silk Test
  • TestDirector

29. In embedded systems, how does a combination of functions minimise memory requirements?

Explanation: The amount of code that needs to be dealt with is decreased, which reduces overhead, and redundancy is removed if the functions have anything in common.

Another feature that is optimised is memory allocation, and it makes sense to group a set of functions that are related in some way as a single unit rather than having them distributed across the programme.

30. How does using a local variable's address lead to less-than-optimal code?

Explanation: Register allocation is the compiler's most effective optimization. That is, it uses the register to manipulate the variable before using a memory.
Local variables are often assigned in registers. The compiler won't assign a local variable to a register, though, if we take its address.

With this, we come to an end for the top embedded interview questions and answers.

Comments

Popular posts from this blog

Questions

1. What is a Stub function? Ans : A function without any definition which presents no error when called. 2. Why there are two ld scripts generated by STM32Cube IDE? Ans: The CubeIDE always presents two different LDscripts on for generating the executable for Debugging which goes to RAM another for normal code upload that goes to flash memory. 3. What is Supervisory Mode/ privileged mode ? Ans : When you are using a Kernel then there are two modes user mode and privileged mode. In User mode the applications cant have system calls. 4. What is "make -j6" ? Ans : Make has an argument for number of jobs, so when you add -j6 it will create 6 different compiler instances, so that the systems could use multicore to the fullest.  Linux people generally do add "-j $(nproc)" where nproc is a command line which returns number of processors attached. 5. What is weak attribute ? Ans : Weak attribute used to denote weak symbols which helps linkers to choose one function out of mul...

#@$%

  #include  "msp430x21x2.h"     #define PWM_OUTPUT              0x03 #define DUTY_CYCLE              TA0CCR2 #define MAX_LIMIT               300   /* #define no_of_samples           1 #define duty_cycle_limit        1000 #define temp_sensor             0xA000   #define panel_selection_cutoff  250 */ #define PV_VOLTAGE              INCH_0 #define PV_CURRENT              INCH_1 #define BATT_VOLTAGE            INCH_2 #define BATT_CURRENT            INCH_3   #define UPPER_CRG_LVL           0x0105 // 0x00FF // 0x00F5 //0x023A #define LOWER_CRG_LVL   ...

Preparing for embedded systems interview

  Preparing for a technical interview in embedded systems involves a wide range of topics, as the field encompasses both hardware and software components. Here are some key areas and example questions that you might encounter in such an interview: Basic Concepts and Theory: What is an embedded system? Can you explain the difference between a microprocessor and a microcontroller? Describe the various types of memory in an embedded system. Programming and Software Design: 4. How do you write an interrupt service routine in C? 5. Explain the concept of a real-time operating system (RTOS). How does it differ from a general-purpose operating system? 6. What are the different states of a thread in an RTOS? Hardware and Interfacing : 7. How does SPI communication work? What about I2C communication? 8. Explain the concept of GPIO (General-Purpose Input/Output). How would you use it in an embedded application? 9. What are interrupts, and how are they handled in embedded systems? Low-Level P...