Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

Interview MCQ Set 1

1. What is the output of the following code ?

  1. class father:
  2.     def __init__(self, param):
  3.         self.o1 = param
  4.  
  5. class child(father):
  6.     def __init__(self, param):
  7.         self.o2 = param
  8.  
  9. >>>obj = child(22)
  10. >>>print "%d %d" % (obj.o1, obj.o2)

a) None None
b) None 22
c) 22 None
d) Error is generated

View Answer

Answer: d [Reason:] self.o1 was never created.

2. What is the output of the following code ?

  1. class tester:
  2.     def __init__(self, id):
  3.         self.id = str(id)
  4.         id="224"
  5.  
  6. >>>temp = tester(12)
  7. >>>print(temp.id)

a) 224
b) Error
c) 12
d) None

View Answer

Answer: c [Reason:] Id in this case will be the attribute of the class.

3. What is the output of the following code ?

  1. >>>example = "snow world"
  2. >>>print("%s" % example[4:7])

a) wo
b) world
c) sn
d) rl

View Answer

Answer: a [Reason:] Execute in the shell and verify.

4. What is the output of the following code ?

  1. >>>example = "snow world"
  2. >>>example[3] = 's'
  3. >>>print example

a) snow
b) snow world
c) Error
d) snos world

View Answer

Answer: c [Reason:] Strings cannot be modified.

5. What is the output of the following code ?

  1. >>>max("what are you")

a) error
b) u
c) t
d) y

View Answer

Answer: d [Reason:] Max returns the character with the highest ascii value.

6. Given a string example=”hello” what is the output of example.count(l)
a) 2
b) 1
c) None
d) 0

View Answer

Answer: a [Reason:] l occurs twice in hello.

7. What is the output of the following code ?

  1. >>>example = "helle"
  2. >>>example.find("e")

a) Error
b) -1
c) 1
d) 0

View Answer

Answer: c [Reason:] returns lowest index .

8. What is the output of the following code ?

  1. >>>example = "helle"
  2. >>>example.rfind("e")

a) -1
b) 4
c) 3
d) 1

View Answer

Answer: b [Reason:] returns highest index.

9. What is the output of the following code ?

  1. >>>example="helloworld"
  2. >>>example[::-1].startswith("d")

a) dlrowolleh
b) True
c) -1
d) None

View Answer

Answer: b [Reason:] Starts with checks if the given string starts with the parameter that is passed.

10. To concatenate two strings to a third what statements are applicable ?
a) s3 = s1 . s2
b) s3 = s1.add(s2)
c) s3 = s1.__add__(s2)
d) s3 = s1 * s2

View Answer

Answer: c [Reason:] __add__ is another method that can be used for concatenation.

Interview MCQ Set 2

1. What is the output of the following?

i = 0
while i < 5:
    print(i)
    i += 1
    if i == 3:
        break
else:
    print(0)

a) 0 1 2 0
b) 0 1 2
c) error
d) none of the mentioned

View Answer

Answer: b [Reason:] The else part is not executed if control breaks out of the loop.

2. What is the output of the following?

i = 0
while i < 3:
    print(i)
    i += 1
else:
    print(0)

a) 0 1 2 3 0
b) 0 1 2 0
c) 0 1 2
c) error

View Answer

Answer: b [Reason:] The else part is executed when the condition in the while statement is false.

3. What is the output of the following?

x = "abcdef"
while i in x:
    print(i, end=" ")

a) a b c d e f
b) abcdef
c) i i i i i i …
d) error

View Answer

Answer: d [Reason:] NameError, i is not defined.

4. What is the output of the following?

x = "abcdef"
i = "i"
while i in x:
    print(i, end=" ")

a) no output
b) i i i i i i …
c) a b c d e f
d) abcdef

View Answer

Answer: a [Reason:] “i” is not in “abcdef”.

5. What is the output of the following?

x = "abcdef"
i = "a"
while i in x:
    print(i, end = " ")

a) no output
b) i i i i i i …
c) a a a a a a …
d) a b c d e f

View Answer

Answer: c [Reason:] As the value of i or x isn’t changing, the condition will always evaluate to True.

6. What is the output of the following?

x = "abcdef"
i = "a"
while i in x:
    print('i', end = " ")

a) no output
b) i i i i i i …
c) a a a a a a …
d) a b c d e f

View Answer

Answer: b [Reason:] As the value of i or x isn’t changing, the condition will always evaluate to True.

7. What is the output of the following?

x = "abcdef"
i = "a"
while i in x:
    x = x[:-1]
    print(i, end = " ")

a) i i i i i i
b) a a a a a a
c) a a a a a
d) none of the mentioned

View Answer

Answer: b [Reason:] The string x is being shortened by one charater in each iteration.

8. What is the output of the following?

x = "abcdef"
i = "a"
while i in x[:-1]:
    print(i, end = " ")

a) a a a a a
b) a a a a a a
c) a a a a a a …
d) a

View Answer

Answer: c [Reason:] String x is not being altered and i is in x[:-1].

9. What is the output of the following?

x = "abcdef"
i = "a"
while i in x:
    x = x[1:]
    print(i, end = " ")

a) a a a a a a
b) a
c) no output
d) error

View Answer

Answer: b [Reason:] The string x is being shortened by one charater in each iteration.

10. What is the output of the following?

x = "abcdef"
i = "a"
while i in x[1:]:
    print(i, end = " ")

a) a a a a a a
b) a
c) no output
d) error

View Answer

Answer: c [Reason:] i is not in x[1:].

Interview MCQ Set 3

1. What is the output of the following?

print("abc DEF".capitalize())

a) abc def
b) ABC DEF
c) Abc def
d) Abc Def

View Answer

Answer: c [Reason:] The first letter of the string is converted to uppercase and the others are converted to lowercase.

2. What is the output of the following?

print("abc. DEF".capitalize())

a) abc. def
b) ABC. DEF
c) Abc. def
d) Abc. Def

View Answer

Answer: c [Reason:] The first letter of the string is converted to uppercase and the others are converted to lowercase.

3. What is the output of the following?

print("abcdef".center())

a) cd
b) abcdef
c) error
d) none of the mentioned

View Answer

Answer: c [Reason:] The function center() takes atleast one parameter.

4. What is the output of the following?

print("abcdef".center(0))

a) cd
b) abcdef
c) error
d) none of the mentioned

View Answer

Answer: c [Reason:] The entire string is printed when the argument passed to center() is less than the length of the string.

5. What is the output of the following?

print('*', "abcdef".center(7), '*')

a) * abcdef *
b) * abcdef *
c) *abcdef *
d) * abcdef*

View Answer

Answer: b [Reason:] Padding is done towards the left-hand-side first when the final string is of odd length. Extra spaces are present since we haven’t overridden the value of sep.

6. What is the output of the following?

print('*', "abcdef".center(7), '*', sep='')

a) * abcdef *
b) * abcdef *
c) *abcdef *
d) * abcdef*

View Answer

Answer: d [Reason:] Padding is done towards the left-hand-side first when the final string is of odd length.

7. What is the output of the following?

print('*', "abcde".center(6), '*', sep='')

a) * abcde *
b) * abcde *
c) *abcde *
d) * abcde*

View Answer

Answer: c [Reason:] Padding is done towards the right-hand-side first when the final string is of even length.

8. What is the output of the following?

print("abcdef".center(7, 1))

a) 1abcdef
b) abcdef1
c) abcdef
d) error

View Answer

Answer: d [Reason:] TypeError, the fill character must be a character, not an int.

9. What is the output of the following?

print("abcdef".center(7, '1'))

a) 1abcdef
b) abcdef1
c) abcdef
d) error

View Answer

Answer: a [Reason:] The character ‘1’ is used for padding instead of a space.

10. What is the output of the following?

print("abcdef".center(10, '12'))

a) 12abcdef12
b) abcdef1212
c) 1212abcdef
d) error

View Answer

Answer: d [Reason:] The fill character must be exactly one character long.

Interview MCQ Set 4

1. For the given circuit find the output voltage?
linear-integrated-circuits-advanced-questions-answers-q1
a) -5.625v
b) -3.50v
c) -4.375v
d) -3.125v

View Answer

Answer: d [Reason:] The given circuit is a 4-bit R-2R DAC. So, the output voltage Vo=-RF [(b3/2R) +(b2/4R) +(b1/8R)+(b0/16R)] From the circuit, b3=5v, b2=0v, b1=5v, bo=0v. Vo= -20kΩ[(5/2×20kΩ)+0+(5/8×20kΩ)+0]= -3.125v.

2. Which type of switches are not preferable for a simple weighted resistor DAC?
a) Bipolar Transistor
b) Voltage switches
c) MOSFET
d) All of the mentioned

View Answer

Answer: a [Reason:] Bipolar transistor does not perform well as voltage switches and MOSFET, due to the inherent offset voltage when in saturation.

3. The inverted R-2R ladder can also be operated in
a) Inverted mode
b) Current Mode
c) Voltage mode
d) Non inverted mode

View Answer

Answer: b [Reason:] The inverted mode R-2R ladder circuit works on the principle of summing current. Therefore, it is said to operate in current mode.

4. Which of among the following circuit is considered to be linear?
a) Weighted Resistor type DAC
b) R-2R ladder type DAC
c) Inverter R-2R ladder DAC
d) All of the mentioned

View Answer

Answer: c [Reason:] Current remain constant in each branch of ladder in inverted R-2R ladder DAC. So, the constant current implies constant voltage. The ladder mode voltage remain constant even when the input data changes. So, inverter R-2R ladder DAC is considered to be linear.

5. Multiplying DAC uses
a) Varying reference voltage
b) Varying input voltage
c) Constant reference voltage
d) Constant input voltage

View Answer

Answer: a [Reason:] A digital to analog converter which uses a varying reference voltage is called a multiplying D-A converter.

6. Calculate the value of LSB and MSB of a 12-bit DAC for 10v?
a) LSB =7.8mv, MSB =5v
b) LSB =9.3mv, MSB =5v
c) LSB =14.3mv, MSB =5v
d) LSB =2.4mv, MSB =5v

View Answer

Answer: d [Reason:] LSB=1/2n=1/212=1/4096. For 10v range, LSB =10v/4096=2.4mv and MSB = (1/2)×full scale =(1/2)×10v =5v.

7. A multiplying DAC is given a reference voltage VR = Vom cos2πft. Determine the output voltage?
a) Vo(t) = Vom sin(2πft+180o)
b) Vo(t) = Vom cos(2πft+180o)
c) Vo(t) = Vom tan(2πft+180o)
d) Vo(t) = Vom sec(2πft+180o)

View Answer

Answer: b [Reason:] Vo(t) = Vom cos2πft+180o. The 180ophase shift is added, since the VR is connected to inverting input terminal and Vom = 0v to (1-2-n)×Vim depends on the input code.

8. Multiplying digital to analog converters are used in
a) All of the mentioned
b) Digitally programmable filter
c) Digitally programmable oscillator
d) Digitally controlled audio attenuator

View Answer

Answer: d [Reason:] In multiplying DAC, the output voltage is a fraction of the voltage representing the input digital code and the attenuator setting can be controlled by digital logic.

9. A 10-bit D/A converter have an output range from 0-9v. Calculate the output voltage produced when the input binary number is 1110001010.
a) ±7.96v
b) -7.96v
c) 7.96v
d) None of the mentioned

View Answer

Answer: c [Reason:] Vo=9v[(1×1/2)+ (1×1/22) +(1×1/23)+(0×1/24)+(0×1/25)+ (0×1/26)+(1×1/27)+(0×1/28)+(1×1/29)+( 0×1/210)]. =9v×(0.5+0.25+0+0.125+7.8125×10-3+1.95 ×10-3) =9v×0.8547 =7.96v.

10. The basic step of a 8-bit DAC is 12.4mv.If the binary input 00000000 represents 0v. Determine the output, if the input is 101101111?
a) 1.36v
b) 2.27v
c) 5.45v
d) None of the mentioned

View Answer

Answer: b [Reason:] The output voltage for input 10110111 = 12.4mv ×[(1×27)+(0×26) + (1×25) + (1×24) + (0×23)+ (1×22) +(1×21)+ (1×20)] = 12.4 × (128 + 32 + 16 + 4 + 2 + 1) =12.4mv × 183 = 2.27v.

Interview MCQ Set 5

1. Determine the full scale range for the input voltage if the resistance in series with meters are 1kΩ, 2kΩ, 47kΩ and full scale meter movement is 1mA in low voltage AC voltmeter?
a) 1.0 to 7.48 Vrms
b) 1.1 to 7.48 Vrms
c) 1.2 to 7.48 Vrms
d) 1.3 to 7.48 Vrms

View Answer

Answer: b [Reason:] The minimum and maximum values of resistors are 1kΩ and 6.8kΩ.So, the range for the input voltages are Vin(rms)|min = 1.1×R1/Io = (1.1×1kΩ)/1mA =1.1v. Vin(rms)|max =1.1×R1/ Io =(1.1×6.8kΩ)/1mA = 7.48v. Thus, the full scale input voltage ranges from 1.1 to 7.48 Vrms.

2. Determine the current through the diode, when the switch is in position 1, 2& 3. Assuming op-amps initially nulled.
linear-integrated-circuits-tough-questions-answers-q2
a) Io (LED) =4.01mA; Io (Zener) =4.01mA; Io (rectifier) =8.33mA
b) Io (LED) =25mA; Io (Zener) =4.01mA; Io (rectifier) =4.01mA
c) Io (LED) =16.67mA; Io (Zener) =16.66mA; Io (rectifier) =4.01mA
d) Io (LED) =8.33mA; Io (Zener) =8.33mA; Io (rectifier) =8.33mA

View Answer

Answer: d [Reason:] All the diodes are connected one after another in the feedback path. Therefore, current through the diode remains same. Io =Vin/R1 =1.5/180 =8.33mA.

3. A diode match finder circuit has input voltage of 2.6v and output voltage is 5.78v. Calculate the voltage drop across diode 1N4735
a) 2.22v
b) 8.38v
c) 3.18v
d) 15.02v

View Answer

Answer: c [Reason:] The output voltage Vo =Vin+ VD. ∴ the voltage drop across 1N4735, VD =Vo – Vin = 5.78-2.6 =3.18v.

4. Find the voltage drop across the zener diode in the zener diode tester from the given specifications: IZk=1mA, VZ =6.2v, input voltage= 1.2v, output voltage =3.2v and resistance in series with meter =150Ω.
a) 6.2mA
b) 8mA
c) 21.33mA
d) Cannot be determined

View Answer

Answer: a [Reason:] Current through the zener Io=Vin/R1 =1.2v/150Ω =8mA. Since, Io > IZk the voltage across the zero will be approximately equal to 6.2v. As the current is larger than the knee current (IZk) of the zener, it blocks VZ volts.

5. Which among the following is preferred to display device in digital application?
a) Matched zener diode
b) Matched LEDs
c) Matched rectifier diode
d) All of the mentioned

View Answer

Answer: b [Reason:] Matched LEDs with equal brightness at a specific value of current are useful as indicators and display devices in digital applications.

6. The maximum current through the load in all application that uses voltage to current converter with floating is
a) 100mA
b) 75mA
c) 25mA
d) 50mA

View Answer

Answer: c [Reason:] The maximum current through the load cannot exceed the short circuit current of the 741c op-amp which is 25mA.

7. For voltage to current converter with grounded load, establish a relation between the non-inverting input terminals and load current
a) V1 = [Vin+Vo-(IL×R)] /2
b) V1 = [Vin-Vo-(IL×R)] /2
c) V1 = [Vin+Vo-IL+R] /2
d) V1 = [Vin+Vo+(IL×R)] /2

View Answer

Answer: a [Reason:] In the voltage to current converter circuit the relationship between the voltage v1 at the non-inverting input terminal and load is given as V1 = [Vin+Vo-(IL×R)] /2.

8. Find the gain of the voltage to current converter with grounded load?
a) 2
b) 1
c) ∞
d) 0

View Answer

Answer: a [Reason:] In voltage to current converter with grounded load all resistor must be equal in value. ∴ Gain = Vo/Vin = [1+(RF/R1)] = 1+R/R =1+1=2.

9. Find the output voltage and the load current for the circuit given below. Assume that the op-amp is initially nulled V1 =2.5v
linear-integrated-circuits-tough-questions-answers-q9
a) IL=0.42mA, Vo =10v
b) IL=0.42mA, Vo =3.4v
c) IL=0.42mA, Vo =6.1v
d) IL=0.42mA, Vo =5v

View Answer

Answer: d [Reason:] The load current IL =vin /R =5/12kΩ =0.42mA vo =IL×R, can be obtained when Vo=2×V1 = 2×2.5 =5v.