Computer Science MCQs | Computer Science Multiple Choice Questions with Answers

Questions
1 The definitions in an XML document are said to be __________ when the tagging system and definitions in the DTD are all in compliance.
A well-formed
B reasonable
C valid
D logical

Answer: Option [A]
2 A graphic display system has a frame buffer that is 640 pixels wide, 480 pixels high and 1 bit of color depth. If the access time for each pixel on the average is 200 nanoseconds, then the refresh rate of this frame buffer is approximately :
A 16 frames per second
B 19 frames per second
C 21 frames per second
D 23 frames per second

Answer: Option [B]
3 Which one of the following is not typically provided by Source Code Management Software ?
A Synchronisation
B Versioning and Revision history
C Syntax highlighting
D Project forking

Answer: Option [D]
4 A software system crashed 20 times in the year 2017 and for each crash, it took 2 minutes to restart. Approximately, what was the software availability in that year ?
A 96.9924%
B 97.9924%
C 98.9924%
D 99.9924%

Answer: Option [A]
5 A software design pattern often used to restrict access to an object is :
A adapter
B decorator
C delegation
D proxy

Answer: Option [B]
6 Which of the following is not a key strategy followed by the clean room approach to software development ?
A Formal specification
B Dynamic verification
C Incremental development
D Statistical testing of the system

Answer: Option [B]
7 The solution of the recurrence relation T(m) T(3m 4) 1 = + is :
A θ (lg m)
B θ (m)
C θ (mlg m)
D θ (lglg m)

Answer: Option [B]
8 Consider the array A=<4, 1, 3, 2, 16, 9, 10, 14, 8, 7>. After building heap from the array A, the depth of the heap and the right child of max-heap are _________ and _________ respectively. (Root is at level 0).
A 3, 14
B 3, 10
C 4, 14
D 4, 10

Answer: Option [B]
9 A hash function h defined h(key)=key mod 7, with linear probing, is used to insert the keys 44, 45, 79, 55, 91, 18, 63 into a table indexed from 0 to 6. What will be the location of key 18 ?
A 3
B 4
C 5
D 6

Answer: Option [B]
10 Which of the following algorithms solves the single-source shortest paths ?
A Prim’s algorithm
B Floyd - Warshall algorithm
C Johnson’s algorithm
D Dijkstra’s algorithm

Answer: Option [B]
11 A text is made up of the characters A, B, C, D, E each occurring with the probability 0.08, 0.40, 0.25, 0.15 and 0.12 respectively. The optimal coding technique will have the average length of :
A 2.4
B 1.87
C 3.0
D 2.15

Answer: Option [A]
12 A binary search tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 19 leaves :
A cannot have more than 37 nodes
B has exactly 37 nodes
C has exactly 35 nodes
D cannot have more than 35 nodes

Answer: Option [B]
13 The maximum number of comparisons needed to sort 9 items using radix sort is (assume each item is 5 digit octal number) :
A 45
B 72
C 360
D 450

Answer: Option [D]
14 A 5-ary tree is tree in which every internal node has exactly 5 children. The number of left nodes in such a tree with 8 internal nodes will be :
A 30
B 33
C 45
D 125

Answer: Option [A]
15 Consider a Boolean function of ‘n’ variables. The order of an algorithm that determines whether the Boolean function produces a output 1 is :
A Logarithmic
B Linear
C Quadratic
D Exponential

Answer: Option [B]
16 Two finite state machines are said to be equivalent if they :
A Have the same number of edges
B Have the same number of states
C Recognize the same set of tokens
D Have the same number of states and edges

Answer: Option [B]
17 A pushdown automata behaves like a Turing machine when the number of auxiliary memory is : 35. To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of productions to be used is : (1) 2n−1 (2) 2n (3) n+1 (4) n2
A 0
B 1
C 1 or more
D 2 or more

Answer: Option [B]
18 Pushdown automata can recognize language generated by_________.
A Only context free grammar
B Only regular grammar
C Context free grammar or regular grammar
D Only context sensitive grammar

Answer: Option [B]
19 To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of productions to be used is :
A 2n−1
B 2n
C n+1
D n2

Answer: Option [B]
20 Context sensitive language can be recognized by a :
A Finite state machine
B Deterministic finite automata
C Non-deterministic finite automata
D Linear bounded automata

Answer: Option [B]