Computer Science MCQs | Computer Science Multiple Choice Questions with Answers

Questions
1 The hexadecimal equivalent of the octal number 2357 is :
A 2EE
B 2FF
C 4EF
D 4FE

Answer: Option [A]
2 Which of the following cannot be passed to a function in C++ ?
A Constant
B Structure
C Array
D Header file

Answer: Option [B]
3 Which one of the following is correct for overloaded functions in C++ ?
A Compiler sets up a separate function for every definition of function.
B Compiler does not set up a separate function for every definition of function.
C Overloaded functions cannot handle different types of objects.
D Overloaded functions cannot have same number of arguments.

Answer: Option [D]
4 Which of the following storage classes have global visibility in C/C++ ?
A Auto
B Extern
C Static
D Register

Answer: Option [A]
5 Which of the following operators cannot be overloaded in C/C++ ?
A Bitwise right shift assignment
B Address of
C Indirection
D Structure reference

Answer: Option [B]
6 If X is a binary number which is power of 2, then the value of X & (X – 1) is :
A 11….11
B 00…..00
C 100…..0
D 000……1

Answer: Option [B]
7 An attribute A of datatype varchar (20) has value ‘Ram’ and the attribute B of datatype char (20) has value ‘Sita’ in oracle. The attribute A has _______ memory spaces and B has _______ memory spaces.
A 20, 20
B 3, 20
C 3, 4
D 20, 4

Answer: Option [B]
8 Let M and N be two entities in an E-R diagram with simple single value attributes. R1 and R2 are two relationship between M and N, where as R1 is one-to-many and R2 is many-to-many. The minimum number of tables required to represent M, N, R1 and R2 in the relational model are _______.
A 4
B 6
C 7
D 8

Answer: Option [B]
9 Consider a schema R(MNPQ) and functional dependencies M → N, P → Q. Then the decomposition of R into R1(MN) and R2(PQ) is ________.
A Dependency preserving but not lossless join
B Dependency preserving and lossless join
C Lossless join but not dependency preserving
D Neither dependency preserving nor lossless join

Answer: Option [B]
10 The order of a leaf node in a B+ tree is the maximum number of children it can have. Suppose that block size is 1 kilobytes, the child pointer takes 7 bytes long and search field value takes 14 bytes long. The order of the leaf node is ________.
A 16
B 63
C 64
D 65

Answer: Option [B]
11 Which of the following is true for computation time in insertion, deletion and finding maximum and minimum element in a sorted array ?
A Insertion – 0(1), Deletion – 0(1), Maximum – 0(1), Minimum – 0(l)
B Insertion – 0(1), Deletion – 0(1), Maximum – 0(n), Minimum – 0(n)
C Insertion – 0(n), Deletion – 0(n), Maximum – 0(1), Minimum – 0(1)
D Insertion – 0(n), Deletion – 0(n), Maximum – 0(n), Minimum – 0(n)

Answer: Option [A]
12 The seven elements A, B, C, D, E, F and G are pushed onto a stack in reverse order, i.e., starting from G. The stack is popped five times and each element is inserted into a queue. Two elements are deleted from the queue and pushed back onto the stack. Now, one element is popped from the stack. The popped item is ________.
A A
B B
C F
D G

Answer: Option [B]
13 If h is chosen from a universal collection of hash functions and is used to hash n keys into a table of size m, where n ≤ m, the expected number of collisions involving a particular key x is less than _______.
A 1
B 1/n
C 1/m
D n/m

Answer: Option [D]
14 Which of the following statements is false ? (A) Optimal binary search tree construction can be performed efficiently using dynamic programming. (B) Breadth-first search cannot be used to find connected components of a graph. (C) Given the prefix and postfix walks of a binary tree, the tree cannot be re-constructed uniquely. (D) Depth-first-search can be used to find the connected components of a graph.
A A
B B
C C
D D

Answer: Option [A]
15 The maximum size of the data that the application layer can pass on to the TCP layer below is __________.
A 216 bytes
B 216 bytes + TCP header length
C 216 bytes – TCP header length
D 215 bytes

Answer: Option [B]
16 A packet whose destination is outside the local TCP/IP network segment is sent to _____.
A File server
B DNS server
C DHCP server
D Default gateway

Answer: Option [B]
17 Distance vector routing algorithm is a dynamic routing algorithm. The routing tables in distance vector routing algorithm are updated _____.
A automatically
B by server
C by exchanging information with neighbour nodes
D with back up database

Answer: Option [B]
18 In link state routing algorithm after construction of link state packets, new routes are computed using :
A DES algorithm
B Dijkstra’s algorithm
C RSA algorithm
D Packets

Answer: Option [B]
19 Consider the following assembly language instructions : mov al, 15 mov ah, 15 xor al, al mov cl, 3 shr ax, cl add al, 90H adc ah, 0 What is the value in ax register after execution of above instructions ?
A 0270H
B 0170H
C 01E0H
D 0370H

Answer: Option [B]
20 Convert the octal number 0.4051 into its equivalent decimal number.
A 0.5100098
B 0.2096
C 0.52
D 0.4192

Answer: Option [B]