Computer Science MCQs | Computer Science Multiple Choice Questions with Answers

Questions
1 If an instruction takes ‘i’ microseconds and a page fault takes an additional ‘j’ microseconds. The effective instruction time, if on the average a page fault occurs every k instructions, is
A i + j/k
B i + j * k
C (i + j)/k
D (i + j) * k

Answer: Option [A]
2 In any simplex table, if corresponding to any negative ∆j, all elements of the column are negative or zero, the solution under the test is
A degenerate solution
B unbounded solution
C alternative solution
D alternative solution

Answer: Option [B]
3 How many relations are there on a set with n elements that are symmetric and a set with n elements that are reflexive and symmetric ?
A 2n(n+1)/2 and 2n.3n(n–1)/2
B 3n(n–1)/2 and 2n(n–1)
C 2n(n+1)/2 and 3n(n–1)/2
D 2n(n+1)/2 and 2n(n–1)/2

Answer: Option [D]
4 The strategy used to reduce the number of tree branches and the number of static evaluations applied in case of a game tree is
A Minmax strategy
B Alpha-beta pruning strategy
C Constraint satisfaction strategy
D Constraint satisfaction strategy

Answer: Option [A]
5 While unit testing a module, it is found that for a set of test data, maximum 90% of the code alone were tested with a probability of success 0.9. The reliability of the module is
A atleast greater than 0.9
B equal to 0.9
C atmost 0.81
D atleast 1/0.81

Answer: Option [B]
6 The upper bound of computing time of m coloring decision problem is
A O(nm)
B O(nm)
C O(nmn)
D O(nmmn)

Answer: Option [B]
7 The equivalent grammar corresponding to the grammar G : S → aA, A → BB, B → aBb | ∈ is
A S → aA, A → BB, B → aBb
B S → a|aA, A → BB, B → aBb | ab
C S → a | aA, A → BB | B, B → aBb
D S → a | aA, A → BB | B, B → aBb | ab

Answer: Option [B]
8 Which one of the following statements is incorrect ?
A The number of regions corresponds to the cyclomatic complexity
B Cyclometric complexity for a flow graph G is V(G) = N – E + 2, where E is the number of edges and N is the number of nodes in the flow graph
C Cyclometric complexity for a flow graph G is V(G) = E – N + 2, where E is the number of edges & N is the number of nodes in the flow graph
D Cyclometric complexity for a flow graph G is V(G) = P + 1, where P is the number of predicate nodes contained in the flow graph G

Answer: Option [B]
9 Consider a weighted undirected graph with positive edge weights and let (u, v) be an edge in the graph. It is known that the shortest path from source vertex s to u has weight 53 and shortest path from s to v has weight 65. Which statement is always true ?
A Weight (u, v) < 12
B Weight (u, v) = 12
C Weight (u, v) > 12
D Weight (u, v) > 12

Answer: Option [B]
10 Consider the regular expression (a + b) (a + b) … (a + b) (n-times). The minimum number of states in finite automaton that recognizes the language represented by this regular expression contains
A n states
B n + 1 states
C n + 2 states
D 2n states

Answer: Option [B]
11 Number of binary trees formed with 5 nodes are
A 32
B 36
C 120
D 42

Answer: Option [A]
12 Are we building the right product ? This statement refers to
A Verification
B Validation
C Testing
D Software quality assurance

Answer: Option [B]
13 The following postfix expression is evaluated using a stack 823^/23* + 51* – The top two elements of the stack after first * is evaluated
A 6, 1
B 5, 7
C 3, 2
D 1, 5

Answer: Option [D]
14 The following CFG S → aB | bA, A → a | as | bAA, B → b | bs | aBB generates strings of terminals that have
A odd number of a’s and odd number of b’s
B even number of a’s and even number of b’s
C equal number of a’s and b’s
D not equal number of a’s and b’s

Answer: Option [A]
15 Consider the following pseudo-code : If (A > B) and (C > D) then A = A + 1 B = B + 1 Endif The cyclomatic complexity of the pseudo-code is
A 2
B 3
C 4
D 5

Answer: Option [B]
16 Which layer of OSI reference model uses the ICMP (Internet Control Message Protocol) ?
A Transport layer
B Data link layer
C Network layer
D Application layer

Answer: Option [B]
17 Which diagram provides a formal graphic notation for modelling objects, classes and their relationships to one another ?
A Object diagram
B Class diagram
C Instance diagram
D Analysis diagram

Answer: Option [B]
18 A computer system supports 32 bit virtual address as well as 32 bit physical addresses. Since the virtual address space is of same size as that of physical address space, if we want to get rid of virtual memory, which one of the following is true ?
A Efficient implementation of multiuser support is no longer possible
B The processor cache can be made more efficient
C Hardware support for memory management is not needed
D CPU scheduling can be made more efficient

Answer: Option [B]
19 The feasible region represented by the constraints x1 – x2 < 1, x1 + x2 > 3, x 1 > 0, x2 > 0 of the objective function Max Z = 3x1 + 2x2 is
A A polygon
B Unbounded feasible region
C A point
D None of these

Answer: Option [B]
20 The colour of an object is largely determined by its diffuse reflection coefficient. If Kd = (0.8, 0.4, 0), then what shall be the colour of the object, if the light used is blue and magenta ?
A White and Red
B Red and Blue
C Black and White
D Black and Red

Answer: Option [B]