LL(1) errors usually come from mixing up leftmost derivation, one-symbol lookahead, nullable productions and FOLLOW-based table entries.
Attempt each question before you read its answer. One habit prevents most table errors: FOLLOW(A) contributes an entry only where the alternative can derive ε, never as a general fallback.
LL(1) parsing table method: the three checks to use on every MCQ
For
A → α, enter it under terminals inFIRST(α) - {ε}.If α is nullable, also enter it under every symbol in
FOLLOW(A).Two productions in one cell mean the grammar is not LL(1).
FIRST(α) = {a,c,ε} with FOLLOW(A) = {b,$} places A → α under a, c, b and $. Revise Parsing in Compiler Design: Top-Down and Bottom-Up Explained.
LL(1) basics MCQs: scan direction, derivation and predictive parsing
Q1. What LL(1) means
ISRO 2023
In the context of parsing techniques, LL(1) refers to:
(a) Grammars that parse the input from left to right, produce a rightmost derivation, with a lookahead of 1 symbol.
(b) Grammars that parse the input from left to right, produce a leftmost derivation, with a lookahead of 1 symbol.
(c) Grammars that parse the input from left to right, and backtrack at most once.
(d) Grammars that parse the input from right to left, produce a leftmost derivation, and backtrack at most once.
Answer: (b). The two Ls mean left-to-right scanning and leftmost derivation; the 1 means one-symbol lookahead. Option (a) describes the LR family, which also scans left to right but builds a rightmost derivation in reverse. See the solved question.
Q2. Derivation used by a top-down parser
UGC NET 2013
Which of the following derivations does a top-down parser use while parsing an input string ? The input is scanned from left to right.
(a) Leftmost derivation
(b) Leftmost derivation traced out in reverse
(c) Rightmost derivation traced out in reverse
(d) Rightmost derivation
Answer: (a). A top-down parser expands the leftmost unexpanded non-terminal, so the derivation it traces out is leftmost. Option (c) is the trap: scanning left to right while producing a rightmost derivation in reverse is what a bottom-up LR parser does. See the solved question.
Q3. Grammar required for a non-backtracking predictive parser
Beltron Programmer 2025
Which type of grammar is required for predictive (non-backtracking) top-down parsing?
(a) LL(1) grammar
(b) Ambiguous grammar
(c) LR(0) grammar
(d) Left-recursive grammar
Answer: (a). Predictive parsing needs the non-terminal plus one lookahead token to select exactly one production, which is the LL(1) condition itself. An ambiguous grammar leaves that choice undecided, a left-recursive one expands without consuming input, and LR(0) is a bottom-up class, so none of the other three supports non-backtracking top-down parsing. See the solved question.
LL(k) and grammar-class MCQs: lookahead, regular grammars and CFG-to-LL(1) rewrites
Q4. Minimum lookahead for three shared prefixes
Coal India 2020
Consider the following grammar
S → m | mn | mno
Choose correct statement from the following:
(a) The grammar is LL(4)
(b) The grammar is LL(3)
(c) The grammar is LL(2)
(d) The grammar is LL(1)
Answer: (b). At k=1 all three alternatives begin with m. At k=2, mn and mno both present mn, so the clash survives. At k=3 the three prefixes m$$, mn$ and mno are distinct, so the minimum lookahead is 3. See the solved question.
Q5. Regular grammar versus regular set
GATE 2007
Consider the following two statements:
P: Every regular grammar is LL(1)
Q: Every regular set has a LR(1) grammar
Which 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: (c). P is false: the regular grammar S → aS | aB, B → b is right-linear, yet both alternatives of S begin with a, so one lookahead cannot choose between them until the grammar is left factored. Q is true because every regular set is a deterministic context-free language, and the LR(1) class covers all of those. See the solved question.
Q6. Which rewrites the standard LL(1) conversion applies
UGC NET 2012
Which of the following is true about the standard procedure for converting a CFG into an LL(1) grammar?
(a) Remove left recursion alone
(b) Factor the grammar alone
(c) Both remove left recursion and factor the grammar
(d) Neither remove left recursion nor factor the grammar
Answer: (c). Each rewrite clears only its own defect. Eliminating left recursion replaces A → Aα | β with A → βA' and A' → αA' | ε, so the parser stops expanding A into A without consuming input; left factoring turns A → αβ | αγ into A → αA' and A' → β | γ, so one lookahead can decide. A grammar that has been left factored but is still left recursive still loops, and one free of left recursion that still shares prefixes still puts two productions in a single cell, so the standard procedure applies both rewrites wherever the defect occurs. Neither is a guarantee, though: LL(1) is confirmed only by building the table and finding no cell with two entries. See the solved question.
LL(1) failure-mode MCQ: the dangling-else ambiguity
Q7. Why the factored conditional grammar is still not LL(1)
GATE 2007
Consider the grammar with non-terminals N = {S,C,S1 },terminals T={a,b,i,t,e}, with S as the start symbol, and the following set of rules:
S --> iCtSS1|a
S1 --> eS|ϵ
C --> b
The grammar is NOT LL(1) because:
(a) it is left recursive
(b) it is right recursive
(c) it is ambiguous
(d) It is not context-free.
Answer: (c). Since e begins S1 --> eS and lies in FOLLOW(S1), both productions enter M[S1,e], exposing the ambiguity. See the solved question.
FIRST, FOLLOW and direct parsing-table entry MCQs
These three questions assume the sets themselves are already solid. If either one is shaky, work through FIRST and FOLLOW Sets MCQs: 10 Solved Questions Explained before attempting the table.
Q8. Two direct entries in a predictive parsing table
GATE 2006
Consider the following grammar:
S → F R
R → * S | ε
F → id
In the predictive parser table M of this grammar, the entries M[S, id] and M[R, $] respectively are:
(a) {S → FR} and {R → ε }
(b) {S → FR} and { }
(c) {S → FR} and {R → *S}
(d) {F → id} and {R → ε}
Answer: (a). F → id is not nullable, so FIRST(FR) = FIRST(F) = {id} and M[S,id] = S → FR. R is nullable with $ ∈ FOLLOW(R), so the $ column takes the epsilon production and M[R,$] = R → ε. The production R → *S belongs in M[R,*] instead, which is what makes option (c) the tempting misread. See the solved question.
Q9. FIRST and FOLLOW for two nullable aliases of S
GATE 2012
For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions.
S → a A b B | b A a B | ε
A → S
B → S
The FIRST and FOLLOW sets for the non-terminals A and B are
(a) FIRST(A) = {a, b, ε} = FIRST(B); FOLLOW(A) = {a, b}; FOLLOW(B) = {a, b, $}
(b) FIRST(A) = {a, b, $}; FIRST(B) = {a, b, ε}; FOLLOW(A) = {a, b}; FOLLOW(B) = {$}
(c) FIRST(A) = {a, b, ε} = FIRST(B); FOLLOW(A) = {a, b}; FOLLOW(B) = φ
(d) FIRST(A) = {a, b} = FIRST(B); FOLLOW(A) = {a, b}; FOLLOW(B) = {a, b}
Answer: (a). A → S and B → S make both aliases inherit FIRST(S) = {a,b,ε}. A sits before b in aAbB and before a in bAaB, giving FOLLOW(A) = {a,b}; B ends both alternatives, so it inherits FOLLOW(S) and picks up $ as well, giving FOLLOW(B) = {a,b,$}. Practise the full LL(1) parsing-table PYQ set.
Q10. FIRST/FOLLOW collision in the dangling-else table
GATE 2003
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: (d). This is the Q7 grammar again, with S' written for S1. FIRST(eS) = {e} and both e and $ lie in FOLLOW(S'), so the e cell receives both productions while the $ cell receives only S' → ε. That doubled cell is the ambiguity Q7 asked you to name. See the solved question.
LL(1) parsing-table completion MCQs with worked cells
Q11. Fill four numbered cells from FIRST and FOLLOW
GATE 2024, Set 2
Consider the following context-free grammar where the start symbol is 𝑆 and the set of terminals is {𝑎,𝑏,𝑐,𝑑}.
𝑆 → 𝐴𝑎𝐴𝑏 | 𝐵𝑏𝐵𝑎
𝐴 → 𝑐𝑆 | 𝜖
𝐵 → 𝑑𝑆 | 𝜖
The following is a partially-filled LL(1) parsing table
a | b | c | d | $ | |
|---|---|---|---|---|---|
S | 𝑆 → 𝐴𝑎𝐴𝑏 | 𝑆 → 𝐵𝑏𝐵𝑎 | (1) | (2) | |
A | 𝐴 → 𝜖 | (3) | 𝐴 → 𝑐𝑆 | ||
B | (4) | 𝐵 → 𝜖 | 𝐵 → 𝑑𝑆 |
Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?
Note: In the options, “blank” denotes that the corresponding cell is empty.
(a) (1) 𝑆 → 𝐴𝑎𝐴𝑏 (2) 𝑆 → 𝐵𝑏𝐵𝑎 (3) 𝐴 → 𝜖 (4) 𝐵 → 𝜖
(b) (1) 𝑆 → 𝐵𝑏𝐵𝑎 (2) 𝑆 → 𝐴𝑎𝐴𝑏 (3) 𝐴 → 𝜖 (4) 𝐵 → 𝜖
(c) (1) 𝑆 → 𝐴𝑎𝐴𝑏 (2) 𝑆 → 𝐵𝑏𝐵𝑎 (3) blank (4) blank
(d) (1) 𝑆 → 𝐵𝑏𝐵𝑎 (2) 𝑆 → 𝐴𝑎𝐴𝑏 (3) blank (4) blank
Answer: (a). FIRST(AaAb) = {a,c} fills (1); FIRST(BbBa) = {b,d} fills (2). Since FOLLOW(A) = FOLLOW(B) = {a,b}, (3) is A → ϵ and (4) is B → ϵ. See the solved question.
Q12. Complete nullable entries across c, f and $
GATE 2021, Set 1
Consider the following context-free grammar where the set of terminals is {a,b,c,d,f}.
S → d a T | R f
T → a S | b a T | ε
R → c a T R | ε
The following is a partially-filled LL(1) parsing table.
a | b | c | d | f | $ | |
|---|---|---|---|---|---|---|
S | (1) | S → daT | (2) | |||
T | T → aS | T → baT | (3) | T → ε | (4) | |
R | R → caTR | R → ε |
Which one of the following choices represents the correct combination for the numbered cells in the parsing table (“blank” denotes that the corresponding cell is empty)?
(a) (1) S → Rf (2) S → Rf (3) T → ε (4) T → ε
(b) (1) blank (2) S → Rf (3) T → ε (4) T → ε
(c) (1) S → Rf (2) blank (3) blank (4) T → ε
(d) (1) blank (2) S → Rf (3) blank (4) blank
Answer: (a). FIRST(Rf) = {c,f} puts S → Rf in cells 1 and 2. FOLLOW(T) = {c,f,$} puts T → ε in cells 3 and 4. See the solved question.
LL(1) Parser MCQs: the short revision loop and next step
Write FIRST for every right-hand side.
Write FOLLOW only for nullable alternatives.
Fill the parsing table from those sets.
Scan every cell for double entries.
Redo Q4, Q10, Q11 and Q12 without options, then revise Lexical Analysis in Compiler Design: Tokens to DFA Scanner.
For sequenced compiler-design teaching, use GATE Guidance by Sanchit Sir. For the wider course catalogue, explore GATE CS Exam Preparation.




