MCQs > IT & Programming > Compiler Design MCQs > Basic Compiler Design MCQs

Basic Compiler Design MCQ

1. Which data structure does a compiler use to solve the register allocation problem?

Answer

Correct Answer: registers interference graph

Note: This Question is unanswered, help us to find answer for this one

2. When does a memory leak happen?

Answer

Correct Answer: It happens when memory is still marked as used even after the object has been deleted.

Note: This Question is unanswered, help us to find answer for this one

3. What is the main disadvantage of the bitmapped memory allocation scheme of the manual memory management?

Answer

Correct Answer: It allocates memory too slow.

Note: This Question is unanswered, help us to find answer for this one

4. When using 'optional' keyword for declaring a lambda, such as 'optional (x y z)', what does x, y and z signify?

Answer

Correct Answer: x is a variable name, z is a binding flag and y is the default value for the variable x

Note: This Question is unanswered, help us to find answer for this one

5. Is it possible to prove the theoretical stability (that is, prove that a collection algorithm will work as expected) of a garbage collector used in conjunction with C language?

Answer

Correct Answer: It is not possible to prove the theoretical stability of any garbage collector type.

Note: This Question is unanswered, help us to find answer for this one

6. Which of the following is NOT a garbage collection algorithm?

Answer

Correct Answer: Car algorithm

Note: This Question is unanswered, help us to find answer for this one

7. What does it mean if when an algorithm "A", belongs to the O(n) algorithms:

Answer

Correct Answer: None of the above

Note: This Question is unanswered, help us to find answer for this one

8. What is the fastest way to establish a relationship between two objects?

Answer

Correct Answer: By using a hash map.

Note: This Question is unanswered, help us to find answer for this one

9. Which of the following is a dispatch macro character in Common Lisp?

Answer

Correct Answer: #

Note: This Question is unanswered, help us to find answer for this one

10. What is the main advantage of using segregated lists usage in the manual memory management?

Answer

Correct Answer: Memory management systems based on segregated lists are extremely fast

Note: This Question is unanswered, help us to find answer for this one

11. Which of the following options is NOT a technique used in "peephole optimization" of the generated code in a compiler?

Answer

Correct Answer: Optimization of the generated code by performing branching analysis algorithms which take target machine characteristics into account

Note: This Question is unanswered, help us to find answer for this one

12. What is the relationship between lexical and syntax analysis?

Answer

Correct Answer: They have no relationship with each other.

Note: This Question is unanswered, help us to find answer for this one

13. What functionality of the listed below is NOT common to a parser?

Answer

Correct Answer: Semantic errors handling in a program sources

Note: This Question is unanswered, help us to find answer for this one

14. What branching instructions type is more resource-consuming on the RISC processor?

Answer

Correct Answer: Long branch instruction

Note: This Question is unanswered, help us to find answer for this one

15. Which of the following is NOT a valid Common Lisp symbol name?

Answer

Correct Answer: #?#

Note: This Question is unanswered, help us to find answer for this one

16. What is the difference between a Static Single Assignments graph (SSAG) and a Control Flow Graph (CFG) which are used for the intermediate compiled sources representation in a compiler?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

17. What is the difference between a general binary search tree and an optimal binary search tree?

Answer

Correct Answer: An optimal binary search tree has less average expected search time as compared with a general binary search tree's one.

Note: This Question is unanswered, help us to find answer for this one

18. What is a generated code optimization method which is NOT suitable for use in a compiler?

Answer

Correct Answer: Code branching prediction

Note: This Question is unanswered, help us to find answer for this one

19. What is the advantage of using a suballocator in a memory management system?

Answer

Correct Answer: It obtains large blocks of memory from the system memory manager and allocates the memory to the application in smaller pieces.

Note: This Question is unanswered, help us to find answer for this one

20. Which of the following problems prevents garbage collectors from being used in the real-time systems?

Answer

Correct Answer: They can make real-time systems hang for some period of time.

Note: This Question is unanswered, help us to find answer for this one

21. What is the return value of the subtype "predicate", in case it CANNOT decide what is the relation between types it is asked about?

Answer

Correct Answer: It will return (nil nil)

Note: This Question is unanswered, help us to find answer for this one

22. Is garbage collection available in Common Lisp implementations?

Answer

Correct Answer: Yes, in all implementations.

Note: This Question is unanswered, help us to find answer for this one