Explore topic-wise MCQs in Computer Science.

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

1.

After several defeats in wars, Robert Bruce went in exile and wanted to commit suicide. Just before committing suicide, he came across a spider attempting tirelessly to have its net. Time and again, the spider failed but that did not deter it to refrain from making attempts. Such attempts by the spider made Bruce curious. Thus, Bruce started observing the near-impossible goal of the spider to have the net. Ultimately, the spider succeeded in having its net despite several failures. Such act of the spider encouraged Bruce not to commit suicide. And then, Bruce went back again and won many a battle, and the rest is history. Which one of the following assertions is best supported by the above information?

A. Failure is the pillar of success.
B. Honesty is the best policy.
C. Life begins and ends with adventures.
D. No adversity justifies giving up hope.
Answer» E.
2.

Were you a bird, you ___________________ in the sky.

A. would fly
B. shall fly
C. should fly
D. shall have flown
Answer» B. shall fly
3.

Complete the sentence: Universalism is to particularism as diffuseness is to _______________

A. specificity
B. neutrality
C. generality
D. adaptation
Answer» B. neutrality
4.

Which one of the following options is the closest in meaning to the word given below? Nadir

A. Highest
B. Lowest
C. Medium
D. Integration
Answer» C. Medium
5.

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F={CH→G, A→BC, B→CFH, E→A, F→EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R. The relation R is

A. in 1NF, but not in 2NF.
B. in 2NF, but not in 3NF
C. in 3NF, but not in BCNF
D. in BCNF.
Answer» B. in 2NF, but not in 3NF
6.

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F={CH→G, A→BC, B→CFH, E→A, F→EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R. How many candidate keys does the relation R have?

A. 3
B. 4
C. 5
D. 6
Answer» C. 5
7.

Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction (FI), Decode Instruction (DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand (WO). The stage delays for FI, DI, FO, EI and WO are 5 ns, 7 ns, 10 ns, 8 ns and 6 ns, respectively. There are intermediate storage buffers after each stage and the delay of each buffer is 1 ns. A program consisting of 12 instructions I1, I2, I3, ...., I12 is executed in this pipelined processor. Instruction I4 is the only branch instruction and its branch target is I9. If the branch is taken during the execution of this program, the time (in ns) needed to complete the program is

A. 132
B. 165
C. 176
D. 328
Answer» C. 176
8.

The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?

A. 10, 20, 15, 23, 25, 35, 42, 39, 30
B. 15, 10, 25, 23, 20, 42, 35, 39, 30
C. 15, 20, 10, 23, 25, 42, 35, 39, 30
D. 15, 10, 23, 25, 20, 35, 42, 39, 30
Answer» E.
9.

In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400 and the fragment offset value is 300. The position of the datagram, the sequence numbers of the first and the last bytes of the payload, respectively are

A. Last fragment, 2400 and 2789
B. First fragment, 2400 and 2759
C. Last fragment, 2400 and 2759
D. Middle fragment, 300 and 689
Answer» D. Middle fragment, 300 and 689
10.

Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each cylinder contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing format is . A file of size 42797 KB is stored in the disk and the starting disk location of the file is <1200, 9, 40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?

A. 1281
B. 1282
C. 1283
D. 1284
Answer» E.
11.

What is the logical translation of the following statement? “None of my friends are perfect.”

A. Ǝx(F(x) ᴧ ¬ P(x))
B. Ǝx(¬ F(x) ᴧ P(x))
C. Ǝx(¬ F(x) ᴧ ¬ P(x))
D. ¬ Ǝx(F(x) ᴧ P(x))
Answer» E.
12.

Which of the following statements is/are TRUE for undirected graphs? P: Number of odd degree vertices is even. Q: Sum of degrees of all vertices is even.

A. P only
B. Q only
C. Both P and Q
D. Neither P nor Q
Answer» D. Neither P nor Q
13.

In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from

A. (j mod v) * k to (j mod v) * k + (k-1)
B. (j mod v) to (j mod v) + (k-1)
C. (j mod k) to (j mod k) + (v-1)
D. (j mod k) * v to (j mod k) * v + (v-1)
Answer» B. (j mod v) to (j mod v) + (k-1)
14.

The transport layer protocols used for real time multimedia, file transfer, DNS and email, respectively are

A. TCP, UDP, UDP and TCP
B. UDP, TCP, TCP and UDP
C. UDP, TCP, UDP and TCP
D. TCP, UDP, TCP and UDP
Answer» D. TCP, UDP, TCP and UDP
15.

What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e., of type A → є and A → a) to parse a string with n tokens?

A. n/2
B. n - 1
C. 2n-1
D. 2n
Answer» C. 2n-1
16.

Which one of the following is the tightest upper bound that represents the number of swaps required to sort n numbers using selection sort?

A. O(log n)
B. O(n)
C. O(n log n)
D. O(n2)
Answer» C. O(n log n)
17.

Given the sequence of terms, AD CG FK JP, the next term is

A. OV
B. OW
C. PV
D. PW
Answer» B. OW
18.

An automobile plant contracted to buy shock absorbers from two suppliers X and Y. X supplies 60% and Y supplies 40% of the shock absorbers. All shock absorbers are subjected to a quality test. The ones that pass the quality test are considered reliable. Of X’s shock absorbers, 96% are reliable. Of Y’s shock absorbers, 72% are reliable. The probability that a randomly chosen shock absorber, which is found to be reliable, is made by Y is

A. 0.288
B. 0.334
C. 0.667
D. 0.720
Answer» C. 0.667
19.

Wanted Temporary, Part-time persons for the post of Field Interviewer to conduct personal interviews to collect and collate economic data. Requirements: High School-pass, must be available for Day, Evening and Saturday work. Transportation paid, expenses reimbursed. Which one of the following is the best inference from the above advertisement?

A. Gender-discriminatory
B. Xenophobic
C. Not designed to make the post attractive
D. Not gender-discriminatory
Answer» E.
20.

Which one of the following options is the closest in meaning to the word given below? Mitigate

A. Diminish
B. Divulge
C. Dedicate
D. Denote
Answer» B. Divulge
21.

Choose the most appropriate alternative from the options given below to complete the following sentence: Despite several ––––––––– the mission succeeded in its attempt to resolve the conflict.

A. attempts
B. setbacks
C. meetings
D. delegations
Answer» C. meetings
22.

A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit. The size of the cache tag directory is

A. 160 Kbits
B. 136 Kbits
C. 40 Kbits
D. 32 Kbits
Answer» B. 136 Kbits
23.

A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit. The number of bits in the tag field of an address is

A. 11
B. 14
C. 16
D. 27
Answer» D. 27
24.

Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 on a demand paged virtual memory system running on a computer system that has main memory size of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacement policy. Then

A. OPTIMAL < LRU < FIFO
B. OPTIMAL < FIFO < LRU
C. OPTIMAL = LRU
D. OPTIMAL = FIFO
Answer» C. OPTIMAL = LRU
25.

Suppose a circular queue of capacity (n −1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are

A. full: (REAR+1) mod n == FRONT empty: REAR == FRONT
B. full: (REAR+1) mod n == FRONT empty: (FRONT+1) mod n == REAR
C. full: REAR == FRONT empty: (REAR+1) mod n == FRONT
D. full: (FRONT+1) mod n == REAR empty: REAR == FRONT
Answer» B. full: (REAR+1) mod n == FRONT empty: (FRONT+1) mod n == REAR
26.

An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?

A. 245.248.136.0/21 and 245.248.128.0/22
B. 245.248.128.0/21 and 245.248.128.0/22
C. 245.248.132.0/22 and 245.248.132.0/21
D. 245.248.136.0/24 and 245.248.132.0/21
Answer» B. 245.248.128.0/21 and 245.248.128.0/22
27.

Let W(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. Which of the following is ALWAYS TRUE?

A. A(n) = Ω (W(n))
B. A(n) = Θ (W(n))
C. A(n) = O (W(n))
D. A(n) = o (W(n))
Answer» D. A(n) = o (W(n))
28.

What is the correct translation of the following statement into mathematical logic? “Some real numbers are rational”

A. Ǝx (real(x) ᴠ rational(x))
B. Ǝx (real(x) → rational(x))
C. Ǝx (real(x) ᴧ rational(x))
D. Ǝx (rational(x) → real(x))
Answer» D. Ǝx (rational(x) → real(x))
29.

Consider the function f(x) = sin(x) in the interval x ϵ [π/4, 7π/4]. The number and location(s) of the local minima of this function are

A. One, at π/2
B. One, at 3π/2
C. Two, at π/2 and 3π/2
D. Two, at π/4 and 3π/2
Answer» E.
30.

The decimal value 0.5 in IEEE single precision floating point representation has

A. fraction bits of 000…000 and exponent value of 0
B. fraction bits of 000…000 and exponent value of −1
C. fraction bits of 100…000 and exponent value of 0
D. no exact representation
Answer» C. fraction bits of 100…000 and exponent value of 0
31.

Assuming P ≠ NP, which of the following is TRUE?

A. NP-complete = NP
B. NP-complete ∩ P = φ
C. NP-hard = NP
D. P = NP-complete
Answer» C. NP-hard = NP