questions-interviews.com

Interview Questions and Answers, Frequently Asked Questions (FAQs) and Useful Articles

Home  >> Interview Questions and Answers  >> Engineering  >> Electrical Engineering Interview Questions and Answers

Interview Questions & Answers


Electrical Engineering Interview Questions and Answers


This page contains the collection of Electrical Engineering Interview Questions and Answers / Frequently Asked Questions (FAQs) under category Engineering. These questions are collected from various resources like informative websites, forums, blogs, discussion boards including MSDN and Wikipedia. These listed questions can surely help in preparing for Electrical Engineering interview or job.

Page 1 Page 2 Next >>

What is the difference between a Verilog task and a Verilog function?
The following rules distinguish tasks from functions:
A function shall execute in one simulation time unit;
a task can contain time-controlling statements.
A function cannot enable a task;
a task can enable other tasks or functions.
A function shall have at least one input type argument and shall not have an output or inout type argument;
a task can have zero or more arguments of any type.
A function shall return a single value; a task shall not return a value.

Given the following Verilog code, what value of "a" is displayed?
Given the following Verilog code, what value of "a" is displayed?
always @(clk) begin
a = 0;
a <= 1;
$display(a);
end


This is a tricky one! Verilog scheduling semantics basically imply a four-level deep queue for the current simulation time:

1: Active Events (blocking statements)
2: Inactive Events (#0 delays, etc)
3: Non-Blocking Assign Updates (non-blocking statements)
4: Monitor Events ($display, $monitor, etc).

Since the "a = 0" is an active event, it is scheduled into the 1st "queue". The "a <= 1" is a non-blocking event, so it's placed into the 3rd queue. Finally, the display statement is placed into the 4th queue.
Only events in the active queue are completed this sim cycle, so the "a = 0" happens, and then the display shows a = 0. If we were to look at the value of a in the next sim cycle, it would show 1.

Given the following snipet of Verilog code draw out the waveforms for clk?
Given the following snipet of Verilog code, draw out the waveforms for clk and a
always @(clk) begin
a = 0;
#5 a = 1;
end


10 30 50 70 90 110 130
___ ___ ___ ___ ___ ___ ___
clk ___| |___| |___| |___| |___| |___| |___| |___


a ___________________________________________________________


This obviously is not what we wanted, so to get closer, you could use
"always @ (posedge clk)" instead, and you'd get


10 30 50 70 90 110 130
___ ___ ___ ___ ___ ___ ___
clk ___| |___| |___| |___| |___| |___| |___| |___

___ ___
a _______________________| |___________________| |_______

What is the difference between the following two lines of Verilog code?
What is the difference between the following two lines of Verilog code?
#5 a = b;
a = #5 b;


#5 a = b; Wait five time units before doing the action for "a = b;".
The value assigned to a will be the value of b 5 time units hence.

a = #5 b; The value of b is calculated and stored in an internal temp register.
After five time units, assign this stored value to a.

What is the difference between:
c = foo ? a : b;
and
if (foo) c = a;
else c = b;

The ? merges answers if the condition is "x", so for instance if foo = 1'bx, a = 'b10, and b = 'b11, you'd get c = 'b1x.
On the other hand, if treats Xs or Zs as FALSE, so you'd always get c = b.

Using the given, draw the waveforms for the following versions of a?
Using the given, draw the waveforms for the following versions of a (each version is separate, i.e. not in the same run):
reg clk;
reg a;

always #10 clk = ~clk;

(1) always @(clk) a = #5 clk;
(2) always @(clk) a = #10 clk;
(3) always @(clk) a = #15 clk;

Now, change a to wire, and draw for:

(4) assign #5 a = clk;
(5) assign #10 a = clk;
(6) assign #15 a = clk;

What is the difference between running the following snipet of code on Verilog vs Vera?
What is the difference between running the following snipet of code on Verilog vs Vera?

fork {
task_one();
#10;
task_one();
}

task task_one() {
cnt = 0;
for (i = 0; i < 50; i++) {
cnt++;
}
}

Write the code to sort an array of integers?
/* BEGIN C SNIPET */

void bubblesort (int x[], int lim) {
int i, j, temp;

for (i = 0; i < lim; i++) {
for (j = 0; j < lim-1-i; j++) {

if (x[j] > x[j+1]) {
temp = x[j];
x[j] = x[j+1];
x[j+1] = temp;

} /* end if */
} /* end for j */
} /* end for i */
} /* end bubblesort */

/* END C SNIPET */

Some optimizations that can be made are that a single-element array does not need to be sorted; therefore, the "for i" loop only needs to go from 0 to lim-1. Next, if at some point during the iterations, we go through the entire array WITHOUT performing a swap, the complete array has been sorted, and we do not need to continue. We can watch for this by adding a variable to keep track of whether we have performed a swap on this iteration.

Write the code for finding the factorial of a passed integer. Use a recursive subroutine?
// BEGIN PERL SNIPET

sub factorial {
my $y = shift;
if ( $y > 1 ) {
return $y * &factorial( $y - 1 );
} else {
return 1;
}
}

// END PERL SNIPET

In C, explain the difference between the & operator and the * operator?
& is the address operator, and it creates pointer values.
* is the indirection operator, and it preferences pointers to access the object pointed to.

Example:
In the following example, the pointer ip is assigned the address of variable i (&i). After that assignment, the expression *ip refers to the same object denoted by i:

int i, j, *ip;
ip = &i;
i = 22;
j = *ip; /* j now has the value 22 */
*ip = 17; /* i now has the value 17 */

Write a function to determine whether a string is a palindrome (same forward as reverse, such as "radar" or "mom")
/* BEGIN C SNIPET */

#include

void is_palindrome ( char *in_str ) {
char *tmp_str;
int i, length;

length = strlen ( *in_str );
for ( i = 0; i < length; i++ ) {
*tmp_str[length-i-1] = *in_str[i];
}
if ( 0 == strcmp ( *tmp_str, *in_str ) ) printf ("String is a palindrome");
else printf ("String is not a palindrome");
}

/* END C SNIPET */

Write a function to output a diamond shape according to the given (odd) input?
Examples: Input is 5 Input is 7


* *
*** ***
***** *****
*** *******
* *****
***
*


### BEGIN PERL SNIPET ###
for ($i = 1; $i <= (($input * 2) - 1); $i += 2) {
if ($i <= $input) {
$stars = $i;
$spaces = ($input - $stars) / 2;
while ($spaces--) { print " "; }
while ($stars--) { print "*"; }
} else {
$spaces = ($i - $input) / 2;
$stars = $input - ($spaces * 2);
while ($spaces--) { print " "; }
while ($stars--) { print "*"; }
}
print "n";
}
### END PERL SNIPET ###

Given the following FIFO and rules, how deep does the FIFO need to be to prevent underflowing or overflowing?
Given the following FIFO and rules, how deep does the FIFO need to be to prevent underflowing or overflowing?
RULES:
1) frequency(clk_A) = frequency(clk_B) / 4
2) period(en_B) = period(clk_A) * 100
3) duty_cycle(en_B) = 25%



Assume clk_B = 100MHz (10ns)

From (1), clk_A = 25MHz (40ns)

From (2), period(en_B) = 40ns * 400 = 4000ns, but we only output for 1000ns, due to (3), so 3000ns of the enable we are doing no output work.

Therefore, FIFO size = 3000ns/40ns = 75 entries.

Explain the differences between "Direct Mapped", "Fully Associative", and "Set Associative" caches
If each block has only one place it can appear in the cache, the cache is said to be direct mapped. The mapping is usually (block-frame address) modulo (number of blocks in cache).
If a block can be placed anywhere in the cache, the cache is said to be fully associative.
If a block can be placed in a restricted set of places in the cache, the cache is said to be set associative. A set is a group of two or more blocks in the cache. A block is first mapped onto a set, and then the block can be placed anywhere within the set. The set is usually chosen by bit selection; that is, (block-frame address) modulo (number of sets in cache). If there are n blocks in a set, the cache placement is called n-way set associative.

Design a four-input NAND gate using only two-input NAND gates
Basically, you can tie the inputs of a NAND gate together to get an inverter, so...

Draw the state diagram for a circuit that outputs?
Draw the state diagram for a circuit that outputs a "1" if the aggregate serial binary input is divisible by 5. For instance, if the input stream is 1, 0, 1, we output a "1" (since 101 is 5). If we then get a "0", the aggregate total is 10, so we output another "1" (and so on).

We don't need to keep track of the entire string of numbers - if something is divisible by 5, it doesn't matter if it's 250 or 0, so we can just reset to 0. So we really only need to keep track of "0" through "4".

Which of the following documents is non-statutory?
* a) Health and Safety at Work Act
* b) Electricity at Work Regulations
* c) COSHH
* d) BS 7671- Requirements for Electrical Installations

Answer � d

Prior to using an electric saw on a construction site, a user check finds that the insulation on the supply flex is damaged. The correct procedure would be to
* a) Replace the cord with a new one
* b) Report the damage to a supervisor after use
* c) Repair the cord with insulation tape
* d) Report the damage to a supervisor before use

Answer � d

When carrying out repairs to the base of a street lighting column it is essential to wear
* a) A safety harness
* b) High visibility clothes
* c) Gauntlets
* d) High voltage clothing

Answer � b

First aid points are indicated using signs bearing a white cross on a
* a) Yellow background
* b) Blue background
* c) Red background
* d) Green background

Answer � d

The type of fire extinguisher, which would not be suitable for flammable liquids, is
* a) Dry powder
* b) Water
* c) Carbon dioxide
* d) Foam

Answer � b

CO2 fire extinguishers are indicated by the color code
* a) Black
* b) Red
* c) Beige
* d) Blue

Answer � a

An independent regulatory body responsible for monitoring standards of electrical installation contractors is the
* a) Electrical Institute Council
* b) Institute of Electrical Engineers
* c) National Electrical Contractors Institute Inspection Council
* d) National Inspection Council for Electrical Installation Contractors

Answer � d

To ensure that a particular item of electro technical equipment meets a particular British Standard or BSEN Harmonized Standard, the best source of information would be the
* a) manufacturer of the equipment
* b) British Standards Institute
* c) Institute of Electrical Engineers
* d) Supplier of the equipment

Answer � a

Using a scale of 1:50, a 10 mm measurement taken from a plan would be equal to an actual measurement of
* a) 5 mm
* b) 5 cm
* c) 0.5 m
* d) 5 m

Answer � c

The Tesla is the unit of
* a) Magnetic flux
* b) Molecular flux
* c) Magnetic flux density
* d) Molecular flux density

Answer � c

A single rotation of an alternator, intended to provide a 50 Hz supply frequency, will take
* a) 2 ms
* b) 20 ms
* c) 50 ms
* d) 5000 ms

Answer � b

An increase in current through a conductor will lead to
* a) A decrease in conductor temperature
* b) A decrease in conductor resistance
* c) An increase in insulation resistance
* d) An increase in conductor temperature

Answer � d

Four resistors having values of 2 O, 2 O, 5 O, and 20 O are connected in a parallel circuit arrangement. The total resistance of this circuit is
* a) 0.8 O
* b) 1.25 O
* c) 29 O
* d) 400 O

Answer � a

Where P = V I. The value V can be determined using
* a) V = _I_P
* b) V = P I
* c) V = P - I
* d) V = _P_I

Answer � d

A mass of 20 kg is to be raised by a hoist 2 m in 30 seconds. Assuming no losses, the power required to raise this load is
* a) 13.08 Watts
* b) 196.2 Watts
* c) 392.4 Watts
* d) 1200 Watts

Answer � a

The white or grey PVC outer layer of a twin and CPC flat thermoplastic (PVC) cable is the
* a) conductor
* b) Insulation
* c) Conductor
* d) Sheath

Answer � d

The purpose of a bonding conductor is to provide
* a) An earth fault path
* b) An equal potential zone
* c) Short circuit protection
* d) Overload protection

Answer � b

A 110 V, centre-tapped earth, reduced low voltage supply for power tools provides a voltage of
* a) 25 V between live conductors
* b) 55 V to earth
* c) 110 V to earth
* d) 12 V SELV

Answer � b

A particular extension lead used on a construction site is colored yellow to
* a) Indicate its mechanical stress properties
* b) Enable it to be seen in the dark
* c) Indicate the supply voltage to it
* d) Enable it to be to be identified as suitable for site use

Answer � c

The five main stages of the risk assessment procedure are:
* a) Identify
* b) Evaluate
* c) Record
* d) Implement
* e) Review

Answer � b

The order in which they should be carried out is
* a) 1, 3, 2, 4, 5
* b) 1, 2, 3, 4, 5
* c) 2, 1, 4, 3, 5
* d) 2, 3, 1, 4, 5

Answer � a

Before any work is done within an electrical installation, the first procedure would be to
* a) Carry out a risk assessment
* b) Turn off the main switch
* c) Remove all components
* d) Install temporary supplies

Answer � c

On a large construction site, inductions are carried out for new members of staff in order to inform them of the
* a) Location of the canteen
* b) Requirements within BS 7671
* c) Fire safety procedure
* d) Location of the nearest wholesaler

Answer � d

A suitable means of recording the number of visitors on a large construction site is by the use of a
* a) Day work sheet
* b) Timesheet
* c) Take off sheet
* d) Visitors book

Answer � d

In order to prove safe isolation of an electrical circuit, it is essential to use
* a) A multi-meter
* b) An insulation resistance tester
* c) An approved voltage indicator
* d) A low reading ohmmeter

Answer � c

In order to determine the amount of accessories required for a particular contract, the best method would be to use the layout drawings and a
* a) Site diary
* b) Take off sheet
* c) Day work sheet
* d) Time sheet

Answer � b

The ratio of the true power to apparent power in an ac circuit is the
* a) Power consumption
* b) Harmonic current
* c) Power factor
* d) Reactive power

Answer � c

Which of the following is a transmission voltage?
* a) 400 kV
* b) 33 kV
* c) 400 V
* d) 230 V

Answer � a

If a circuit protective device requires 200 A in order to disconnect in the required time, the overall impedance of the earth fault path for a 230 V circuit protected by the device must not exceed
* a) 0.86 O
* b) 1.15 O
* c) 2.15 O
* d) 2.30 O

Answer � b

Which of the following is a non-statutory regulation?
* a) Electricity at Work Regulations
* b) Health and Safety at Work Act
* c) Electricity Safety, Quality, and Continuity Regulations
* d) BS 7671- Requirements for Electrical Installations

Answer � d

For a drawing having a scale of 1:50, a wall 10 m long would be drawn to a length of
* a) 10 mm
* b) 20 cm
* c) 50 cm
* d) 10050 mm

Answer � b

The maximum operating temperature for a thermoplastic (pace) insulated cable with copper conductors is
* a) 60 OC
* b) 70 OC
* c) 105 OC
* d) 160 OC

Answer � b

A circuit wired in 1.5 mm2 thermoplastic (PVC) twin with CPC cable is protected by a 16 A device and is used to supply a 230 V 3 kW water heater. If the cable has a rated voltage drop of 29 mV/A/m and the circuit is 24 m long, the actual voltage drop will be
* a) 2.08V
* b) 9.07V
* c) 11.14V
* d) 69V

Answer � b

A non-maintained emergency light is classified as NM3. This means that the luminary will illuminate during
* a) Normal conditions then automatically switch off after three hours
* b) Any power failure for up to three hours
* c) Both normal and power failure conditions then automatically switch off after three hours
* d) Power failures that last longer than three hours but not shorter than three hours

Answer � b

An earthing arrangement that has a PEN conductor is
* a) TN-C-S
* b) TN-S
* c) TT
* d) IT

Answer � a

A residual current device will disconnect under
* a) short circuit conditions only
* b) Both earth fault and short circuit conditions
* c) Earth fault conditions only
* d) Overload conditions only

Answer � c

The most suitable item of equipment to mark a straight line in order to install a horizontal conduit over a distance of 4 m is a
* a) Plumb line
* b) Spirit level
* c) Steel tape
* d) Chalk line

Answer � d

A 50 mm x 50 mm steel trunking has a tabulated space factor of 1037. If the tabulated factor for PVC cable having a cross sectional area of 6 mm2 is 21.2, the maximum number of these cables that can be installed into the trunking is
* a) 47
* b) 48
* c) 49
* d) 50

Answer � b

The four electrical tests that should be carried out on a new ring final circuit before it is energized are
* a) Continuity of protective conductors, continuity of ring final circuits, insulation, - resistance and polarity
* b) Continuity of ring final circuits, insulation resistance, polarity, and earth fault loop - impedance
* c) Insulation resistance, polarity, earth fault loop impedance and continuity of protective - conductors
* d) Polarity, earth fault loop-impedance, continuity of protective conductors and Continuity of ring final circuits

Answer � a

Top     
Page 1 Page 2 Next >>