B.TECH - Semester 6 principle of programming languages Question Paper 2020 (jan)
Practice authentic previous year university questions for better exam preparation.
Sample Questions
- What is the advantage of binding things as early as possible? What is the advantage of delaying bindings?
- Differentiate between enumeration controlled loops and logically controlled loops with suitable examples.
- What are the purposes of the stack pointer and frame pointer registers? Why does a subroutine often need both?
- List and explain any four common characteristics of scripting languages.
- What is a just-in-time (JIT) compiler? What are its potential advantages over interpretation or conventional compilation? $$ (5 \times 4=20 \text { Marks) } $$ Answer any one full questions out of the two from each Module.
- (a) Discuss any three memory layouts for the record ``` struct element { char name[2]; int atomic_number; double atomic_weight; _Bool metallic; };_ ```
- (b) Differentiate between deep binding and shallow binding with suitable examples.
- (a) Explain the following implementation mechanisms to deal with dangling pointers
- (i) Tombstones (ii) Locks and Key 10
- (b) Explain the following techniques for garbage collection
- (i) Mark and sweep (ii) Reference count
- (a) Explain the tasks done by calling sequence, prolog and epilog for maintaining the stack layout.
- (b) Define recursive function for finding factorial of a number in Scheme.
- (a) Consider the code fragment given below: ``` a : integer procedure f1(b: integer) b:= 5 Print a ... a:= 10 f1 (a) print a ``` Differentiate among the terms call-by-value, call-by-reference and call-by-value / result. Explain the output for the ab...
- (b) Consider the following clauses in Prolog: rainy (trivandrum). rainy (cochin). cold (cochin). snowy (X) :- rainy (X), cold(X)
- (i) Differentiate between facts and rules in Prolog with respect to the above clauses. (ii) Write the yield of the query ? - snowy (C)
- (a) What are virtual methods? Explain with an example.
- (b) What are abstract classes? Explain the use of abstract classes.
- (c) What is a virtual method table? How is it used in member look up in dynamic method binding?
- (a) Explain the benefits of abstraction. ..... 3
- (b) Differentiate among repeated, replicated and shared inheritance. ..... 9
- (c) What are the visibility rules of $\mathrm{C}++$ ? ..... 8 Module - IV
- (a) Write short notes on implementation of threads. ..... 5
- (b) Explain busy-wait synchronization. ..... 7
- (c) Explain how semaphores are used in synchronization. ..... 8
- (a) Summarize the architecture of the Java Virtual Machine. ..... 12
- (b) Write short notes on performance analysis of a program. ..... 8