Success is the sum of small efforts, repeated day-in and day-out.
1. The minimum number of cards to be dealt from an arbitrarily shuffled deck of 52
cards to guarantee that three cards are from some same suit is
(A) 3
(B) 8
(C) 9
(D) 12
View/Hide Ans
Correct Answer is C
2. An n × n array v is defined as follows:
v[i,j]=i-j for all i, j, 1 ≤ i ≤ n, 1 ≤ j ≤ n
The sum of the elements of the array v is
(A) 0
(B) n -1
(C) n2-3n+1
(D) (n2(n+1))/2
View/Hide Ans
Correct Answer is A
3. The determinant of the matrix
4. Let S and T be language over ∑={a,b} represented by the regular expressions
(a+b*)* and (a+b)*, respectively.
Which of the following is true?
(A) S ⊂ T
(B) T ⊂ S
(C) S = T
(D) S ∩ T = ∅
View/Hide Ans
Correct Answer is C
5. Let L denotes the language generated by the grammar S→0S0/00.
Which of the following is true?
(A) L=0+
(B) L is regular but not 0+
(C) L is context free but not regular
(D) L is not context free
View/Hide Ans
Correct Answer is B
6. The number 43 in 2’s complement representation is
(A) 01010101
(B) 11010101
(C) 00101011
(D) 10101011
View/Hide Ans
Correct Answer is C
7. To put the 8085 microprocessor in the wait state
(A) Lower the HOLD input
(B) Lower the READY input
(C) Raise the HOLD input
(D) Raise the READY input
View/Hide Ans
Correct Answer is B
8. Comparing the time T1 taken for a single instruction on a pipelined CPU with time
T2 taken on a non-pipelined but identical CPU, we can say that
(A) T1≤T2
(B) T1≥T2
(C) T1<T2
(D) T1 is T2 plus the time taken for one instruction fetch cycle
View/Hide Ans
Correct Answer is B
9. The 8085 microprocessor responds to the present of an interrupt
(A) As soon as the TRAP pin becomes ‘high’
(B) By checking the TRAP pin for ‘high’ status at the end of each instruction each
(C) By checking the TRAP pin for ‘high’ status at the end of the execution of each instruction.
(D) By checking the TRAP pin for ‘high’ status at regular intervals
View/Hide Ans
Correct Answer is C
10. The most appropriate matching for the following pairs
is
List I
List II
X: Indirect addressing
1: Loops
Y: Immediate addressing
2: Pointers
Z: Auto decrement addressing
3: Constants
(A) X-3 Y-2 Z-1
(B) X-1 Y-3 Z 2
(C) X-2 Y-3 Z-1
(D) X-3 Y-1 Z-2
View/Hide Ans
Correct Answer is C
11. The following C declarations
struct node{
int i:
float j;
};
struct node *s[10];
define s to be
(A) An array, each element of which is a pointer to a structure of type node
(B) A structure of 2 fields, each field being a pointer to an array of 10 elements
(C) A structure of 3 fields: an integer, a float, and an array of 10 elements
(D) An array, each element of which is a structure of type node
View/Hide Ans
Correct Answer is A
12. The most appropriate matching for the following pairs
is:
List I
List II
X: m=malloc(5); m= NULL;
1: using dangling pointers
Y: free(u); n->value=5;
2: using uninitialized pointers
Z: char *p; *p=’a’;
3. lost memory
(A) X-1 Y-3 Z-2
(B) X-2 Y-1 Z-3
(C) X-3 Y-2 Z-1
(D) X-3 Y-1 Z-2
View/Hide Ans
Correct Answer is D
13. The most appropriate matching for the following pairs
is:
List I
List II
X: depth first search
1: heap
Y: breadth-first search
2: queue
Z: sorting
3: stack
(A) X-1 Y-2 Z-3
(B) X-3 Y-1 Z-2
(C) X-3 Y-2 Z-1
(D) X-2 Y-3 Z-1
View/Hide Ans
Correct Answer is C
14. Consider the following nested representation of binary trees: (X Y Z) indicates Y
and Z are the left and right sub stress, respectively, of node X. Note that Y and Z
may be NULL, or further nested.
Which of the following represents a valid binary
tree?
(A) (1 2 (4 5 6 7))
(B) (1 (2 3 4) 5 6) 7)
(C) (1 (2 3 4)(5 6 7))
(D) (1 (2 3 NULL) (4 5))
View/Hide Ans
Correct Answer is C
15. Let s be a sorted array of n integers. Let t(n) denote the time taken for the most
efficient algorithm to determined if there are two elements with sum less than
1000 in s.
which of the following statements is true?
(A) t(n) is 0(1)
(B) n ≤ t(n) ≤ nlog2n
(C) nlog2n ≤ t(n) ≤ n/2
(D) t(n) = n/2
View/Hide Ans
Correct Answer is A
16. Aliasing in the context of programming languages refers to
(A) Multiple variables having the same memory location
(B) Multiple variables having the same value
(C) Multiple variables having the same identifier
(D) Multiple uses of the same variable
View/Hide Ans
Correct Answer is A
17. Consider the following C declaration
struct {
short s [5]
union {
float y;
long z;
}u;
}t;
Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and
8 bytes, respectively.
The memory requirement for variable t, ignoring alignment
considerations, is
(A) 22 bytes
(B) 14 bytes
(C) 18 bytes
(D) 10 bytes
View/Hide Ans
Correct Answer is C
18. The number of tokens in the following C statement
printf("i=%d, &i=%x",i,&i);
is
(A) 3
(B) 26
(C) 10
(D) 21
View/Hide Ans
Correct Answer is C
19. Which of the following derivations does a top-down parser use while parsing an
input string?
The input is assumed to be scanned in left to right order.
(A) Leftmost derivation
(B) Leftmost derivation traced out in reverse
(C) Rightmost derivation
(D) Rightmost derivation traced out in reverse
View/Hide Ans
Correct Answer is A
20. Which of the following need not necessarily be saved on a context switch
between processes?
(A) General purpose registers
(B) Translation look-aside buffer
(C) Program counter
(D) All of the above
View/Hide Ans
Correct Answer is B
21. Let m[0]…m[4] be mutexes (binary semaphores) and P[0] …. P[4] be processes.
Suppose each process P[i] executes the following:
wait (m[i]); wait (m[(i+1) mode 4]);
.......
release (m[i]); release (m[(i+1)mod 4]);
This could cause
(A) Thrashing
(B) Deadlock
(C) Starvation, but not deadlock
(D) None of the above
View/Hide Ans
Correct Answer is B
22. B+-trees are preferred to binary trees in databases because
(A) Disk capacities are greater than memory capacities
(B) Disk access is much slower than memory access
(C) Disk data transfer rates are much less than memory data transfer rates
(D) Disks are more reliable than memory
View/Hide Ans
Correct Answer is B
23. Given the relations
employee (name, salary, deptno), and
department (deptno, deptname, address)
Which of the following queries cannot be expressed using the basic relational
algebra operations (σ, π, x, ⋈, ∪, ∩ ,-)?
(A) Department address of every employee
(B) Employees whose name is the same as their department name
(C) The sum of all employees’ salaries
(D) All employees of a given department
View/Hide Ans
Correct Answer is C
24. X, Y and Z are closed intervals of unit length on the real line. The overlap of X and
Y is half a unit. The overlap of Y and Z is also half a unit. Let the overlap of X and
Z be k units.
Which of the following is true?
(A) k must be 1
(B) k must be 0
(C) k can take any value between 0 and 1
(D) None of the above
View/Hide Ans
Correct Answer is D
25. E1 and E2 are events in a probability space satisfying the following constraints:
Pr(E1) - Pr(E2)
Pr(E1 ∪ E2) = 1
E1 and E2 are independent
The value of Pr(E1), the probability of the event E1, is
(A) 0
(B) 1/4
(C) 1/2
(D) 1
View/Hide Ans
Correct Answer is D
26. Let
and
Which of the following statements is true?
(A) S > T
(B) S = T
(C) S < T and 2S > T
(D) 2S ≤ T
View/Hide Ans
Correct Answer is A
27. A polynomial p(x) satisfies the following:
p(1) = p(3) = p(5) = 1
p(2) = p(4) = -1
The minimum degree of such a polynomial is
(A) 1
(B) 2
(C) 3
(D) 4
View/Hide Ans
Correct Answer is D
28. A relation R is defined on the set of integers as xRy iff (x+y) is even.
Which of the following statements is true?
(A) R is not an equivalence relation
(B) R is an equivalence relation having 1 equivalence class
(C) R is an equivalence relation having 2 equivalence classes
(D) R is an equivalence relation having 3 equivalence classes
View/Hide Ans
Correct Answer is C
29. Let P(S) denotes the powerset of set S.
Which of the following is always true?
(A) P(P(S))=P(S)
(B) P(S) ∩ P(P(S)) = {∅}
(C) P(S) ∩ S = P(S)
(D) S ∉ P(S)
View/Hide Ans
Correct Answer is B
30. Let a, b, c, d be propositions.
Assume that the equivalence a ↔(b∨~b) and b↔c hold.
Then the truth-value of the formula (a∧b)→(a∧c)∨d
is always
(A) True
(B) False
(C) Same as the truth-value of b
(D) Same as the truth-value of d
View/Hide Ans
Correct Answer is A
31. What can be said about a regular language L over {a} whose minimal finite state
automation has two states?
(A) L must be {an| n is odd}
(B) L must be {an| n is even}
(C) L must be {an| n≥0}
(D) Either L must be {an| n is odd}, or L must be {an| n is even}
View/Hide Ans
Correct Answer is D
32. Consider the following decision problems:
(P1) Does a given finite state machine accept a given string
(P2) Does a given context free grammar generate an infinite number of stings
Which of the following statements is true?
(A) Both (P1) and (P2) are decidable
(B) Neither (P1) nor (P2) are decidable
(C) Only (P1) is decidable
(D) Only (P2) is decidable
View/Hide Ans
Correct Answer is A
33. The simultaneous equations on the Boolean variables x, y, z and w,
x+y+z=1
xy=0
xz+w=1
xy+z'w'=1
have the following solution for x, y, z and w, respectively:
(A) 0 1 0 0
(B) 1 1 0 1
(C) 1 0 1 1
(D) 1 0 0 0
View/Hide Ans
Correct Answer is C
34. Which functions does NOT implement the Karnaugh map given below?
35. The following arrangement of master-slave flip flops
36. A graphics card has on board memory of 1 MB.
Which of the following modes can the card not support?
(A) 1600×400 resolution with 256 colours on a 17 inch monitor
(B) 1600×400 resolution with 16 million colours on a 14 inch monitor
(C) 800×400 resolution with 16 million colours on a 17 inch monitor
(D) 800×800 resolution with 256 colours on a 14 inch monitor
View/Hide Ans
Correct Answer is B
37. Consider the values of A=2.0×1030 , B=-2.0×1030, C=1.0, and the sequence
X:=A+B
Y:=A+C
X:=X+C
Y:=Y+B
executed on a computer where floating point numbers are represented with 32 bits.
The values for X and Y will be
(A) X=1.0, Y=1.0
(B) X=1.0, Y=0.0
(C) X=0.0, Y=1.0
(D) X=0.0, Y=0.0
View/Hide Ans
Correct Answer is B
38. Suppose you are given an array s[1…n] and a procedure reverse(s,i,j) which
reverses the order of elements in a between positions i and j (both inclusive).
What does the following sequence do, where 1≤k≤n:
reverse(s,1,k);
reverse(s,k+1,n);
reverse(s,1,n);
(A) Rotates s left by k positions
(B) Leaves s unchanged
(C) Reverses all elements of s
(D) None of the above
View/Hide Ans
Correct Answer is A
39. Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a
postorder, inorder and preorder traversal, respectively, of a complete binary
tree.
Which of the following is always tree?
(A) LASTIN = LASTPOST
(B) LASTIN = LASTPRE
(C) LASTPRE = LASTPOST
(D) None of the above
View/Hide Ans
Correct Answer is D
40. Consider the following functions
f(n)=3n√n
g(n)=2√nlogn
h(n)=n!
Which of the following is true?
(A) h(n) is O(f(n))
(B) h(n) is O(g(n))
(C) g(n) is not O(f(n))
(D) f(n) is O(g(n))
View/Hide Ans
Correct Answer is D
41. Let G be an undirected connected graph with distinct edge weight. Let emax be the
edge with maximum weight and emin the edge with minimum weight.
Which of the following statements is false?
(A) Every minimum spanning tree of G must contain emin
(B) If emax is in a minimum spanning tree, then its removal must disconnect G
(C) No minimum spanning tree contains emax
(D) G has a unique minimum spanning tree
View/Hide Ans
Correct Answer is C
42. Lt G be an undirected graph. Consider a depth-first traversal of G, and let T be
the resulting depth-first search tree. Let u be a vertex in G and let v be the first
new (unvisited) vertex visited after visiting u in the traversal.
Which of the following statements is always true?
(A) {u,v} must be an edge in G, and u is a descendant of v in T
(B) {u,v} must be an edge in G, and v is a descendant of u in T
(C) If {u,v} is not an edge in G then u is a leaf in T
(D) If {u,v} is not an edge in G then u and v must have the same parent in T
View/Hide Ans
Correct Answer is C
43. The value of j at the end of the execution of the following C program
int incr(int i) {
static int count = 0;
count = count + i;
return (count);
}
main() {
int i,j;
for (i=0; i<=4; i++)
j = incr(i);
}
is
(A) 10
(B) 4
(C) 6
(D) 7
View/Hide Ans
Correct Answer is A
44. Given the following expression grammar:
F → E*F | F+E | F
F → F-F | id
Which of the following is true?
(A) * has higher precedence than +
(B) - has higher precedence than *
(C) + and - have same precedence
(D) + has higher precedence than *
View/Hide Ans
Correct Answer is B
45. Suppose the time to service a page fault is on the average 10 milliseconds, while
a memory access takes 1 microsecond.
Then a 99.99% hit ratio results in
average memory access time of
(A) 1.9999 milliseconds
(B) 1 millisecond
(C) 9.999 microseconds
(D) 1.9999 microseconds
View/Hide Ans
Correct Answer is D
46. Which of the following is NOT a valid deadlock prevention scheme?
(A) Release all resources before requesting a new resource
(B) Number the resources uniquely and never request a lower numbered resource than the last one requested
(C) Never request a resource after releasing any resource
(D) Request and all required resources be allocated before execution
View/Hide Ans
Correct Answer is C
47. Given the following relation instance
X Y Z
1 4 2
1 5 3
1 6 3
3 2 2
Which of the following functional dependencies are satisfied by the instance?
(A) XY → Z and Z → Y
(B) YZ → X and Y → Z
(C) YZ → X and X → Z
(D) XZ → Y and Y → X
View/Hide Ans
Correct Answer is B
48. Given relations r(w,x) and s(y,z), the result of
select distinct w,x
from r, s
is guaranteed to be same as r, provided
(A) r has no duplicates and s is non-empty
(B) r and s have no duplicates
(C) s has no duplicates and r is non-empty
(D) r and s have the same number of tuples
View/Hide Ans
Correct Answer is A
© 2022. All Rights Reserved | Copyright | Terms of Use & Privacy Policy