0% found this document useful (0 votes)
74 views11 pages

CPET 21 CompSc Set2

The document contains a set of 25 multiple choice questions related to computer science topics like operating systems, data structures, algorithms, computer networks and databases. The questions cover concepts like cache memory, pipelining, pointers, arrays, classes and objects in C++, recursion, graphs, shortest path algorithms, relational database normalization, transactions and concurrency control in databases.

Uploaded by

R2k Official
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views11 pages

CPET 21 CompSc Set2

The document contains a set of 25 multiple choice questions related to computer science topics like operating systems, data structures, algorithms, computer networks and databases. The questions cover concepts like cache memory, pipelining, pointers, arrays, classes and objects in C++, recursion, graphs, shortest path algorithms, relational database normalization, transactions and concurrency control in databases.

Uploaded by

R2k Official
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

CPET-2021 [M.Sc. (Computer Science)/MCA/M.Sc.

(IT)] Set-02
1. Which is used and known as a high speed buffer, existing with almost each processor?
a) Primary
b) Secondary
c) Cache
d) RAM
2. EA stands for?
a) Effective address
b) Effective absolute
c) Effective Add
d) End address
3. Hazards in pipelined stages are of
a) Two types
b) Three types
c) Four types
d) Five types
4. Which register is a memory pointer?
a) Source index
b) Instruction register
c) Stack pointer
d) Program counter
5. A pipeline is like
a)An automobile assembly line
b) house pipeline
c) both a and b
d) A gas line
6. Data hazards occur when
a) Greater performance loss
b) Pipeline changes the order of read/write access to operands
c) Some functional unit is not fully pipelined
d) Machine size is limited
7. Anti-dependence corresponds to _______ hazard?
a) RAW
b) WAR
c) WAW
d) None of the above
8. When multiple-instructions are overlapped during execution of program, then function
performed is called
a) Multitasking
b) Multiprogramming
c) Hardwired control
d) Pipelining
9. An instruction that does no operation for changing state is known as
a) Nope
b) No
c) No-op
d) Nop
10. Number of instructions being executed defines the
a) Instruction count
b) Hit time
c) Clock rate
d) All above
11. SIMD represents an organization that ______________.
a) refers to a computer system capable of processing several programs at the same time.
b) represents organization of single computer containing a control unit, processor unit and a
memory unit.
c) includes many processing units under the supervision of a common control unit
d) none of the above.
12. In access control in a protection derivation, visibility modes will change as follows:
(a) private, public and protected become protected
(b)only public becomes protected
( c) public and protected becomes protected
(d) only private becomes protected

13. Member functions when defined within the class specification:


(a) Are always inline.
(b) Are not inline
(c) Are inline by default, unless they are too big and too complicated
(d) Are not inline by default?

14. In C++, dynamic memory allocation is accomplished with the operator------------------


-
(a) new
(b) this
(c ) malloc()
(e) delete

15. The keyword friend does not appear in


(a) The class allowing access to another class
(b) The class desiring access to another class
(c) The private section of a class
(d) The public section of a class

16. The operator cannot be overloaded


(a) ++
(b) ::
( c) ()
(e) ~

17. Pure virtual functions


(a) Have to be redefined in the derived class
(b) Cannot have public access specification
(c) Are mandatory for virtual class
(d) None of the above

18. Consider the following statements char *ptr; ptr=”hello”; cout<<*ptr; what will be
printed?
(a) first letter
(b) entire string
(c ) It is a syntax error
(d)last letter

19. The members of a class, by default are


(a) public
(b) protected
( c) private
(e) mandatory to specify

20. A pointer to the base class can hold address of


(a) only base class object
(b) only derived class object
( c) base class object as well as derived class object
(d) None of the above

21. A pointer
(a) implicitly points to an object
(b) can be explicitly used in a class
( c) can be used to return an object
(d)All of the above

22. What is the output of following program:


int fun(int a[ ], int n)
{
Int i,x=0;
for (i=0; i<=n; i=i+2)
x+=a[i];
return x;
}
main()
{
int x[10]={1,2,3,4,5,6,7,8};
int r;
r=fun(x,5);
printf("%d",r);
}
A. 9 B. 16 C. 15 D. 15

23. Int i,j;


Int ctr = 0;
Int myArray[2][3];
for (i=0; i<3; i++)
for (j=0; j<2; j++)
{
myArray[j][i] = ctr;
++ctr;
}
What is the value of myArray[1][2]in the above sample code?

A. 1 B. 3 C. 2 D. 5

24. Find the error if any:


void main()
{
char str[]={‘H’, ’e’, ’l’, ’l’, ’o’};
printf(“\n str1 = %s”, str);
}
A. Error B. No error. Output: Hello with a possible garbage
value
C. No Error. Output: Hello D. None of the above

25. int main()


{
int i = 0;

for(i = 0; i < 3; i++);


{
printf("loop ");
continue;
}
getchar();
return 0;
}

A. No error B. Syntax error C. Logical error D. none of these

26. What will be the output of the program?


main()
{
char ch;
int i;
ch = 'G';
i = ch-'A';
printf("%d", i);
} A. 6 B. 5 C. 2 D. 0

27. What will be the output of the program?


main()
{
printf("\n Si");
printf("\b li");
}
A. Sili B. Sii C. Sli D. Si

28. What is the output of the program


int main()
{
unsigned int i=65000;
while ( i++ != 0 );
printf("%d",i);
return 0;
}

A. 0 B. 1 C. -1 D. none of these
29. int main()
{
Int x,a,b; a=5,b=6;
x=!a&&b;
printf("%d",x);
return 0;
}
What will be printed when the above sample code is executed?
A. 0 B. 1 C. 2 D. None of these

30.
What will be the output?
int main()
{
int a=3, b=5, c=2;
x = (a>b) ?( (a>c) ? a : c ) : ((b>c) ? b : c);
printf("%d",x);
return 0;
}

A. 2 B. 3 C. -5 D. None of the above

31. What will be the output?


int main()
{
Int k,num=30;
k=(num>5?(num<=10?100: 200):500);
printf("%d\n",num);
return 0;
}
A. 200 B. 30 C. 100 D. 500

32. The number of transactions executed in a given amount of time is called __________.
a) utilization b) throughput c) response time d) concurrency
time

33. F = { A → B , B → C }, the key is


a) B b) C c) A d) No keys

34. Every view serializable schedule that is not conflict serializable has
a) clear writes b) blind writes c) blind rights d) no writes

35. Who is responsible for ensuring durability of a transaction


a) Quality manager b) recovery manager c) control manager d) evaluation
manager

36. R ( P, Q, R, S ) and F = { Q → R , S → P }, so the key is


a) S b) Q c) SQ d) RP

37. Which amongst the following is a conflicting instruction


a) w1(Q) ; r2(Q) b) r1(Q) ; r2(Q) c) r1(Q) ; r2(P) d) w1(Q) ; w2(R)

38. A relation on the many side of a 1 : M or M : N relationship must


a) be in 2 NF b) be in 3 NF c) have a single key d) have a composite key

39. Which of the following is FALSE?


a) BCNF is stricter than 3 NF
b) lossless, dependency-preserving decomposition into 3 NF is always possible
c) lossless, dependency-preserving decomposition into BCNF is always possible
d) any relation with two attributes is in BCNF

40. When a transaction is ___________, it is rolled back.


a) partially committed b) committed c) active d) aborted

41. A transaction starts in


a) active state b) partially commit state c) terminated state d) committed state

42. Which of the following standard algorithms is not a Greedy algorithm?

A. Knapsack Problem B. Huffman Coding C. Activity Selection Problem


D. Assembly Line Scheduling

43. The optimal solution to the following fractional knapsack problem instance is:

n = 3, W = 20, P={25, 24, 15}, W={18, 15, 10}

A. 35 B. 28.2 C. 31 D. 31.5

44. The predecessor graph constructed by DFS algorithm is a

A. Tree B. Forest C. Linked List D. None of these

45. Breadth first traversal is a method to traverse

A. All successors of a visited node before any successors of any of those successors
B. A single path of the graph as far it can go
C. Graph using shortest path
D. None of these

46. To implement Dijkstra’s shortest path algorithm on unweighted graphs so that it runs in
linear time, the data structure to be used is:
A. Queue
B. Stack
C. Heap
D. B-Tree

47. Given a directed graph where weight of every edge is same, we can efficiently find
shortest path from a given source to destination using:

A. Breadth First Traversal


B. Dijkstra's Shortest Path Algorithm
C. Neither Breadth First Traversal nor Dijkstra's algorithm can be used
D. Depth First Search

48.The predecessor graph constructed by DFS algorithm is a


A. Tree
B. Forest
C. Linked List
D. None of these

49. Time Complexity of Breadth First Search is? (V – number of vertices, E – number of
edges)
a) O(V + E)
b) O(V)
c) O(E)
d) O(V*E)

50. In BFS, how many times a node is visited?


a) Once
b) Twice
c) Equivalent to number of indegree of the node
d) Thrice

51 A graph is tree if and only if

a) Is planar
b) Contains a circuit
c) Minimally connected
d) Completely connected

52. Router operates in which layer of OSI Reference Model?


A. Layer 1 (Physical Layer)
B. Layer 3 (Network Layer)
C. Layer 4 (Transport Layer)
D. Layer 7 (Application Layer)

53. What is the typical range of Ephemeral ports?


A. 1 to 80
B. 1 to 1024
C. 80 to 8080
D. 1024 to 65535
54. Which of the following is correct in CIDR?
A. Class A includes Class B network
B. There are only two networks
C. There are high & low class network
D. There is no concept of class A, B, C networks
55. What is the use of Ping command?
A. To test a device on the network for reachability
B. To test a hard disk fault
C. To test a bug in a Application
D. To test a Pinter Quality
56. What is the size of Host bits in Class B of IP address?
A. 04
B. 08
C. 16
D. 32
57. ............provides a connection-oriented reliable service for sending messages
A. TCP
B. IP
C. UDP
D. All of the above
58. Which of the following is correct regarding Class B Address of IP address
A. Network bit – 14, Host bit – 16
B. Network bit – 16, Host bit – 14
C. Network bit – 18, Host bit – 16
D. Network bit – 12, Host bit – 14

59. Controlling access to a network by analyzing the incoming and outgoing packets is
called
A. IP Filtering
B. Data Filtering
C. Packet Filtering
D. Firewall Filtering
60. The management of data flow between computers or devices or between nodes in a
network is called
A. Flow control
B. Data Control
C. Data Management
D. Flow Management
61. Which data communication method is used to transmit the data over a serial
communication link?
A. Simplex
B. Half-duplex
C. Full duplex
D. All of above

62. Find the decimal equivalent of the octal number (127.54)8


a) (87.6874)10
b) (87.6877)10
c) (87.6876)10
d) (87.6875)10

63. Find the value of (6751)8= (?)2.


a) 011111101101
b) 110111101001
c) 100111101001
d) 110111101101

64. Evaluate and find (1715)10=(?)12


a) BBB
b) BAB
c) ABB
d) BAA

65. Two cards are drawn at random from a pack of 52 cards. The probability of these two
being aces is:
a) 1/26
b) 1/221
c) ½
d) none of those

66. If A and B are two mutually exclusive events then P(A  B) = ?


a) 0.1
b) 1
c) 0
d) 0.7

67. Examples of O(1) algorithms are______________.

a. Multiplying two numbers


b. assigning some value to a variable
c. displaying some integer on console
d. All of the above
68. Express the formula (n-1)*(n-5) in terms of big-Oh (O) notation
a. O(1)
b. O(log n)
c. O(n)
d. O(n2)
69. How many passes are required to sort a file of size N by bubble sort method?
a. N2
b. N
c. N-1
d. N/2
70. Suppose we are sorting an array of eight integers using some quadratic sorting algorithm.
After four iterations of the algorithm’s main loop, the array elements are ordered as shown
here:
24578136
a. Insertion sort
b. Selection sort
c. Either of a and b
d. None of the above

Extra Question:
71. In quick sort, the number of partitions into which the file of size n is divided by a selected
record is
a. n
b. n - 1
c. 2
d. None of the above

You might also like