System software: compilers, interpreters, loaders, linkers, macros and debuggers. - One Line Questions
1.
Which of the following is an example of a macro processor directive? —
#define
2.
What is the key difference between a compiler and an interpreter regarding output? —
A compiler produces an executable file, while an interpreter does not.
3.
What is the main difference between a compiler and an assembler? —
A compiler translates high-level code, while an assembler translates assembly code.
4.
In the context of compilers, what is an Abstract Syntax Tree (AST)? —
A tree representation of the syntactic structure of the source code.
5.
What is a macro in the context of system software? —
A shorthand notation for a sequence of instructions that can be expanded.
6.
A 'breakpoint' in debugging refers to: —
A point where the program execution is intentionally halted.
7.
Which type of loader performs address modifications based on the memory addresses assigned to program segments? —
Relocatable Loader
8.
Which type of loader allows a program to be loaded at any memory location? —
Relocatable Loader
9.
What is the output of the lexical analysis phase of a compiler? —
Tokens
10.
Which of the following is a common technique used by debuggers to inspect program state? —
Variable watch and memory inspection
11.
Which system software helps in identifying and correcting errors in a program? —
Debugger
12.
Which system software is responsible for managing the execution of multiple programs concurrently? —
Operating System
13.
Which system software translates symbolic machine language code into machine code? —
Assembler
14.
Which system software is responsible for managing the translation of assembly language to machine code? —
Assembler
15.
Which system software is responsible for managing the loading and linking of programs and libraries? —
Loader and Linker
16.
Which of the following describes the 'just-in-time' (JIT) compilation approach? —
Translating code segments into machine code only when they are about to be executed.
17.
What is the main advantage of using a compiler over an interpreter? —
Faster execution speed of the generated code.
18.
The process of converting a high-level programming language into machine-readable code is called: —
Compilation
19.
What is the main advantage of using an interpreter for scripting languages? —
Ease of debugging and rapid prototyping.
20.
Which of the following is a characteristic of an interpreter? —
It translates and executes the source code one statement at a time.
21.
Which phase of compilation involves checking the source code for grammatical correctness according to the rules of the programming language? —
Syntax Analysis
22.
A compiler typically performs all of the following steps except: —
Runtime Execution
23.
Which phase of compilation deals with the meaning of the statements, ensuring they are logically valid? —
Semantic Analysis
24.
Which of the following is NOT a typical phase of compilation? —
Runtime Debugging
25.
Which compiler phase is responsible for checking the logical correctness and type compatibility of statements? —
Semantic Analysis
26.
Which part of the compiler is responsible for generating machine-independent intermediate code? —
Intermediate Code Generator
27.
An absolute loader is also known as a: —
Simple Loader
28.
What does a macro expansion process involve? —
Replacing a macro name with its defined sequence of instructions.
29.
A loader is responsible for which of the following tasks? —
Bringing an executable program from secondary storage into main memory.
30.
Which of the following is a disadvantage of using an interpreter? —
Slower execution speed compared to compiled programs.
31.
Which phase of compilation is also known as 'scanning'? —
Lexical Analysis
32.
A linker resolves which of the following types of references? —
External references between program modules and libraries
33.
What is 'intermediate code' in the context of compilation? —
A low-level representation of the source code, independent of the target machine.
34.
What is 'relocation' in the context of a relocatable loader? —
The process of adjusting program addresses to load it at a different memory location.
35.
What is the primary purpose of a 'runtime environment' for interpreted languages? —
To provide services for program execution, such as memory management and I/O.
36.
What is the role of a compiler in the software development lifecycle? —
To translate source code into machine code or an intermediate representation.
37.
What is the purpose of code optimization in a compiler? —
To make the code run faster or use less memory.
38.
What is the primary goal of a linker in creating an executable program? —
To combine separately compiled modules and resolve symbol references.
39.
What is a 'symbol table' used for in a compiler? —
To keep track of identifiers, their types, and scope.
40.
What is the purpose of the symbol table in a compiler? —
To store information about identifiers (variables, functions, etc.) encountered in the source code.
41.
What is the primary function of a macro processor? —
To expand macro calls into their corresponding sequences of instructions.
42.
What is the role of a linker in the software development process? —
To combine object files and libraries into a single executable program.
43.
What is the primary function of a compiler? —
To translate the entire source code of a program into an executable file before execution.
44.
What is the function of a loader's relocation mechanism? —
To adjust memory addresses in the program code and data to fit the allocated memory space.
45.
What is the primary role of a debugger in the software development process? —
To assist in finding and fixing errors in the code.
46.
What is the role of the 'code generator' in a compiler? —
To translate intermediate code into target machine code.
47.
What is the output of the syntax analysis phase of a compiler? —
Abstract Syntax Tree (AST)
48.
In the context of compilers, what does 'parsing' refer to? —
Analyzing the source code to determine its grammatical structure.
49.
Which of the following is a common type of macro processor? —
Two-pass macro assembler
50.
What does a debugger allow a programmer to do? —
Step through code execution, inspect variables, and set breakpoints.