Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. If the height of the tree is h > 0, then the minimum number of nodes in the tree is:(A) 2h – 1(B) 2h – 1 + 1(C) 2h – 1(D) 2h

Answer» None
2.

What is the output printed by the following program?#include<stdio.h>int f(int n, int k){if (n == 0)return 0;else if (n % 2)return f(n/2, 2*k) + k;else return f(n/2, 2*k) - k;}int main (){printf("%d", f(20, 1));return 0;}(A) 5(B) 8(C) 9(D) 20

Answer» None
3.

The following C function takes two ASCII strings and determines whether one is an anagram of the other. An anagram of a string s is a string obtained by permuting the letters in s.int anagram (char *a, char *b) {int count [128], j;for (j = 0; j < 128; j++) count[j] = 0;j = 0;while (a[j] && b[j]) {A;B;}for (j = 0; j < 128; j++) if (count [j]) return 0;return 1;}Choose the correct alternative for statements A and B.(A) A : count [a[j]]++ and B : count[b[j]]–(B) A : count [a[j]]++ and B : count[b[j]]++(C) A : count [a[j++]]++ and B : count[b[j]]–(D) A : count [a[j]]++and B : count[b[j++]]–

Answer» None
4.

If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?(A) 6(B) 4(C) 3(D) 2

Answer»
5.

The availability of a complex software is 90%. Its Mean Time Between Failure (MTBF) is 200 days. Because of the critical nature of the usage, the organization deploying the software further enhanced it to obtain an availability of 95%. In the process, the Mean Time To Repair (MTTR) increased by 5 days.What is the MTBF of the enhanced software(A) 205 days(B) 300 days(C) 500 days(D) 700 days

Answer»
6.

In a data flow diagram, the segment shown below is identified as having transaction flow characteristics, with p2 identified as the transaction centerA first level architectural design of this segment will result in a set of process modules with an associated invocation sequence. The most appropriate architecture is(A) p1 invokes p2, p2 invokes either p3, or p4, or p5(B) p2 invokes p1, and then invokes p3, or p4, or p5(C) A new module Tc is defined to control the transaction flow. This module Tc first invokes pl and then invokes(D) A new module Tc is defined to control the transaction flow. This module Tc invokes p2. p2 invokes p1, and then invokes p3, or p4, or p5

Answer»
7.

A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies F1 → F3 F2→ F4 (F1 . F2) → F5In terms of Normalization, this table is in(A) 1 NF(B) 2 NF(C) 3 NF(D) none

Answer»
8.

The circuit shown below implements a 2-input NOR gate using two 2-4 MUX (control signal 1 selects the upper input). What are the values of signals x, y and z?(A) 1, 0, B(B) 1, 0, A(C) 0, 1, B(D) 0, 1, A

Answer»
9.

Q82_Part BA database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table.If, instead of Nested-loop join, Block nested-loop join is used, again with the most appropriate choice of table in the outer loop, the reduction in number of block accesses required for reading the data will be(A) 0(B) 30400(C) 38400(D) 798400

Answer»
10.

Q 82_Part AA database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table.If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer loop, the number of block accesses required for reading the data are(A) 800000(B) 40080(C) 32020(D) 100

Answer»
11.

The shell commandfind -name passwd -printis executed in /etc directory of a computer system running Unix. Which of the following shell commands will give the same information as the above command when executed in the same directory?(A) ls passwd(B) cat passwd(C) grep name passwd(D) grep print passwd

Answer» None
12.

(A) kernel mode(B) superuser mode(C) privileged mode(D) user mode

Answer»
13.

A hardwired CPU uses 10 control signals S1 to S10, in various time steps T1 to T5, to implement 4 instructions I1 to I4 as shown below:Which of the following pairs of expressions represent the circuit for generating control signals S5 and S10 respectively?((Ij+Ik)Tn indicates that the control signal should be generated in time step Tn if the instruction being executed is Ij or lk)(A)S5=T1+I2⋅T3 andS10=(I1+I3)⋅T4+(I2+I4)⋅T5(B) S5=T1+(I2+I4)⋅T3 andS10=(I1+I3)⋅T4+(I2+I4)⋅T5(C) S5=T1+(I2+I4)⋅T3 andS10=(I2+I3+I4)⋅T2+(I1+I3)⋅T4+(I2+I4)⋅T5(D) S5=T1+(I2+I4)⋅T3 andS10=(I2+I3)⋅T2+I4⋅T3+(I1+I3)⋅T4+(I2+I4)⋅T5

Answer»
14.

(A) 0(B) 103(C) 22(D) 55

Answer»
15.

The numbers 1, 2, …. n are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains p nodes. The first number to be inserted in the tree must be(A) p(B) p + 1(C) n – p(D) n – p + 1

Answer»
16.

How many pulses are needed to change the contents of a 8-bit up counter from 10101100 to 00100111 (rightmost bit is the LSB)?(A) 134(B) 133(C) 124(D) 123

Answer»
17.

A dynamic RAM has a memory cycle time of 64 nsec. It has to be refreshed 100 times per msec and each refresh takes 100 nsec. What percentage of the memory cycle time is used for refreshing?(A) 10(B) 6.4(C) 1(D) .64

Answer»
18.

A two-way switch has three terminals a, b and c. In ON position (logic value 1), a is connected to b, and in OFF position, a is connected to c. Two of these two-way switches S1 and S2 are connected to a bulb as shown below.Which of the following expressions, if true, will always result in the lighting of the bulb ?(A) S1.S2′(B) S1+S2(C) (S1⊕S2)’(D) S1⊕S2

Answer» Answer: (C)
Explanation: If we draw truth table of the above circuit,it’ll be

S1 S2 Bulb
0 0 On
0 1 Off
1 0 Off
1 1 On
=(S1⊕ S2)’