GateAI
Intermediate Code Generation

GATE CSE 2023 · Q11

MCQ1 markEasy

Time

Consider the following statements regarding the front-end and back-end of a compiler. S1\textbf{S1}: The front-end includes phases that are independent of the target hardware. S2\textbf{S2}: The back-end includes phases that are specific to the target hardware. S3\textbf{S3}: The back-end includes phases that are specific to the programming language used in the source code. Identify the CORRECT option.

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) Only S1 and S2 are TRUE.

Intermediate Code Generation

A compiler is typically organized into two main parts:

  1. Front-End: Consists of lexical analysis, syntax analysis, semantic analysis, and intermediate code generation. These phases depend on the source programming language and are largely independent of the target machine/hardware. Therefore, S1 is TRUE.

  2. Back-End: Consists of machine-dependent code optimization, code generation, and register allocation. It operates on the intermediate representation (IR) to generate code for a specific target architecture. Thus, the back-end depends on the target hardware and is completely independent of the source language. Therefore, S2 is TRUE and S3 is FALSE.

Hence, only S1 and S2 are TRUE, which corresponds to option (B).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Intermediate Code Generation previous year question is Q11 of the GATE CSE 2023 paper. Find more GATE CSE PYQs on Intermediate Code Generation in Compiler Design, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Intermediate Code Generation PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Intermediate Code Generation in GATE CSE

Intermediate Code Generation has 14 GATE CSE PYQs across 12 papers from 2011 to 2025. 5 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2023.

How GATE tests Intermediate Code Generation

More from GATE CSE 2023

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2023 · Q11 · MCQ

Consider the following statements regarding the front-end and back-end of a compiler. S1: The front-end includes phases that are independent of the target hardware. S2: The back-end includes phases that are specific to the target hardware. S3: The back-end includes phases that are specific to the programming language used in the source code. Identify the CORRECT option.

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.