Explore topic-wise MCQs in Computer Science.

This section includes 51 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.

Given digits 2, 2, 3, 3, 3, 4, 4, 4, 4 how many distinct 4 digit numbers greater than 3000 can be formed?

A. 50
B. 51
C. 52
D. 54
Answer» C. 52
2.

5 skilled workers can build a wall in 20 days: 8 semi-skilled workers can build a wall in 25 days; 10 unskilled workers can build a wall in 30 days. If a team has 2 skilled, 6 semi-skilled and 5 unskilled workers, how long will it take to build the wall?

A. 20
B. 10
C. 16
D. 15
Answer» E.
3.

If 137 + 276 = 435 how much is 731 + 672?

A. 534
B. 1403
C. 1623
D. 1513
Answer» D. 1513
4.

Modern warfare has changed from large scale clashes of armies to suppression of civilian populations. Chemical agents that do their work silently appear to be suited to such warfare; and regretfully, there exist people in military establishments who think that chemical agents are useful tools for their cause. Which of the following statements best sums up the meaning of the above passage:

A. Modern warfare has resulted in civil strife
B. Chemical agents are useful in modern warfare
C. Use of chemical agents in warfare would be undesirable
D. People in military establishments like to use chemical agents in war.
Answer» E.
5.

Hari(H), Gita(G), Irfan(I) and Saira(S) are siblings (i.e., brothers and sisters). All were born on 1st January. The age difference between any two successive siblings (that is born one after another) is less than 3 years. Given the following facts: i. Hari's age + Gita's age > Irfan's age + Saira's age ii. The age difference between Gita and Saira is 1 year. However Gita is not the oldest and Saira is not the youngest. iii. There are no twins. In what order were they born (oldest first)?

A. HSIG
B. SGHI
C. IGSH
D. IHSG
Answer» C. IGSH
6.

The question below consists of a pair of related words followed by four pairs of words. Select the pair that best expresses the relation in the original pair. Unemployed: Worker

A. fallow: land
B. unaware: sleeper
C. wit: jester
D. renovated: house
Answer» B. unaware: sleeper
7.

25 persons are in a room. 15 of them play hockey, 17 of them play football and 10 of them play both hockey and football. Then the number of persons playing neither hockey nor football is;

A. 2
B. 17
C. 13
D. 3
Answer» E.
8.

Choose the most appropriate word from the options given below to complete the following sentence: If we manage to ____________ our natural resources, we would leave a better planet for our children.

A. uphold
B. restrain
C. cherish
D. conserve
Answer» E.
9.

Which of the following options is closest in meaning to the word Circuitous.

A. cyclic
B. indirect
C. confusing
D. crooked
Answer» C. confusing
10.

Choose the most appropriate word from the options given below to the complete the following sentence: His rather casual remarks on politics ___________ his lack of seriousness about the subject.

A. masked
B. belied
C. betrayed
D. suppressed
Answer» D. suppressed
11.

Consider the data given in above question. Suppose the weights of all unused links in the previous question are changed to 2 and the distance vector algorithm is used again until all routing tables stabilize. How many links will now remain unused?

A. 0
B. 1
C. 2
D. 3
Answer» C. 2
12.

Consider the data given in above question. How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above

A. 10
B. 20
C. 30
D. 40
Answer» D. 40
13.

In the graph given in above question, what is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges?

A. 7
B. 8
C. 9
D. 10
Answer» C. 9
14.

Consider the data from above question. When there is a miss in both L1 cache and L2 cache, first a block is transferred from main memory to L2 cache, and then a block is transferred from L2 cache to L1 cache. What is the total time taken for these transfers?

A. 222 nanoseconds
B. 888 nanoseconds
C. 902 nanoseconds
D. 968 nanoseconds
Answer» D. 968 nanoseconds
15.

Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use the same netmask N. Which of the values of N given below should not be used if A and B should belong to the same network?

A. 255.255.255.0
B. 255.255.255.128
C. 255.255.255.192
D. 255.255.255.224
Answer» E.
16.

A system has n resources R0,...,Rn-1,and k processes P0,....Pk-1.The implementation of the resource request logic of each process Pi is as follows: if (i % 2 == 0) { if (i < n) request Ri if (i+2 < n) request Ri+2 } else { if (i < n) request Rn-i if (i+2 < n) request Rn-i-2 } In which one of the following situations is a deadlock possible?

A. n=40, k=26
B. n=21, k=12
C. n=20, k=10
D. n=41, k=19
Answer» C. n=20, k=10
17.

The following program is to be tested for statement coverage: begin if (a== b) {S1; exit;} else if (c== d) {S2;] else {S3; exit;} S4; end The test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a, b, c and d. The exact values are not given. T1 : a, b, c and d are all equal T2 : a, b, c and d are all distinct T3 : a = b and c != d T4 : a != b and c = d Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4?

A. T1, T2, T3
B. T2, T4
C. T3, T4
D. T1, T2, T4
Answer» E.
18.

The relation R contains 200 tuples and the rel ation S contains 100 tuples. What is the maximum number of tuples possible in the natural join of R and S (R natural join S)

A. 100
B. 200
C. 300
D. 2000
Answer» B. 200
19.

Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the minimum number of states in a non-deterministic finite automaton that accepts L?

A. n-1
B. n
C. n+1
D. 2n-1
Answer» D. 2n-1
20.

Consider the languages L1 = {0i1j | i != j}. L2 = {0i1j | i = j}. L3 = {0i1j | i = 2j+1}. L4 = {0i1j | i != 2j}.

A. Only L2 is context free
B. Only L2 and L3 are context free
C. Only L1 and L2 are context free
D. All are context free
Answer» E.
21.

Let L={w in (0 + 1)*|w has even number of 1s}, i.e. L is the set of all bit strings with even number of 1s. Which one of the regular expression below represents L?

A. (0*10*1)*
B. 0*(10*10*)*
C. 0*(10*1*)*0*
D. 0*1(10*1)*10
Answer» C. 0*(10*1*)*0*
22.

The grammar S → aSa | bS | c is

A. LL(1) but not LR(1)
B. LR(1)but not LR(1)
C. Both LL(1)and LR(1)
D. Neither LL(1)nor LR(1)
Answer» D. Neither LL(1)nor LR(1)
23.

The program below uses six temporary variables a, b, c, d, e, f. a = 1 b = 10 c = 20 d = a+b e = c+d f = c+e b = c+e e = b+f d = 5+e return d+f Assuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program without spilling?

A. 2
B. 3
C. 4
D. 6
Answer» C. 4
24.

The weight of a sequence a0, a1, ..., an-1 of real numbers is defined as a0+a1/2+...+ aa-1/2n-1. A subsequence of a sequence is obtained by deleting some elements from the sequence, keeping the order of the remaining elements the same. Let X denote the maximum possible weight of a subsequence of a0, a1, ...,an-1 and Y the maximum possible weight of a subsequence of a1, a2, ...,an-1. Then X is equal to

A. max(Y, a0+Y)
B. max(Y, a0+Y/2
C. max(Y, a0+2Y)
D. a0+Y/2
Answer» C. max(Y, a0+2Y)
25.

A 5-stage pipelined processor has Instruction Fetch(IF),Instruction Decode(ID),Operand Fetch(OF),Perform Operation(PO)and Write Operand(WO)stages.The IF,ID,OF and WO stages take 1 clock cycle each for any instruction.The PO stage takes 1 clock cycle for ADD and SUB instructions,3 clock cycles for MUL instruction,and 6 clock cycles for DIV instruction respectively.Operand forwarding is used in the pipeline.What is the number of clock cycles needed to execute the following sequence of instructions? Instruction Meaning of instruction I0 :MUL R2 ,R0 ,R1 R2 ¬ R0 *R1 I1 :DIV R5 ,R3 ,R4 R5 ¬ R3/R4 I2 :ADD R2 ,R5 ,R2 R2 ¬ R5+R2 I3 :SUB R5 ,R2 ,R6 R5 ¬ R2-R6

A. 13
B. 15
C. 17
D. 19
Answer» C. 17
26.

Suppose the predicate F(x, y, t) is used to represent the statement that person x can fool person y at time t. which one of the statements below expresses best the meaning of the formula ∀x∃y∃t(¬F(x, y, t))?

A. Everyone can fool some person at some time
B. No one can fool everyone all the time
C. Everyone cannot fool some person all the time
D. No one can fool some person at some time
Answer» C. Everyone cannot fool some person all the time
27.

The degree sequence of a simple graph is the sequence of the degrees of the nodes in the graph in decreasing order. Which of the following sequences can not be the degree sequence of any graph? I. 7, 6, 5, 4, 4, 3, 2, 1 II. 6, 6, 6, 6, 3, 3, 2, 2 III. 7, 6, 6, 4, 4, 3, 2, 2 IV. 8, 7, 7, 6, 4, 2, 1, 1

A. I and II
B. III and IV
C. IV only
D. II and IV
Answer» E.
28.

What is the probability that divisor of 1099 is a multiple of 1096?

A. 1/625
B. 4/625
C. 12/625
D. 16/625
Answer» B. 4/625
29.

Consider a company that assembles computers. The probability of a faulty assembly of any computer is p. The company therefore subjects each computer to a testing process.This testing process gives the correct result for any computer with a probability of q. What is the probability of a computer being declared faulty

A. pq + (1 - p)(1 - q)
B. (1 - q) p
C. (1 - p) q
D. pq
Answer» B. (1 - q) p
30.

Which of the following statements are true? I. Shortest remaining time first scheduling may cause starvation II. Preemptive scheduling may cause starvation III. Round robin is better than FCFS in terms of response time

A. I only
B. I and III only
C. II and III only
D. I, II and III
Answer» E.
31.

A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded to begin with. The system first accesses 100 distinct pages in some order and then accesses the same 100 pages but now in the reverse order. How many page faults will occur?

A. 196
B. 192
C. 197
D. 195
Answer» B. 192
32.

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned. Method Used by P1 while (S1 == S2) ; Critica1 Section S1 = S2; Method Used by P2 while (S1 != S2) ; Critica1 Section S2 = not (S1); Which one of the following statements describes the properties achieved?

A. Mutual exclusion but not progress
B. Progress but not mutual exclusion
C. Neither mutual exclusion nor progress
D. Both mutual exclusion and progress
Answer» B. Progress but not mutual exclusion
33.

What is the appropriate pairing of items in the two columns listing various activities encountered in a software life cycle? P. Requirements Capture 1.Module Development and Integration Q. Design 2.Domain Analysis R. Implementation 3.Structural and Behavioral Modeling S. Maintenance 4.Performance Tuning

A. P-3, Q-2, R-4, S-1
B. P-2, Q-3, R-1, S-4
C. P-3, Q-2, R-1, S-4
D. P-2, Q-3, R-4, S-1
Answer» C. P-3, Q-2, R-1, S-4
34.

Which of the following concurrency control protocols ensure both conflict serialzability and freedom from deadlock? I. 2-phase locking II. Time-stamp ordering

A. I only
B. I only
C. Both I and II
D. Neither I nor II
Answer» C. Both I and II
35.

A relational schema for a train reservation database is given below. Passenger (pid, pname, age) Reservation (pid, class, tid) Table: Passenger pid pname age ----------------- 0 Sachin 65 1 Rahul 66 2 Sourav 67 3 Anil 69 Table : Reservation pid class tid --------------- 0 AC 8200 1 AC 8201 2 SC 8201 5 AC 8203 1 SC 8204 3 AC 8202 What pids are returned by the following SQL query for the above instance of the tables? SLECT pid FROM Reservation , WHERE class ‘AC’ AND EXISTS (SELECT * FROM Passenger WHERE age > 65 AND Passenger. pid = Reservation.pid)

A. 1, 0
B. 1, 2
C. 1, 3
D. 1, 5
Answer» D. 1, 5
36.

Consider a B+-tree in which the maximum number of keys in a node is 5. What is the minimum number of keys in any non-root node?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
37.

Let L1 be a recursive language. Let L2 and L3 be languages that are recursively enumerable but not recursive. Which of the following statements is not necessarily true? (A) L2 – L1 is recursively enumerable. (B) L1 – L3 is recursively enumerable (C) L2 ∩ L1 is recursively enumerable (D) L2 ∪ L1 is recursively enumerable

A. A
B. B
C. C
D. D
Answer» C. C
38.

Which one of the following is not a client server application?

A. Internet chat
B. Web browsing
C. E-mail
D. ping
Answer» E.
39.

One of the header fields in an IP datagram is the Time to Live(TTL)field.Which of the following statements best explains the need for this field?

A. It can be used to prioritize packets
B. It can be used to reduce delays
C. It can be used to optimize throughput
D. It can be used to prevent packet looping
Answer» E.
40.

Which languages necessarily need heap allocation in the runtime environment?

A. Those that support recursion
B. Those that use dynamic scoping
C. Those that allow dynamic data structures
D. Those that use global variables
Answer» D. Those that use global variables
41.

Which data structure in a compiler is used for managing information about variables and their attributes?

A. Abstract syntax tree
B. Symbol table
C. Semantic stack
D. Parse Table
Answer» C. Semantic stack
42.

In a binary tree with n nodes, every node has an odd number of descendants. Every node is considered to be its own descendant. What is the number of nodes in the tree that have exactly one child?

A. 0
B. 1
C. (n-1)/2
D. n-1
Answer» B. 1
43.

Two alternative packages A and B are available for processing a database having 10k records.Package A requires 0.0001n2 time units and package B requires 10nlog10n time units to process n records. What is the smallest value of k for which package B will be preferred over A?

A. 12
B. 10
C. 6
D. 5
Answer» D. 5
44.

P is a 16-bit signed integer. The 2's complement representation of P is (F87B)16.The 2's complement representation of 8*P

A. (C3D8)16
B. (187B)16
C. (F878)16
D. (987B)16
Answer» B. (187B)16
45.

A main memory unit with a capacity of 4 megabytes is built using 1M × 1-bit DRAM chips. Each DRAM chip has 1K rows of cells with 1K cells in each row. The time taken for a single refresh operation is 100 nanoseconds. The time required to perform one refresh operation on all the cells in the memory unit is

A. 100 nanoseconds
B. 100×210 nanoseconds
C. 100×220 nanoseconds
D. 3200×220 nanoseconds
Answer» C. 100×220 nanoseconds
46.

The minterm expansion of f(P, Q, R) = PQ + QR' + PR' is

A. m2 + m4 + m6 + m7
B. m0 + m1 + m3 + m5
C. m0 + m1 + m6 + m7
D. m2 + m3 + m4 + m5
Answer» B. m0 + m1 + m3 + m5
47.

What is the value of Limn->∞(1-1/n)2n ?

A. 0
B. e-2
C. e-1/2
D. 1
Answer» C. e-1/2
48.

Consider the set S = {1, ω, ω2}, where ω and w2 are cube roots of unity. If * denotes the multiplication operation, the structure (S, *) forms

A. A group
B. A ring
C. An integral domain
D. A field
Answer» B. A ring
49.

What is the possible number of reflexive relations on a set of 5 elements?

A. 210
B. 215
C. 220
D. 225
Answer» D. 225
50.

Newton-Raphson method is used to compute a root of the equation x2-13=0 with 3.5 as the initial value. The approximation after one iteration is

A. 3.575
B. 3.676
C. 3.667
D. 3.607
Answer» E.