42 Compilers · Phases questions from the Computer Science Fundamentals bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Sign up free to see every answer with its explanation and ask the AI tutor.
A.building the parse tree from the input tokens up to the start symbol by reductions, as in LR parsers
B.a program that translates an entire source program into machine or intermediate code before execution
C.a data structure storing identifiers with their types, scopes, and attributes for use across phases
D.a parse tree mirrors every grammar rule, while an abstract syntax tree keeps only meaningful structure
Answer + AI explanation with a free account
2. Which term means: "a program that translates an entire source program into machine or intermediate code before execution"?
Junior
A.compiler
B.lexical analysis
C.syntax analysis
D.parse tree vs AST
Answer + AI explanation with a free account
3. Which statement is correct?
Junior
A.compiler — building the parse tree from the input tokens up to the start symbol by reductions, as in LR parsers
B.compiler — the first compiler phase that scans source characters and groups them into tokens
C.compiler — a program that translates an entire source program into machine or intermediate code before execution
D.compiler — LL scans left-to-right with leftmost derivation top-down, while LR uses rightmost derivation bottom-up
Answer + AI explanation with a free account
4. What is interpreter?
Junior
A.a machine-independent representation, such as three-address code, generated between front and back ends
B.the first compiler phase that scans source characters and groups them into tokens
C.a program that executes source code statement by statement without producing a separate binary
D.building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
Answer + AI explanation with a free account
5. Which term means: "a program that executes source code statement by statement without producing a separate binary"?
Junior
A.token
B.parse tree vs AST
C.interpreter
D.bottom-up parsing
Answer + AI explanation with a free account
6. Which statement is correct?
Junior
A.interpreter — LL scans left-to-right with leftmost derivation top-down, while LR uses rightmost derivation bottom-up
B.interpreter — a machine-independent representation, such as three-address code, generated between front and back ends
C.interpreter — building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
D.interpreter — a program that executes source code statement by statement without producing a separate binary
Answer + AI explanation with a free account
7. What is lexical analysis?
Junior
A.a parse tree mirrors every grammar rule, while an abstract syntax tree keeps only meaningful structure
B.the phase that transforms intermediate code to run faster or use fewer resources without changing meaning
C.building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
D.the first compiler phase that scans source characters and groups them into tokens
Answer + AI explanation with a free account
8. Which term means: "the first compiler phase that scans source characters and groups them into tokens"?
Junior
A.intermediate code
B.top-down parsing
C.lexical analysis
D.code optimization
Answer + AI explanation with a free account
9. Which statement is correct?
Junior
A.lexical analysis — a program that translates an entire source program into machine or intermediate code before execution
B.lexical analysis — building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
C.lexical analysis — the first compiler phase that scans source characters and groups them into tokens
D.lexical analysis — a data structure storing identifiers with their types, scopes, and attributes for use across phases
Answer + AI explanation with a free account
10. What is token?
Junior
A.a program that executes source code statement by statement without producing a separate binary
B.a data structure storing identifiers with their types, scopes, and attributes for use across phases
C.a categorized lexical unit such as a keyword, identifier, operator, or literal
D.building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
Answer + AI explanation with a free account
11. Which term means: "a categorized lexical unit such as a keyword, identifier, operator, or literal"?
Junior
A.token
B.symbol table
C.syntax analysis
D.code optimization
Answer + AI explanation with a free account
12. Which statement is correct?
Junior
A.token — the phase that transforms intermediate code to run faster or use fewer resources without changing meaning
B.token — a categorized lexical unit such as a keyword, identifier, operator, or literal
C.token — building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
D.token — a program that executes source code statement by statement without producing a separate binary
Answer + AI explanation with a free account
13. What is syntax analysis?
Junior
A.a machine-independent representation, such as three-address code, generated between front and back ends
B.the parsing phase that builds a parse tree by checking tokens against the grammar
C.the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table
D.a categorized lexical unit such as a keyword, identifier, operator, or literal
Answer + AI explanation with a free account
14. Which term means: "the parsing phase that builds a parse tree by checking tokens against the grammar"?
Junior
A.syntax analysis
B.code optimization
C.lexical analysis
D.parse tree vs AST
Answer + AI explanation with a free account
15. Which statement is correct?
Junior
A.syntax analysis — LL scans left-to-right with leftmost derivation top-down, while LR uses rightmost derivation bottom-up
B.syntax analysis — building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
C.syntax analysis — the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table
D.syntax analysis — the parsing phase that builds a parse tree by checking tokens against the grammar
Answer + AI explanation with a free account
16. What is semantic analysis?
Mid
A.the phase that transforms intermediate code to run faster or use fewer resources without changing meaning
B.the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table
C.a program that executes source code statement by statement without producing a separate binary
D.a program that translates an entire source program into machine or intermediate code before execution
Answer + AI explanation with a free account
17. Which term means: "the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table"?
Mid
A.code generation
B.semantic analysis
C.bottom-up parsing
D.interpreter
Answer + AI explanation with a free account
18. Which statement is correct?
Mid
A.semantic analysis — the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table
B.semantic analysis — the first compiler phase that scans source characters and groups them into tokens
C.semantic analysis — the parsing phase that builds a parse tree by checking tokens against the grammar
D.semantic analysis — a program that translates an entire source program into machine or intermediate code before execution
Answer + AI explanation with a free account
19. What is intermediate code?
Mid
A.a categorized lexical unit such as a keyword, identifier, operator, or literal
B.LL scans left-to-right with leftmost derivation top-down, while LR uses rightmost derivation bottom-up
C.a machine-independent representation, such as three-address code, generated between front and back ends
D.building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
Answer + AI explanation with a free account
20. Which term means: "a machine-independent representation, such as three-address code, generated between front and back ends"?
Mid
A.code optimization
B.syntax analysis
C.intermediate code
D.token
Answer + AI explanation with a free account
21. Which statement is correct?
Mid
A.intermediate code — a categorized lexical unit such as a keyword, identifier, operator, or literal
B.intermediate code — a machine-independent representation, such as three-address code, generated between front and back ends
C.intermediate code — LL scans left-to-right with leftmost derivation top-down, while LR uses rightmost derivation bottom-up
D.intermediate code — the first compiler phase that scans source characters and groups them into tokens
Answer + AI explanation with a free account
22. What is code optimization?
Mid
A.the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table
B.LL scans left-to-right with leftmost derivation top-down, while LR uses rightmost derivation bottom-up
C.the phase that transforms intermediate code to run faster or use fewer resources without changing meaning
D.the parsing phase that builds a parse tree by checking tokens against the grammar
Answer + AI explanation with a free account
23. Which term means: "the phase that transforms intermediate code to run faster or use fewer resources without changing meaning"?
Mid
A.code optimization
B.syntax analysis
C.intermediate code
D.interpreter
Answer + AI explanation with a free account
24. Which statement is correct?
Mid
A.code optimization — a program that executes source code statement by statement without producing a separate binary
B.code optimization — the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table
C.code optimization — a program that translates an entire source program into machine or intermediate code before execution
D.code optimization — the phase that transforms intermediate code to run faster or use fewer resources without changing meaning
Answer + AI explanation with a free account
25. What is code generation?
Mid
A.the parsing phase that builds a parse tree by checking tokens against the grammar
B.the final phase that maps optimized intermediate code into target machine instructions
C.building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
D.a categorized lexical unit such as a keyword, identifier, operator, or literal
Answer + AI explanation with a free account
26. Which term means: "the final phase that maps optimized intermediate code into target machine instructions"?
Mid
A.interpreter
B.token
C.LL vs LR parsing
D.code generation
Answer + AI explanation with a free account
27. Which statement is correct?
Mid
A.code generation — the first compiler phase that scans source characters and groups them into tokens
B.code generation — the final phase that maps optimized intermediate code into target machine instructions
C.code generation — the phase that checks meaning rules like type compatibility and declared-before-use using the symbol table
D.code generation — a categorized lexical unit such as a keyword, identifier, operator, or literal
Answer + AI explanation with a free account
28. What is symbol table?
Mid
A.the final phase that maps optimized intermediate code into target machine instructions
B.a data structure storing identifiers with their types, scopes, and attributes for use across phases
C.a program that translates an entire source program into machine or intermediate code before execution
D.the phase that transforms intermediate code to run faster or use fewer resources without changing meaning
Answer + AI explanation with a free account
29. Which term means: "a data structure storing identifiers with their types, scopes, and attributes for use across phases"?
Mid
A.symbol table
B.bottom-up parsing
C.token
D.intermediate code
Answer + AI explanation with a free account
30. Which statement is correct?
Mid
A.symbol table — a data structure storing identifiers with their types, scopes, and attributes for use across phases
B.symbol table — building the parse tree from the start symbol toward the input, as in recursive-descent and LL parsers
C.symbol table — the final phase that maps optimized intermediate code into target machine instructions
D.symbol table — a parse tree mirrors every grammar rule, while an abstract syntax tree keeps only meaningful structure
Answer + AI explanation with a free account
Showing 30 of 42 Compilers · Phases questions — the full set, with answers, explanations and an AI tutor on every question, is inside.
Free to start
Answers, AI explanations, and a free readiness check
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take the free 2-minute readiness check for a scored result. One full AI mock interview, scored like a real panel, is free when you sign up.