Compiler Design NTA UGC NET Question Analysis

Compiler Design NTA UGC NET Question Analysis

Q1➡ | NET June 2021
Given below are two statements
Statement I: LL(1) and LR are examples of Bottom-up parsers.
Statement II: Recursive descent parser and SLR are examples of Top-down parsers
In light of the above statements, choose the correct answer from the options given below Options:-
i ➥ Both Statement I and Statement II are false
ii ➥ Both Statement I and Statement II are true
iii ➥ Statement I is false but Statement II is true
iv ➥ Statement I is true but Statement II is false

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q1➡ | NTA UGC NET November 2020
Which of the following grammars is (are) ambiguous?
(A) s → ss | asb | bsa | λ
(B) s → asbs | bsas | λ
(C) s → aAB
A → bBb
B → A | λ where λ denotes empty string

Choose the correct answer from the options given below:
i➥ (A) and (C) only
ii ➥ (B) only
iii ➥ (B) and (C) only
iv ➥ (A) and (B) only

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q2➡ | NTA UGC NET November 2020
Which of the following are applications of symbol table?
A) Storage allocation
B) Checking type compatibility
C) Suppressing duplicate error messages
Choose the correct answer from the options given below:
i➥ (A) and (B) only
ii ➥ (A) and (C) only
iii ➥ (B) and (C) only
iv ➥ (A), (B) and (C) only

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q3➡ | NTA UGC NET November 2020
Which of the following is not an intermediate code form?
i➥ Syntax trees
ii ➥ Three address codes
iii ➥ Quadruples
iv ➥ Post fix Notation

Show Answer With Best Explanation

Answer: *marks to all
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q4➡ | NTA UGC NET December 2019
Which of the component module of DBMS does rearrangement and possible ordering of operations, eliminate redundancy in query and use efficient algorithms and indexes during the execution of a query?
i➥ Query compiler
ii ➥ Query optimizer
iii ➥ Stored data manager
iv ➥ Database processor

Show Answer With Best Explanation

Answer: II

Explanation:
The SQL Server Query Optimizer is a cost-based optimizer. The query optimizer attempts to determine the most efficient way to execute a given query by considering the possible query plans. Database users do not typically interact with a query optimizer, which works in the background.

Query Optimizer does rearrangement and possible ordering of operations, eliminate redundancy in query and use efficient algorithms and indexes during the execution of a query.

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q5➡ | NTA UGC NET June 2019
Replacing the expression 4*2.14 by 8.56 is known as
i➥ Constant folding
ii ➥ Induction variable
iii ➥ Strength reduction
iv ➥ Code reduction

Show Answer With Best Explanation

Answer: I
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q6➡ | NTA UGC NET June 2019
Which data structure is used by the compiler for managing variables and their attributes?
i➥ Binary tree
ii ➥ link list
iii ➥ Symbol table
iv ➥ Parse table

Show Answer With Best Explanation

Answer: III
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q7➡ | NTA UGC NET June 2019
Shift-reduce parser consists of
(a) input buffer
(b) stack
(c) parse table
choose the correct option from those given below:
i➥ (a) and (b) only
ii ➥ (a) and (c) only
iii ➥ (c) only
iv ➥ (a), (b) and (c)

Show Answer With Best Explanation

Answer: IV
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q8➡ | NTA UGC NET June 2019
On translating the expression given below into quadruple representation, how many operations are required?
(i*j)+(e+f)*(a*b+c)
i➥ 5
ii ➥ 6
iii ➥ 3
iv ➥ 7

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q9➡ | NTA UGC NET December 2018
The grammar S ⟶ (S) | SS | ∈ is not suitable for predictive parsing because the grammar is
i➥ An Operator Grammar
ii ➥ Right Recursive
iii ➥ Left Recursive
iv ➥ Ambiguous

Show Answer With Best Explanation

Answer: IV
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q10➡ | NTA UGC NET December 2018
Consider the following Grammar G :
S ➝ A | B
A➝ a | c
B➝ b | c
Where {S,A,B} is the set of non-terminals, {a,b,c} is the set of terminals.

Which of the following statement(s) is/are correct ?
S1 : LR(1) can parse all strings that are generated using grammar G.
S2 : LL(1) can parse all strings that are generated using grammar G.
i➥ Both S1 and S2
ii ➥ Only S2
iii ➥ Neither S1 nor S2
iv ➥ Only S1

Show Answer With Best Explanation

Answer: III
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q11➡ | NTA UGC NET June 2018
Consider the following two Grammars :
G1 : S → SbS|a
G2 : S → aB|ab, A→GAB|a, B→ABb|b
Which of the following option is correct ?
i➥ Only G1 is ambiguous
ii ➥ Only G2 is ambiguous
iii ➥ Both G1 and G2 are ambiguous
iv ➥ Both G1 and G2 are not ambiguous

Show Answer With Best Explanation

Answer: III
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q12➡ | NTA UGC NET June 2018
A bottom-up parser generates:
i➥ Leftmost derivation in reverse
ii ➥ Right-most derivation in reverse
iii ➥ Left-most derivation
iv ➥ Right-most derivation

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q13➡ | NTA UGC NET November 2017 Paper 2
Which of the following statements is/are TRUE ?
(i) The grammar S → SS | a is ambiguous (where S is the start symbol).
(ii) The grammar S → 0S1 | 01S | e is ambiguous (the special symbol e represents the empty string and S is the start symbol).
(iii) The grammar (where S is the start symbol).
S → T/U
T → x S y ? xy ? e
U → yT
generates a language consisting of the string yxxyy.
i➥ Only (i) and (ii) are TRUE
ii ➥ Only (i) and (iii) are TRUE
iii ➥ Only (ii) and (iii) are TRUE
iv ➥ All of (i), (ii) and (iii) are TRUE

Show Answer With Best Explanation

Answer: IV
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q14➡ | NTA UGC NET November 2017 Paper 2
A bottom-up parser generates:
i➥ Leftmost derivation in reverse
ii ➥ Right-most derivation in reverse
iii ➥ Left-most derivation
iv ➥ Right-most derivation

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q15➡ | NTA UGC NET November 2017 Paper 2
Match the description of several parts of a classic optimizing compiler in List – I, with the names of those parts in List – II:
Match the description of several parts of a classic optimizing compiler in List – I, with the names of those parts in  List – II:A ➥ (a)-(iii), (b)-(iv), (c)-(ii), (d)-(i) B ➥ (a)-(iv), (b)-(iii), (c)-(ii), (d)-(i) C ➥ (a)-(ii), (b)-(iv), (c)-(i), (d)-(iii) D ➥ (a)-(ii), (b)-(iv), (c)-(iii), (d)-(i)
i➥ (a)-(iii), (b)-(iv), (c)-(ii), (d)-(i)
ii ➥ (a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)
iii ➥ (a)-(ii), (b)-(iv), (c)-(i), (d)-(iii)
iv ➥ (a)-(ii), (b)-(iv), (c)-(iii), (d)-(i)

Show Answer With Best Explanation

Answer: I
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q16➡ | NTA UGC NET January 2017 Paper 2
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 ?
i➥ Only I
ii ➥ Only II
iii ➥ Both I and II
iv ➥ Neither I nor II

Show Answer With Best Explanation

Answer: IV
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q17➡ | NTA UGC NET August 2016 Paper 2
Which of the following is FALSE?
i➥ The grammar S→aS|aSbS|∈, where S is the only non-terminal symbol, and ∈ is the null string, is ambiguous.
ii ➥ An unambiguous grammar has same leftmost and rightmost derivation.
iii ➥ An ambiguous grammar can never be LR(k) for any k.
iv ➥ Recursive descent parser is a top-down parser

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q18➡ | NTA UGC NET August 2016 Paper 2
In compiler optimization, operator strength reduction uses mathematical identities to replace slow math operations with faster operations. Which of the following code replacements is an illustration of operator strength reduction ?
i➥ Replace P + P by 2 * P or Replace 3 + 4 by 7.
ii ➥ Replace P * 32 by P << 5
iii ➥ Replace P * 0 by 0
iv ➥ Replace (P << 4) – P by P * 15

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q19➡ | NTA UGC NET August 2016 Paper 2
Which of the following are the principles tasks of the linker?
I. Resolve external references among separately compiled program units.
II. Translate assembly language to machine code.
III. Relocate code and data relative to the beginning of the program.
IV. Enforce access-control restrictions on system libraries
i➥ I and II
ii ➥ I and III
iii ➥ II and III
iv ➥ I and IV

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q20➡ | NTA UGC NET July 2016 Paper 2
In _____, the bodies of the two loops are merged together to form a single loop provided that they do not make any references to each other.
i➥ Loop unrolling
ii ➥ Strength reduction
iii ➥ Loop concatenation
iv ➥ Loop jamming

Show Answer With Best Explanation

Answer: IV
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q21➡ | NTA UGC NET July 2016 Paper 2
Which of the following is not typically a benefit of dynamic linking?
I. Reduction in overall program execution time.
II. Reduction in overall space consumption in memory.
III. Reduction in overall space consumption on disk.
IV. Reduction in the cost of software updates.
i➥ I and IV
ii ➥ I only
iii ➥ II and III
iv ➥ IV only

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q22➡ | NTA UGC NET July 2016 Paper 2
Which of the following is FALSE?
i➥ The grammar S → a Sb |bSa|SS|∈, where S is the only non-terminal symbol and ∈ is the null string, is ambiguous
ii ➥ SLR is powerful than LALR.
iii ➥ An LL(1) parser is a top-down parser.
iv ➥ YACC tool is an LALR(1) parser generator.

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q23➡ | NTA UGC NET December 2015 Paper 2
Loop unrolling is a code optimization technique
i➥ that avoids tests at every iteration of the loop.
ii ➥ that improves performance by decreasing the number of instructions in a basic block.
iii ➥ that exchanges inner loops with outer loops
iv ➥ that reorders operations to allow multiple computations to happen in parallel

Show Answer With Best Explanation

Answer: I
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q24➡ | NTA UGC NET June 2015 Paper 3
Given the following grammars:
G 1 : S → AB|aaB
A → aA | ∈
B → bB | ∈

G2: S → A|B
A → aAb | ab
B → abB | ∈

Which of the following is correct?
i➥ G1 is ambiguous and G2 is unambiguous grammars
ii ➥ G1 is unambiguous and G2 is ambiguous grammars
iii ➥ Both G1 and G2 are ambiguous grammars
iv ➥ Both G1 and G2 are unambiguous grammars

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q25➡ | NTA UGC NET June 2015 Paper 2
Which one from the following is false?
i➥ LALR parser is Bottom up parser
ii ➥ A parsing algorithm which performs a left to right scanning and a right most deviation is RL (1)
iii ➥ LR parser is Bottom up parser.
iv ➥ In LL(1), the 1 indicates that there is a one – symbol look – ahead.

Show Answer With Best Explanation

Answer: II
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q26➡ | NTA UGC NET June 2015 Paper 2
Which phase of compiler generates stream of atoms?
i➥ Syntax Analysis
ii ➥ Lexical Analysis
iii ➥ Code Generation
iv ➥ Code Optimization

Show Answer With Best Explanation

Answer: I
Explanation:

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

error: Content is protected !!
Open chat
1
Hi,how Can We Help You ?