All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 08

Theory of Computation and Compilers – Previous Year Questions

250 questions from past UGC NET Paper 2 – Computer Science papers, each with the correct answer. Open any question for its explanation.

Topic-wise mock tests

  1. Match the following based on the lengths of strings in the language accepted (using the brute-force method of parsing). Choose the correct answer from the options given below:List I List II a. S → aSa | aa I. ((2n × 3)…
    Answer: B. a-II, b-IV, c-I, d-III Paper 2 CS · December 2022 Shift 2
  2. What is the safest order for simplifying a context-free grammar?
    Answer: A. Elimination of ε-productions, unit productions, and then useless symbols and pr… Paper 2 CS · December 2022 Shift 2
  3. What is the move in the cell numbered M1 of the table?
    Answer: B. (q2, X2, L) Paper 2 CS · December 2022 Shift 2
  4. What is the move in the cell numbered M2 of the table?
    Answer: D. Error entry Paper 2 CS · December 2022 Shift 2
  5. What is the move in the cell numbered M3 of the table?
    Answer: C. (q1, X1, R) Paper 2 CS · December 2022 Shift 2
  6. What is the move in the cell numbered M4 of the table?
    Answer: B. (q3, Y1, R) Paper 2 CS · December 2022 Shift 2
  7. What is the move in the cell numbered M5 of the table?
    Answer: A. (q4, X2, R) Paper 2 CS · December 2022 Shift 2
  8. The reduced grammar equivalent to the grammar whose production rules are given below is S → AB | CA B → BC | AB A → a C → aB | b
    Answer: A. S → CA, A → a, C → b Paper 2 CS · September 2022
  9. Consider the production rules of grammar G: S → AbB A → aAb | λ B → bB | λ Which language L is generated by G?
    Answer: A. L = {anbm : n ≥ 0, m > n} Paper 2 CS · September 2022
  10. Consider the language L = {anbm : n ≥ 4, m ≤ 3}. Which regular expression represents L?
    Answer: C. aaaaa*(λ + b + bb + bbb) Paper 2 CS · September 2022
  11. Consider L = {ab, aa, baa}. Which of the following strings is NOT in L*?
    Answer: A. baaaaabaaaaa Paper 2 CS · September 2022
  12. Consider the NPDA M = ({q0, q1, qf}, {a, b}, {1, z}, δ, q0, z, {qf}) with δ(q0, λ, z) = {(qf, z)} δ(q0, a, z) = {(q1, 11z)} δ(q1, a, 1) = {(q1, 111)} δ(q1, b, 1) = {(q1, λ)} δ(q1, λ, z) = {(qf, z)} Which language L is a…
    Answer: B. L = {anb2n : n ≥ 0} Paper 2 CS · September 2022
  13. Consider two instances X and Y of the Post Correspondence Problem, each with lists A and B of three strings over {0, 1}. Which of the following is true?X i List A List B 1 1 111 2 10111 10 3 10 0 Y i List A List B 1 10…
    Answer: A. Only PCP in X has a solution Paper 2 CS · September 2022
  14. Consider the following properties of recursively enumerable sets: (A) Finiteness (B) Context-freedom (C) Emptiness Which of the following is true?
    Answer: D. All of (A), (B) and (C) are not decidable Paper 2 CS · September 2022
  15. Consider the grammar S → SbS | a and the string abababa. Consider the statements: the string has (A) two parse trees (B) two leftmost derivations (C) two rightmost derivations Which of the following is correct?
    Answer: A. All of (A), (B) and (C) are true Paper 2 CS · September 2022
  16. Match List I with List II. Choose the correct answer from the options given below:List I List II A. Type 0 I. Finite automata B. Type 1 II. Turing machine C. Type 2 III. Linear bounded automata D. Type 3 IV. Pushdown au…
    Answer: B. A-II, B-III, C-IV, D-I Paper 2 CS · September 2022
  17. Consider the following statements: Statement I: An LALR parser is more powerful than a canonical LR parser. Statement II: An SLR parser is more powerful than LALR. Which of the following is correct?
    Answer: C. Both Statement I and Statement II false Paper 2 CS · September 2022
  18. Consider the following statements about context-free languages (CFL): Statement I: CFLs are closed under homomorphism. Statement II: CFLs are closed under complement. Which of the following is correct?
    Answer: A. Statement I is true and Statement II is false Paper 2 CS · September 2022
  19. Match List – I with List – II. List – I (Propositions) (A) P ∧ (P → Q) (B) ¬(P ∨ Q) → (P ∧ Q) (C) P → Q (D) P ∨ (Q ∧ R) List – II (Disjunctive Normal Form) (I) P ∨ Q (II) (P ∧ ¬P) ∨ (P ∧ Q) (III) (¬P) ∨ Q (IV) (P ∧ P) ∨…
    Answer: B. (A)-(II), (B)-(I), (C)-(III), (D)-(IV)
  20. Overfitting is expected when we observe that?
    Answer: B. With training iterations error on training set decreases but test set increases
  21. Mr X designed open source software which must comply with some criteria. Choose the false statement in respect of above. (A) No restriction on redistribution of the software as part or whole (B) The integrity of the aut…
    Answer: C. (C) only
  22. Match List (I) with List (II): List I A. Product Complexity B. Structured System Analysis C. Coupling & cohesion D. Symbolic Execution List II I. System Requirements Design II. Software design III. Validation techniques…
    Answer: C. A-(IV), B-(I), C-(II), D-(III)
  23. Suppose a cloud contains software stack such as Operating System, Application software, etc. This model is referred as _____ model.
    Answer: A. SaaS Paper 2 CS · December 2018
  24. Which one of the following is not typically provided by Source Code Management Software?
    Answer: C. Syntax highlighting Paper 2 CS · July 2018
  25. Which of the following super computers is the fastest?
    Answer: A. Sun-way TaihuLight
  26. Which of the following statements about ERP system is true?
    Answer: B. ERP software packages are themselves combinations of separate applications for…
  27. Which of the following is not a Clustering method?
    Answer: C. K-nearest neighbour method
  28. Which of the given wireless technologies used in IoT, consumes the least amount of power?
    Answer: A. Zigbee
  29. The distributed system is a collection of (P) and communication is achieved in a distributed system by (Q), where (P) and (Q) are:
    Answer: C. Tightly coupled software on loosely coupled hardware and message passing, respe…
  30. Which of the following statements is incorrect for Parallel Virtual Machine (PVM)?
    Answer: D. In the PVM model, the message order is not preserved