# 200 Embedded and IoT Software Engineering Interview Questions – Part 2 Basics of Electronics

In the last part, we saw briefly about the following

• Questions about the projects you have done and
• Questions from C programming language

You can find the article at the link below

200 Embedded and IoT Software Engineering Interview Questions – Part 1

Let’s see about the Basics of Electronics in this part. Alright, let’s begin!

### Need to learn about electronics

You might wonder why does a software engineer need to learn electronics! That’s the beauty of Embedded software development. Unless you have some knowledge about electronics life as an Embedded Software Engineer will be difficult. Then again you don’t need to know everything that a hardware engineer would know but the basics of how the system you are working with is designed and how it functions is considered a very important skill for embedded software engineers. Okay so now that we know why we need the knowledge, let’s go ahead and see some questions about the basics of electronics.

Again if you would like to do this as a test, then I suggest you stop reading this article and go to this ***link and give me your email, so that I can send you the questions in a pdf format. You can try giving the test and come back here for the answers so that you can score yourselves and identify which areas need more attention!

### Basics of Electronics

#### Difficulty level: Easy

Question #1: Explain ohm’s law

The current passing through a conductor as measured between 2 points is directly proportional to the voltage across those 2 points.

V = I * R

V: Voltage

I: Current

R: Resistance, the constant of proportionality

This is the most basic law of electronics engineering. I hope you are familiar with it already! You can read more about it in this link

Question #2: State Kirchoff’s Voltage Law a.k.a KVL

The algebraic sum of voltages in any closed loop is zero.

Have a look at the simple circuit diagram below.

Here we have a 5V DC voltage source connected to 2 resistors R1 and R2 to make a closed loop. Now if we calculate the voltages across the loop, the power supply is +5V, there is a 2V drop or -2V on Resistor R1 and another 3V drop or -3V across Resistor R2.

Hence the algebraic sum is

5V – 2V – 3V = 0

Thus as Kirchoff’s Voltage Law stated the algebraic sum of voltages on this loop in zero.

Question #3: State Kirchoff’s Current Law

Question #3: State Kirchoff’s Current Law

The sum of currents entering a given node is equal to the sum of the currents leaving the node.

Let’s take another simple circuit with 3 resistors R1, R2, and R3.

Here consider the currents at the node A. There is one incoming current I1 and two outgoing currents I2 and I3.

The sum of currents entering A is I1 = 10mA

The sum of currents leaving A is I2 + I3 = 5mA + 5mA = 10mA.

Thus as KCL stated, the sum of currents entering and leaving node A are the same.

Question #4: What are diodes? Where are they used? What is the symbol of a diode?

A diode is a semiconductor device that passes current in one direction and stops the current in the other direction. They have a lot of applications, examples can include devices like rectifiers that convert AC to DC, and in logic gates.

The symbol of a diode is as shown below.

Question #5: What are the different modes you can use a transistor in? What are the applications of those modes?

Transistors can operate in 4 modes depending on the voltages applied across its terminals

• Forward active mode
• Reverse active mode
• Saturation mode and
• Cut off mode

The saturation and cut-off modes can be used to make the transistor act as a switch.

The active modes can be used to make the transistor act as an amplifier. The forward active mode is the preferred one as it has more gain compared to the reverse active mode.

Question #6: Give the name of the component used to give the clock signal to processors, explain them briefly

Oscillators are used to give clock pulses to processors. These are circuits that take in a DC signal as input and produce AC signals as output.

Typically crystal oscillators which have a piezoelectric crystal like a quartz crystal are used for this purpose.

Question #7: What does low pass filter do? Also, explain high pass filters.

• Low pass filters pass frequencies below the cut-off frequency to pass through and block all higher frequencies.
• High pass filters do the opposite and pass the frequencies greater than or equal to the cut-off frequency.

Question #8: What is the name of the device used to convert real-world analog voltage signals from sensors to digital values?

Question #9: What is the name of the device used to convert digital data in mp3 files into analog sound signals on headphones and speakers?

Answer #9: Digital to Analog Converters a.k.a DACs

Question #10: Name 5 sensors that you have previously used on your projects

A simple list that looks like this will suffice.

• Temperature sensor
• Humidity sensor
• Ultrasonic sensor
• IMU sensor
• Light sensor

Make sure you remember the chip actually used and facts like the resolution of the sensor output and the data rate of the sensor as you can expect some follow up questions on this one!

#### Difficulty level: Medium

Question #1: Draw a simple circuit using diodes to convert AC to DC

Answer #1: Bridge rectifiers can be used to convert AC to DC. The circuit is shown below.

The operation of this circuit is pretty simple. Here when the AC input is applied, during the positive half cycle, Diodes D1 and D3 will conduct and the current will flow through the load resistor from top to bottom.

During the negative half-cycle, diodes D2 and D4 will conduct and the current will flow in the same direction as before from top to bottom on the load resistor. Hence the output current direction remains the same even though the input current direction is reversed thus taking in an AC input voltage and giving a DC output voltage in return.

Question #2: Explain the working of simple RC low pass filters and RC high pass filters.

RC Low Pass Filters

The above is a simple RC low pass filter circuit.

The cut-off frequency can be given by the formula Fcut-off = 1/(2*pi*R*C). At frequencies above this frequency, the capacitor acts as a short circuit and the entire input signal is passed to the ground. At frequencies below this cut-off frequency, the capacitor acts as an open circuit and the signal reaches the output.

As you can see the circuit for the high pass filter is very similar to the low pass filter, except for the fact that the resistor and capacitor positions have been interchanged.

The same formula as above applies here, i.e the cutoff frequency is Fc = 1/(2*pi*R*C). At frequencies above this frequency, the capacitor acts as a short circuit and the entire input signal is passed to the output. At frequencies below this cut-off frequency, the capacitor acts as an open circuit and the signal is blocked from reaching the output.

Question #3: Explain the working of ADC converters

ADC stands for Analog to Digital Converters. These devices can sense the voltage at a given GPIO pin. It takes an analog voltage as input and converts it to a digital number. It does so using a method called sampling and quantization.

As you can see in the pic above the process has 2 stages called sampling and quantization.

In the sampling stage, the voltage is measured in a periodic manner with an interval called the sampling interval. This interval must be greater than 2 times the frequency (a.k.a the Nyquist frequency) of the input signal to avoid aliasing.

In the quantization stage, the analog voltage measured is converted into its digital form to produce the digital number output.

Question #4: Explain how an LC oscillator works

As we saw above, Oscillators are used to give clock pulses to processors. These are circuits that take in a DC signal as input and produce AC signals as output.

Let’s take a simple LC circuit as shown above and learn how to achieve the above-mentioned function.

The steps that produce these oscillations are as follows

1. Switch 1 is turned ON so that loop1 is connected
2. The capacitor charges and stores the energy in the form of an electric field.
3. Switch 1 is turned OFF so that loop1 is open
4. Switch 2 is turned ON so that loop2 is closed.
5. Now the capacitor has a path to discharge across the Inductor and hence it does with the current direction being anti-clockwise.
6. The inductor takes the energy and stores it in a magnetic field. The north pole can either be on top or bottom depending on how the inductor is wound. Let’s assume for our example the north pole is on top.
7. Once the capacitor is completely discharged the magnetic field starts to collapse
8. This collapsing magnetic field starts sending current in the same anti-clockwise direction and this charges the capacitor in the opposite direction with the bottom plate being positive and the top plate being negative.
9. Now once the magnetic field collapse completely, the capacitor starts discharging again making current in the opposite direction i.e the clockwise direction.
10. Now the inductors start storing energy in the magnetic field again but this time the polarity is changed i.e the south pole is at the top and the north pole is at the bottom.
11. Then once the capacitor completely discharges again, the magnetic field starts to collapse and starts charging the capacitor again with the positive plate on top.
12. This then repeats from step 5 again.

Thus a perpetual motion machine is created with the energy flowing back and forth between the capacitor’s electric field and the inductor’s magnetic field.

In ideal conditions with capacitors and inductors and the wires connecting them having zero resistance, this transfer of energy can go on forever till the end of time producing sine wave signals.

Practically though, there will be some energy lost as heat energy and hence the output will start to attenuate. So time to time the battery needs to be connected back using switch1 to supply some energy to the circuit.

This is how a simple LC oscillator works.

Question #5: Solve this circuit for voltage Vx

The above circuit can be solved in 2 steps.

Step#1: Find the total current from the 10V DC source

The net resistance of this circuit is

R = R1 + R2*R3 / (R2 + R3) = 100 + 93.75

R = 193.75 Ω

So the current from the source is V/R = 10/193.75 = 51.61 mA

Step#2: Find the resistance drops across the resistors using Ohm’s law and KVL

The voltage drop across Resistor R1 = 100 ohms * 51.61 mA = 5.161V

Using KVL on the loop containing the Voltage source, R1 and R3 we get voltage drop across R3 to be 10 – 5.161 = 4.839 V

But we know that voltage drop across parallel resistors is the same. If you look closely R2 and R3 are actually in parallel even though they are not drawn that way.

Thus Vx = 4.839 V

Question #6: Solve this circuit for current Ix

This circuit can also be solved in 2 steps, similar to the question above.

Step#1: Find the equivalent resistance of the circuit to get the total current from the source

R = R1 + R2*R3 / (R2 + R3) = 400 + 75 = 475 Ω

Current from the source = V/R = 5/475 = 10.52mA

Step#2: Find the current Ix

Ix = I * R2/(R2+R3) = 10.52 * 300/400 = 7.89mA

Note that to find the current through R3 we use R2 in our formula and to find current across R2 we must use R3 in the formula. This is due to the fact that current is inversely proportional to the resistance! (This formula will only work if on simple nodes where the current gets divided into 2)

Question #7: Give the name of the batteries used in smartphones these days

Answer #7: Lithium-Ion Batteries or Li-ion battery. It has a typical voltage of 3.7V. Don’t worry you will not be expected to know the actual electrochemistry behind the working of this battery..!!

Question #8: Give the name of an upcoming battery technology

You can expect questions like these to test not just your knowledge but your interest in the upcoming technologies and trends!

Graphene batteries have 5 times more energy density as compared to Li-ion battery and it is eco-friendly and low cost. It is expected to take over the market long held by Li-ion batteries in the near future.

For designers, this means that they will be able to make even thinner and lighter devices and for users, it means that we no longer have to carry our chargers around and we can expect smartphones to last for a week easily on a single charge!

Question #9: Give the name of the sensor used to sense and measure linear and rotational movements

The name of such a sensor is the IMU sensor. IMU stands for Inertial Motion Unit. An IMU sensor is a combination of an accelerometer and a gyroscope sensor. It is used to detect movements and measure the intensity of movements in terms of acceleration and rotational speeds.

Question #10: Give the name of the sensor used to measure distance from a surface

The 2 commonly used sensors for measuring the distance include

• Ultrasonic sensors and
• Infrared sensors

Out of these 2, the ultrasonic sensor is more accurate. How it works is it sends out a pulse of an ultrasonic sound wave. This wave will get reflected by the surface (to which we are trying to find the distance from) and comes back to the sensor. We know the speed of sound is 340m/s at sea level and we can calculate the time it takes for the pulse to take a round trip to the surface so using some simple math we can find the distance of the surface from the sensor!

#### Difficulty level: Hard

Question #1: Assume you only have 3 free GPIO’s and you would like to control 8 LEDs using those 3 pins. What electronic device would you use?

Answer #1: Serial to parallel shift registers with a 3 pin input and 8 pin output can be used here to control the 8 LEDs using just 3 GPIO pins

Question #2: Which transistor logic is most famous these days? TTL or CMOS or High-Speed CMOS?

Answer #2: High-Speed CMOS is the latest tech in transistor logic and hence its the most famous these days.

Question #3: Give the name of the sensor used to measure light intensity

Answer #3: Photoresistors can be used to measure the intensity of light. How it works is, we make resistors made up of a material called Cadmium Sulfide which has a property such that it’s resistance changes depending on the intensity of the light it is exposed to.

The ambient light sensors used in smartphones to automatically change the brightness of the display are usually made up of photodiodes, phototransistors or some other light-sensitive integrated circuits.

Question #4: Give a method that can be used to control the speed of dc motors.

Answer #4: Pulse Width Modulation can be used to control the speed of dc motors. By adjusting the duty cycle we can change the average DC voltage levels at the output and hence control the speed of dc motors.

Question #5: Give 4 uses of multimeters for debugging electronics in a PCB

Multimeter to check for

• short and open circuits,
• Measure voltage and current
• Check the values of resistance capacitance and inductance
• Check the polarity of diodes and transistors soldered

Question #6: Where to use an oscilloscope during product development?

Oscilloscopes can be used in several ways during hardware and software development process. The 3 main ways oscilloscopes can help software development are

• To sniff the communication buses like USB, UART, SPI, and I2C so that we can see whether the software does what it’s supposed to do. Here Logic Analysers are a better option as they usually have some software to format the output to just the way we like it.
• To detect hardware issues, for example, if everything is working properly and you did not make any changes to the software, but suddenly it stops working the way it is supposed to work then there is a good chance that the problem might be in hardware. You can use an Oscilloscope to test continuity (multimeters are better options here) or you can have a look at the signals on the board just to verify if the hardware is okay.

Question #7: Take a smartphone and list out its electronic parts into 3 categories input, output and others

Question #8: How is the gain of an amplifier measured?

Answer #8: Gain of any system is the ratio of its output to its input

In the case of amplifiers, if we are interested in voltage gain then

Voltage Gain = Output voltage/ Input Voltage

If we are interested in current gain then

Current Gain = Output current/Input Current

In the case of power amplifiers, the power gain will be

Power gain = Output power/Input Power

Question #9: Explain the parts of a typical power supply circuit

Answer #9: A typical power supply has the following 3 parts

• Step down transformer (if we are using the wall supply)
• Rectifier to change the AC to DC
• A voltage regulator to get the required voltage of either 1.8V or 3.3V or 5V output

Question #10: what are pull up and pull down resistors? explain their use in GPIOs.

Answer #10: A GPIO pin can output either a 1 or a 0. This is achieved by turning on/off the internal pull-up or pull-down resistors.

The pull up resistor is usually connected to the Vcc or 5V and the pull-down resistor is connected to the ground.

Assume there is a switch connecting these resistors to the GPIO pins as shown in the figure.

Now if switch-1 is turned on, the GPIO pin will output a 1 and if switch-0 is turned on the GPIO will output a zero.

So by switching the appropriate switch to ON position we can control the output of the GPIO pin. This is how they are used in GPIO circuits.

These are some basic questions that you can expect at embedded software interviews to test your knowledge and understanding of the electronics that you are going to work with.

In the next part, we will have a look at some questions about microcontrollers.

You can email us or contact us through this link if you have any questions or suggestions. 