Explore topic-wise MCQs in Testing Subject.

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

1.

Language L

A. Both P and Q are true
B. P is true and Q is false
C. P is false and Q is true
D. Both P and Q are false
Answer» D. Both P and Q are false
2.

Consider the following statements about the context-free grammar:

A. 1 only
B. 1 and 3
C. 2 and 3
D. 1, 2 and 3
Answer» C. 2 and 3
3.

Consider the following languages over the alphabet = {a, b, c}.

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

Let G = ({S}, {a, b}, R, S) be a context-free grammar where the rule set R is S aSb | SS |

A. G is not ambiguous
B. There exist X, Y L(G) such that XY L(G)
C. There is a deterministic push-down automata that accepts L(G)
D. We can find a deterministic finite state automata that accepts L(G)
Answer» D. We can find a deterministic finite state automata that accepts L(G)
5.

Let X be a recursive language and Y be a recursively enumerable but not recursive language. Let W and Z be two languages such that

A. W can be recursively enumerable and Z is recursive.
B. W can be recursive and Z is recursively enumerable.
C. W is not recursively enumerable and Z is recursive.
D. W is not recursively enumerable and Z is not recursive.
Answer» D. W is not recursively enumerable and Z is not recursive.
6.

For any two languages L

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

Consider the following languages.

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

Consider the following types of languages: L

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

If L

A. Only (I)
B. Only (II)
C. Both (I) and (II)
D. Neither (I) nor (II)
Answer» B. Only (II)
10.

The minimum possible number of states of a deterministic finite automata that accepts the regular language L = {w

A. 4
B. 8
C. 10
D. 0
Answer» C. 10
11.

Let P be a regular language and Q be a context free language such that Q P. For example, let P be the language represented by the regular expression p*q* and Q be ( Q

A. P Q
B. P - Q
C.
D. * - P
E. * - Q
Answer» D. * - P
12.

If L and

A. regular
B. context-free
C. context-sensitive
D. recursive
Answer» E.
13.

For S (0 + 1)* let d(s) denotes the decimal value of s (e.g., d(101) = 5)

A. L is recursively enumerable but not recursive
B. L is recursively but not context-free
C. L is context-free but not regular
D. L is regular
Answer» E.
14.

If the strings of a language L can be effectively enumerated in lexicographic (i.e., alphabetic) order, which of the following statements is true?

A. L is necessarily finite
B. L is regular but not necessarily finite
C. L is context-free but not necessarily regular
D. L is recursive but not necessarily context-free
Answer» E.
15.

The language { a

A. regular
B. context-free but not regular
C. context-senstitive but not context-free
D. type-0 but not context-sensitive
Answer» C. context-senstitive but not context-free
16.

The C language is

A. a context-free language
B. a context-sensitive language
C. a regular language
D. parsable fully only be a turing maching
Answer» C. a regular language
17.

The language accepted by a push-down automata in which the stack is limited to 10 items is best described as

A. context-free
B. regular
C. deterministic context-free
D. recursive
Answer» C. deterministic context-free
18.

Ram and Shyam have been asked to show that a certain problem is NP-complete. Ram shows a Polynomial time reduction from the 3-SAT problem to II, and Shyam shows a polynomial time reduction from to 3-SAT. Which of the following can be inferred from these reductions?

A. is NP-hard but not NP-complete
B. is in NP, but is not NP-complete
C. is NP-complete
D. is neither NP-hard, nor in NP
Answer» D. is neither NP-hard, nor in NP
19.

Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible to S and S is polynomial time reducible to R. Which one of the following statements is true?

A. R is NP-complete
B. R is NP-hard
C. Q is NP-complete
D. Q is NP-hard
Answer» C. Q is NP-complete
20.

Consider the following two problems on undirected graphs :

A. a is in P and b is NP-complete
B. a is NP-complete b is in P
C. Both a and b are NP-complete
D. Both a and b are in P
Answer» B. a is NP-complete b is in P
21.

Let S and T be languages over = {a, b} represented by the regular expressions (a + b*)* and (a + b)*, respectively. Which of the following is true?

A. S T
B. T S
C. S = T
D. S T =
Answer» D. S T =
22.

Let L(R) be the language represented by regular expression R. Let L(G) be the language generated by a context free grammar G. Let L(M) be the language accepted by a Turing machine M. Which of the following decision problems are undecidable?

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

The language L = { 0

A. not recursive
B. is recursive and is a deterministic CFL
C. is a regular language
D. is not a deterministic CFL but a CFL
Answer» C. is a regular language
24.

Which of the following is true for the language {a

A. It is not accepted by a turning machine
B. It is regular but not context-free
C. It is context-free but not regular
D. It is neither regular nor context-free, but accepted by a turing machine
Answer» E.
25.

If G is a grammar with productions

A. abab
B. aaab
C. abbaa
D. babba
Answer» E.
26.

Which of the following decision problems are undecidable?

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

Which of the following is/are undecidable?

A. 3 only
B. 3 and 4 only
C. 1, 2 and 3 only
D. 2 and 3 only
Answer» E.
28.

Consider a DFA over = {a, b} accepting all strings which have number of a's divisible by 6 and number of b's divisible by 8. What is the minimum number of states that the DFA will have?

A. 8
B. 14
C. 15
D. 48
Answer» E.
29.

The smallest finite automata which accepts the language {x| length of x is divisible by 3} has

A. 2 states
B. 3 states
C. 4 states
D. 5 states
Answer» C. 4 states
30.

Let < M > be the encoding of a Turing machine as a string over = {0, 1}. Let L = {

A. decidable and recursively enumerable
B. undecidable but recursively enumerable
C. undecidable and not recursively enumerable
D. decidable but not recursively enumerable
Answer» C. undecidable and not recursively enumerable
31.

The length of the shortest string NOT in the language (over = {a, b}) of the following regular expression is

A. 0
B. 3
C. 6
D. 9
Answer» C. 6
32.

The number of states in the minimum sized DFA that accepts the language defined by the regular expression (0 + 1) * (0 + 1) (0 + 1)* is ________.

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

The number of states in the minimal deterministic finite automata corresponding to the regular expression (0 + 1) * (10) is _______.

A. 0
B. 5
C. 3
D. 1
Answer» D. 1
34.

Consider the alphabet = {0, 1}, the null/empty string and the sets of strings X

A. 10(0*+(10)*)1
B. 10(0*+(10*)*1
C. 1(0+10)*1
D. 10(0+10)*1+110(0+10)*1
Answer» D. 10(0+10)*1+110(0+10)*1
35.

Consider the language L given by the regular expression (a + b) *b (a + b) over the alphabet {a.b}. The smallest number of states needed in a deterministic finite-state automata (DFA) accepting L is ________.

A. 2
B. 4
C. 1
D. 10
Answer» C. 1