 
			 
			MCQOPTIONS
 Saved Bookmarks
				This section includes 233 Mcqs, each offering curated multiple-choice questions to sharpen your Control Systems knowledge and support exam preparation. Choose a topic below to get started.
| 1. | Consider the translation scheme shown belowS → T RR → + T {print ('+');} R | εT → num {print (num.val);}Here num is a token that represents an integer and num.val represents thecorresponding integer value. For an input string '9 + 5 + 2', this translation scheme willprint | 
| A. | 9 + 5 + 2 | 
| B. | 9 5 + 2 + | 
| C. | 9 5 2 + + | 
| D. | + + 9 5 2 | 
| Answer» C. 9 5 2 + + | |
| 2. | Consider the following two statements:S1: { 0^2n |n >= l} is a regu1ar languageS2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regu1ar languageWhich of the following statements is correct? | 
| A. | Only S1 is correct | 
| B. | Only S2 is correct | 
| C. | Both S1 and S2 are correct | 
| D. | None of S1 and S2 is correct | 
| Answer» D. None of S1 and S2 is correct | |
| 3. | Consider the intermediate code given below:1. i = 12. j = 13. t1 = 5 * i4. t2 = t1 + j5. t3 = 4 * t26. t4 = t37. a[t4] = –18. j = j + 19. if j | 
| A. | 5 and 7 | 
| B. | 6 and 7 | 
| C. | 5 and 5 | 
| D. | 7 and 8 | 
| Answer» C. 5 and 5 | |
| 4. | Consider the following statements about the context free grammarG = {S - >SS, S - >ab, S - >ba, S - ε}I. G is ambiguousII. G produces all strings with equal number of a’s and b’sIII. G can be accepted by a deterministic PDA.Which combination below expresses all the true statements about G? | 
| A. | 1 only | 
| B. | 1 and 3 | 
| C. | 2 and 3 | 
| D. | 1,2 and 3 | 
| Answer» E. | |
| 5. | The expression (a*b)* c op........ where 'op' is one of '+', '*' and '↑' (exponentiation) can be evaluated on a CPU with a single register without storing the value of (a * b) if | 
| A. | ‘op’ is ‘+’ or ‘*’ | 
| B. | 'op’ is ‘↑’ or ‘*’ | 
| C. | 'op’ is ‘↑’ or ‘+’ | 
| D. | not possible to evaluate without storing | 
| Answer» B. 'op’ is ‘↑’ or ‘*’ | |
| 6. | For S € (0+1)* let d(s)denote the decimal value of s(e.g.d(101)= 5).Let L = {s € (0 + 1) | d (s) mod 5 = 2 and d (s) mod 7 != 4)}Which one of the following statements is true? | 
| A. | L is recursively enumerable, but not recursive | 
| B. | L is recursive, but not context-free | 
| C. | L is context-free, but not regular | 
| D. | L is regular | 
| Answer» E. | |
| 7. | Consider the following statements related to compiler construction : I. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. II. Syntax Analysis is specified by regular expressions and implemented by finite-state machine. Which of the above statement(s) is/are correct? | 
| A. | Only I | 
| B. | Only II | 
| C. | Both I and II | 
| D. | Neither I nor II | 
| Answer» E. | |
| 8. | Consider the following two problems on undirected graphs:α: Given G(V,E), does G have an independent set of size |v|—4?β: Given G(V,E), does G have an independent set of size 5?Which one of the following is TRUE? | 
| A. | α is in P and β is NP-complete | 
| B. | α is NP complete and β is in P | 
| C. | Both α and β are NP-complete | 
| D. | Both α and β are in P | 
| Answer» C. Both α and β are NP-complete | |
| 9. | Consider the regular language L =(111+11111)*. The minimum number of states | 
| A. | 3 | 
| B. | 5 | 
| C. | 8 | 
| D. | 9 | 
| Answer» E. | |
| 10. | Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. The relationship between n1 and n2 is: | 
| A. | n1 is necessarily less than n2 | 
| B. | n1 is necessarily equal to n2 | 
| C. | n1 is necessarily greater than n2 | 
| D. | none of these | 
| Answer» C. n1 is necessarily greater than n2 | |
| 11. | Consider the grammar with the following translation rules and E as the start symbol.E → E1 # T { E.value = E1.value * T.value } | T{ E.value = T.value }T → T1 & F { T.value = T1.value + F.value } | F{ T.value = F.value }F → num { F.value = num.value }Compute E.value for the root of the parse tree for the expression: 2 # 3 & 5 # 6 & 4. | 
| A. | 200 | 
| B. | 180 | 
| C. | 160 | 
| D. | 40 | 
| Answer» D. 40 | |
| 12. | Consider the following C code segment.for (i = 0, i | 
| A. | The code contains loop invariant computation | 
| B. | There is scope of common sub-expression elimination in this code | 
| C. | There is scope of strength reduction in this code | 
| D. | There is scope of dead code elimination in this code | 
| Answer» E. | |
| 13. | The number of tokens in the following C statement is (GATE 2000)printf("i = %d, &i = %x", i, &i); | 
| A. | 3 | 
| B. | 26 | 
| C. | 10 | 
| D. | 21 | 
| Answer» D. 21 | |
| 14. | Consider the following identities for regular expressions: (a) (r + s)* = (s + r)* (b) (r*)* = r* (c) (r* s*)* = (r + s)* Which of the above identities are true? | 
| A. | (a) and (b) only | 
| B. | (b) and (c) only | 
| C. | (c) and (a) only | 
| D. | (a), (b) and (c) | 
| Answer» E. | |
| 15. | Consider the following grammar:S → FRR → S | εF → idIn the predictive parser table, M, of the grammar the entries M[S, id] and M[R, $]respectively. | 
| A. | {S → FR} and {R → ε } | 
| B. | {S → FR} and { } | 
| C. | {S → FR} and {R → *S} | 
| D. | {F → id} and {R → ε} | 
| Answer» B. {S → FR} and { } | |
| 16. | 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* | |
| 17. | Which of the following is essential for converting an infix expression to the postfix from efficiently? | 
| A. | An operator stack | 
| B. | An operand stack | 
| C. | An operand stack and an operator stack | 
| D. | A parse tree | 
| Answer» B. An operand stack | |
| 18. | The regular grammar for the language L = {anbm | n + m is even} is given by | 
| A. | S → S1 | S2 S1 → a S1| A1 A1 → b A1| λ S2 → aaS2| A2 A2 → b A2| λ | 
| B. | S → S1 | S2 S1 → a S1| aA1 S2 → aaS2| A2 A1 → b A1| λ A2 → b A2| λ | 
| C. | S → S1 | S2 S1 → aaa S1| aA1 S2 → aaS2| A2 A1 → b A1| λ A2 → b A2| λ | 
| D. | S → S1 | S2 S1 → aa S1| A1 S2 → aaS2| A2 A1 → bb A1| λ A2 → bb A2| λ | 
| Answer» E. | |
| 19. | Which of the following problems are decidable?1) Does a given program ever produce an output?2) If L is a context-free language, then is L’ (complement of L) also context-free?3) If L is a regular language, then is L’ also regular?4) If L is a recursive language, then, is L’ also recursive? | 
| A. | 1, 2, 3, 4 | 
| B. | 1, 2 | 
| C. | 2, 3, 4 | 
| D. | 3, 4 | 
| Answer» E. | |
| 20. | The grammar A → AA | (A) | ε is not suitable for predictive-parsing because thegrammar is | 
| A. | ambiguous | 
| B. | left-recursive | 
| C. | right-recursive | 
| D. | an operator-grammar | 
| Answer» B. left-recursive | |
| 21. | Which of the following grammar rules violate the requirements of an operator grammar ? P, Q, R are nonterminals, and r, s, t are terminals.1. P → Q R2. P → Q s R3. P → ε4. P → Q t R r | 
| A. | 1 only | 
| B. | 1 and 3 only | 
| C. | 2 and 3 only | 
| D. | 3 and 4 only | 
| Answer» C. 2 and 3 only | |
| 22. | If s is a string over (0 + 1)* then let n0 (s) denote the number of 0’s in s and n1 (s)the number of l’s in s. Which one of the following languages is not regular? | 
| A. | L = {s € (0 + 1)*n0 (s) is a 3-digit prime | 
| B. | L = {s € (0 + 1)* | for every prefix s’ of s, l 0 (s’) — n1 (s’) | <= 2 } | 
| C. | L={s € (0+1)* | n0(s) - n1(s) | <= 4} | 
| D. | L = {s € (0 + 1) | n0 (s) mod 7 = n1 (s) mod 5 = 0 } | 
| Answer» D. L = {s € (0 + 1) | n0 (s) mod 7 = n1 (s) mod 5 = 0 } | |
| 23. | Consider the language L1,L2,L3 as given below. L1={0^{p}1^{q} | p,q \in N}L2={0^{p}1^{q} | p,q \in N and p=q} L3={0^{p}1^{q}1^{r} | p,q,r \in N and p=q=r}Which of the following statements is NOT TRUE? | 
| A. | Push Down Automata (PDA) can be used to recognize L1 and L2 | 
| B. | L1 is a regular language | 
| C. | All the three languages are context free | 
| D. | Turing machine can be used to recognize all the three languages | 
| Answer» D. Turing machine can be used to recognize all the three languages | |
| 24. | Given an arbitrary non-deterministic finite automaton (NFA) with N states, the maximum number of states in an equivalent minimized DFA is at least. | 
| A. | N^2 | 
| B. | 2^N | 
| C. | 2N | 
| D. | N! | 
| Answer» C. 2N | |
| 25. | Which of the following are decidable?I. Whether the intersection of two regular languages is infiniteII. Whether a given context-free language is regularIII. Whether two push-down automata accept the same languageIV. Whether a given grammar is context-free | 
| A. | I and II | 
| B. | I and IV | 
| C. | II and III | 
| D. | II and IV | 
| Answer» C. II and III | |
| 26. | Let L denotes the language generated by the grammar S – OSO/00. Which of the following is true? | 
| A. | L = O | 
| B. | L is regular but not O | 
| C. | L is context free but not regular | 
| D. | L is not context free | 
| Answer» C. L is context free but not regular | |
| 27. | A linker reads four modules whose lengths are 200, 800, 600 and 500 words respectively. If they are loaded in that order, what are the relocation constants? | 
| A. | 0, 200, 500, 600 | 
| B. | 0, 200, 1000, 1600 | 
| C. | 200, 500, 600, 800 | 
| D. | 200, 700, 1300, 2100 | 
| Answer» C. 200, 500, 600, 800 | |
| 28. | Which of the following statements in true? | 
| A. | If a language is context free it can always be accepted by a deterministic push-down automaton | 
| B. | The union of two context free languages is context free | 
| C. | The intersection of two context free languages is context free | 
| D. | The complement of a context free language is context free | 
| Answer» C. The intersection of two context free languages is context free | |
| 29. | Which of the following languages is regular? | 
| A. | {WW^R | W € {0,1}+ } | 
| B. | {WW^R X | X W € {0,1}+ } | 
| C. | {WW^R | X W € {0,1}+ } | 
| D. | {XWW^R | X W € {0,1}+ } | 
| Answer» D. {XWW^R | X W € {0,1}+ } | |
| 30. | A language L allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which of the following is true? | 
| A. | A compiler using static memory allocation can be written for L | 
| B. | A compiler cannot be written for L, an interpreter must be used | 
| C. | A compiler using dynamic memory allocation can be written for L | 
| D. | None of the above | 
| Answer» D. None of the above | |
| 31. | Consider the following translation scheme. S → ER R → *E{print("*");}R | ε E→ F + E {print("+");} | F F → (S) | id {print(id.value);} Here id is a token that represents an integer and id.value represents the corresponding integer value. For an input '2 * 3 + 4', this translation scheme prints | 
| A. | 2 * 3 + 4 | 
| B. | 2 * +3 4 | 
| C. | 2 3 * 4 + | 
| D. | 2 3 4+* | 
| Answer» E. | |
| 32. | Let L = L1 \cap L2, where L1 and L2 are languages as defined below: L1 = {a^{m}b^{m}ca^{n}b^{n} | m, n >= 0 } L2 = {a^{i}b^{j}c^{k} | i, j, k >= 0 } Then L is | 
| A. | Not recursive | 
| B. | Regular | 
| C. | Context free but not regular | 
| D. | Recursively enumerable but not context free. | 
| Answer» D. Recursively enumerable but not context free. | |
| 33. | Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively are | 
| A. | {S' → e S} and {S' → e} | 
| B. | {S' → e S} and {} | 
| C. | {S' → ε} and {S' → ε} | 
| D. | {S' → e S, S'→ ε} and {S' → ε} | 
| Answer» E. | |
| 34. | Consider the following grammar.S -> S * ES -> EE -> F + EE -> FF -> idConsider the following LR(0) items corresponding to the grammar above.(i) S -> S * .E(ii) E -> F. + E(iii) E -> F + .EGiven the items above, which two of them will appear in the same set in the canonicalsets-of-items for the grammar? | 
| A. | (i) and (ii) | 
| B. | (ii) and (iii) | 
| C. | (i) and (iii) | 
| D. | None of the above | 
| Answer» E. | |
| 35. | A minimum state deterministic finite automation accepting the language L = {W |W € {0,1}* , number of 0's and 1's in W are divisible by 3 and 5 respectively has | 
| A. | 15 States | 
| B. | 11 states | 
| C. | 10 states | 
| D. | 9 states | 
| Answer» B. 11 states | |
| 36. | Consider the following context free languages:L1 = {0^i 1^j 2^k | i+j = k}L2 = {0^i 1^j 2^k | i = j or j = k}L3 = {0^i 1^j | i = 2j+1}Which of the following option is true? | 
| A. | L1, L2 and L3 can be recognized by Deterministic Push down automata | 
| B. | L1, L2 can be recognized by Deterministic Push down automata | 
| C. | L1, L3 can be recognized by Deterministic Push down automata | 
| D. | None of the above | 
| Answer» D. None of the above | |
| 37. | Consider the following two statements:P: Every regular grammar is LL(1)Q: Every regular set has a LR(1) grammarWhich of the following is TRUE? | 
| 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 | |
| 38. | Which is True about SR and RR-conflict: | 
| A. | If there is no SR-conflict in CLR(1) then definitely there will be no SR-conflict in LALR(1). | 
| B. | RR-conflict might occur if lookahead for final items(reduce-moves) is same. | 
| C. | Known that CLR(1) has no RR-conflict, still RR-conflict might occur in LALR(1). | 
| D. | All of the above. | 
| Answer» E. | |
| 39. | Definition of a language L with alphabet {a} is given as following. L= { a^{nk} | k > 0, and n is a positive integer constant} What is the minimum number of states needed in a DFA to recognize L? | 
| A. | k+1 | 
| B. | n+1 | 
| C. | 2^(n+1) | 
| D. | 2^(k+1) | 
| Answer» C. 2^(n+1) | |
| 40. | Let be the encoding of a Turing machine as a string over ∑= {0, 1}. Let L = { |M is a Turing machine that accepts a string of length 2014 }. Then, L is | 
| 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 | |
| 41. | An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if andonly if | 
| A. | the SLR(1) parser for G has S-R conflicts | 
| B. | the LR(1) parser for G has S-R conflicts | 
| C. | the LR(0) parser for G has S-R conflicts | 
| D. | the LALR(1) parser for G has reduce-reduce conflicts | 
| Answer» C. the LR(0) parser for G has S-R conflicts | |
| 42. | Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most two zeros. For examples, 001110 and 011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially completed DFA that accepts this language is shown below. The missing arcs in the DFA are | 
| A. | A | 
| B. | B | 
| C. | C | 
| D. | D | 
| Answer» E. | |
| 43. | Consider the following code segment.x = u - t;y = x * v;x = y + w;y = t - z;y = x * y;The minimum number of total variables required to convert the above code segment tostatic single assignment form is Note : This question was asked as Numerical AnswerType. | 
| A. | 6 | 
| B. | 8 | 
| C. | 9 | 
| D. | 10 | 
| Answer» E. | |
| 44. | Consider the following two sets of LR(1) items of an LR(1) grammar. X -> c.X, c/d X -> .cX, c/d X -> .d, c/d X -> c.X, $ X -> .cX, $ X -> .d, $Which of the following statements related to merging of the two sets in thecorresponding LALR parser is/are FALSE?1. Cannot be merged since look aheads are different.2. Can be merged but will result in S-R conflict.3. Can be merged but will result in R-R conflict.4. Cannot be merged since goto on c will lead to two different sets. | 
| A. | 1 only | 
| B. | 2 only | 
| C. | 1 and 4 only | 
| D. | 1, 2, 3, and 4 | 
| Answer» E. | |
| 45. | S –> aSa| bSb| a| b ;The language generated by the above grammar over the alphabet {a,b} is the set of | 
| A. | All palindromes. | 
| B. | All odd length palindromes. | 
| C. | Strings that begin and end with the same symbol | 
| D. | All even length palindromes. | 
| Answer» C. Strings that begin and end with the same symbol | |
| 46. | Consider the following expression grammar. The seman-tic rules for expressioncalculation are stated next to each grammar production.E → number E.val = number. val | E '+' E E(1).val = E(2).val + E(3).val | E '×' E E(1).val = E(2).val × E(3).valThe above grammar and the semantic rules are fed to a yacc tool (which is an LALR (1)parser generator) for parsing and evaluating arithmetic expressions. Which one of thefollowing is true about the action of yacc for the given grammar? | 
| A. | It detects recursion and eliminates recursion | 
| B. | It detects reduce-reduce conflict, and resolves | 
| C. | It detects shift-reduce conflict, and resolves the conflict in favor of a shift over a reduce action | 
| D. | It detects shift-reduce conflict, and resolves the conflict in favor of a reduce over a shift action | 
| Answer» D. It detects shift-reduce conflict, and resolves the conflict in favor of a reduce over a shift action | |
| 47. | A canonical set of items is given belowS --> L. > RQ --> R.On input symbol < the set has | 
| A. | a shift-reduce conflict and a reduce-reduce conflict. | 
| B. | a shift-reduce conflict but not a reduce-reduce conflict. | 
| C. | a reduce-reduce conflict but not a shift-reduce conflict. | 
| D. | neither a shift-reduce nor a reduce-reduce conflict. | 
| Answer» E. | |
| 48. | For S ∈ (0 + 1) * let d(s) denote the decimal value of s (e.g. d(101) = 5). Let L = {s ∈ (0 + 1)* d(s)mod5 = 2 and d(s)mod7 != 4}. Which one of the following statements is true? | 
| A. | L is recursively enumerable, but not recursive | 
| B. | L is recursive, but not context-free | 
| C. | L is context-free, but not regular | 
| D. | L is regular | 
| Answer» E. | |
| 49. | Match all items in Group 1 with correct options from those given in Group 2.List I List IIP. Regular Expression 1. Syntax analysisQ. Push down automata 2. Code GenerationR. Dataflow analysis 3. Lexical analysisS. Register allocation 4. Code optimization | 
| A. | P-4. Q-1, R-2, S-3 | 
| B. | P-3, Q-1, R-4, S-2 | 
| C. | P-3, Q-4, R-1, S-2 | 
| D. | P-2, Q-1, R-4, S-3 | 
| Answer» C. P-3, Q-4, R-1, S-2 | |
| 50. | Consider the following expressionu*v+a-b*c Which one of the following corresponds to a static single assignment from the above expressions | 
| A. | x1 = a - b y1 = p * c x2 = u * v y2 = p + q | 
| B. | x 1 = a - b y1 = x2 * c x3 = u * v y2 = x4 + y3 | 
| C. | x1 = a - b y2 = x1 * c x2 = u * v y3 = x2 + y2 | 
| D. | p = a - b q = p * c p = u * v q = p + q | 
| Answer» D. p = a - b q = p * c p = u * v q = p + q | |