Lesson 1.2.2b

1.2.2b Translators, compilation stages, linkers and loaders Quiz: OCR Computer Science, Unit 2

20 questions

In partnership with Revision Ninja

Lesson 1.2.2b, Translators, compilation stages, linkers and loaders: 20 multiple choice questions for the OCR Computer Science (H446), Unit 2: Software and software development, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. What type of translator converts high-level source code into machine code line by line at runtime?

    • Interpreter
    • Compiler
    • Linker
    • Assembler
  2. Which stage of compilation removes comments and whitespace from source code?

    • Optimisation
    • Code generation
    • Syntax analysis
    • Lexical analysis
  3. What replaces keywords, constants, and identifiers during the lexical analysis stage?

    • Tokens
    • Symbol tables
    • Op-codes
    • Parse trees
  4. Which compilation stage checks that code follows the grammatical rules of the programming language?

    • Syntax analysis
    • Code generation
    • Optimisation
    • Lexical analysis
  5. What is the main purpose of the code optimisation stage during compilation?

    • Remove source comments
    • Improve execution efficiency
    • Generate initial tokens
    • Check syntax rules
  6. Which tool combines multiple compiled object code files into a single executable file?

    • Assembler
    • Linker
    • Interpreter
    • Loader
  7. What is the primary role of an operating system loader?

    • Compile high-level code
    • Translate source code
    • Load executables into RAM
    • Link external libraries
  8. Which type of linker embeds library code directly into the executable file at compile time?

    • Dynamic linker
    • Lexical analyser
    • Static linker
    • Runtime loader
  9. Where are identifier names, data types, and scope information stored during compilation?

    • Symbol table
    • Call stack
    • System registry
    • Parse tree
  10. Which translator converts low-level assembly language directly into executable machine code?

    • Interpreter
    • Compiler
    • Transpiler
    • Assembler
  11. What intermediate code is generated by compiling Java source code before execution on a virtual machine?

    • Assembly code
    • Bytecode
    • Machine code
    • Source code
  12. An error message stating 'Mismatched brackets' is produced during which compilation stage?

    • Lexical analysis
    • Syntax analysis
    • Optimisation
    • Code generation
  13. Where is a new variable identifier stored during lexical analysis?

    • Symbol table
    • Control stack
    • Data dictionary
    • Heap memory
  14. Which compilation output contains machine instructions but still requires memory address resolution?

    • Source code
    • Bytecode file
    • Object code
    • Executable file
  15. Which system utility converts relative memory addresses in an executable into absolute RAM addresses?

    • Loader
    • Assembler
    • Linker
    • Compiler
  16. Which stage of compilation checks for semantic errors, such as type mismatch in variable assignments?

    • Code generation
    • Semantic analysis
    • Lexical analysis
    • Syntax analysis
  17. What is a major advantage of using an interpreter instead of a compiler during software development?

    • Source code protection
    • Easier error debugging
    • Optimised machine code
    • Faster execution speed
  18. Which compiler generates executable code intended to run on a different operating system or architecture?

    • Just-in-time compiler
    • Cross compiler
    • Bytecode compiler
    • Decompiler
  19. Which stage of compilation translates the checked syntax tree into machine code or assembly language instructions?

    • Code optimisation
    • Semantic analysis
    • Code generation
    • Lexical analysis
  20. What is a main advantage of using intermediate code like Java bytecode?

    • Direct hardware control
    • Faster compilation
    • No virtual machine
    • Platform independence

All OCR Computer Science quizzes