JNTU

JNTU B.Tech IV DESIGN PATTERNS Previous Question Paper (October/November - 2020 - R15)

B.Tech | IV | I | R15 | October/November - 2020

Answer PaperPaper Code: 127CFMaximum Marks: 75Time: 2 hours

Answer any Five Questions. All Questions Carry Equal Marks.

Main

115 marks
a

How a Design pattern solves the Design problem? Illustrate with an example.

8 marks

Answer

A design pattern solves a design problem by providing a proven, reusable solution to a recurring challenge in software architecture. Instead of reinventing the wheel, a pattern captures the intent, motivation, and consequences of a design decision, allowing developers to communicate complex structures using a common vocabulary.

A pattern typically addresses a problem by identifying the specific objects and classes involved, their responsibilities, and the way they collaborate. It focuses on decoupling components to ensure flexibility and maintainability.

For example, the Strategy Pattern solves the problem of needing to switch between different algorithms at runtime. Rather than using hard-coded conditional statements (if-else or switch) to select behavior, the pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. This allows the algorithm to vary independently from the clients that use it, adhering to the Open/Closed Principle.

b

Explain in detail object composition with example of Delegation.

7 marks

Answer

Object composition is a technique where complex functionality is achieved by assembling simpler objects rather than inheriting behavior from a superclass. It promotes loose coupling and allows for dynamic behavior modification at runtime, whereas inheritance is static and fixed at compile time.

Delegation is a specific form of composition where an object handles a request by passing it to a second object (the delegate) that performs the actual work. The delegating object maintains a reference to the delegate and calls its methods to fulfill the request.

Consider a Window class that needs to handle printing. Instead of inheriting from a Printer class, the Window object contains a reference to a Printer object:

class Window { private Printer printer; public void print() { printer.printContents(); } }

In this example, the Window delegates the printing task to the Printer. This design is highly flexible because the Window can switch its Printer instance at runtime (e.g., switching from a LaserPrinter to an InkjetPrinter) without changing the Window class itself.

215 marks
a

How To Select a Design Pattern? Explain.

7 marks

Answer

Sign in to view the complete answer paper.

b

List and explain Design Pattern Elements.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

List and explain seven problems in Lexis's design.

7 marks

Answer

Sign in to view the complete answer paper.

b

Draw and explain the interaction diagram for the spelling checking.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

The Singleton uses a special method to instantiate objects. What is special about this method?

8 marks

Answer

Sign in to view the complete answer paper.

b

What are the implementation issues of Prototype Design pattern? Discuss.

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Write about Class Adapter Pattern and list the pros and cons of it.

8 marks

Answer

Sign in to view the complete answer paper.

b

Draw and explain the structure of bridge pattern.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain the implementation of Pluggable Adapters with abstract operations.

8 marks

Answer

Sign in to view the complete answer paper.

b

List and explain benefits and drawbacks of bridge pattern.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

What are the Consequences of the Interpreter? Discuss.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write about the implementation issues of Memento pattern.

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Draw and explain strategy pattern Class Diagram for Mobile Computer.

8 marks

Answer

Sign in to view the complete answer paper.

b

Describe the Implementation of State pattern.

7 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of DESIGN PATTERNS from JNTU for B.Tech IT IV I, October/November - 2020, R15.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in DESIGN PATTERNS

Loading Question Papers

Fetching data from database...