[PDF] Design Patterns Exam Questions





Previous PDF Next PDF



CSE 331 – Section 10 – Design Patterns and Final Exam Practice

CSE 331 – Section 10 – Design Patterns and Final Exam Practice Problems. In the projects we built this quarter we wound up using a lot of classic design 



Patterns Example Exam Questions

٢٣‏/١١‏/٢٠٠٩ The Composite design pattern is used to compose classes into tree structures in order to represent containment relationships.



CISC 323 (Week 10) Design Patterns

You do not need to write any code for this question. Mar. 15 & 17 2004. Jeremy Bradbury (CISC 323). Past Midterm/Exam Questions.



Patterns Example Exam Questions

٢٧‏/١١‏/٢٠١٤ For each of the following scenarios state which design pattern(s)



Final Exam Question 1a We have used the term “program to an

Inheritance thus would better represent the domain problem. Question 2. We discussed architectural styles architectural design patterns and basic design 



a structured approach to teach design patterns

٢٠‏/١٢‏/٢٠٢٢ via several exercises in the online quiz (questions 1-4). The first two questions were simple exercises about the relation of programs and.



Schedule Software Design Patterns Final Exam Questions

What are the major components of an ABAS a design pattern



Solutions to Final Exam: Elaboration and Design Patterns

This test has 4 questions and pages numbered 1 through 9. Exam Process. Question 1 can be done at any time and should be turned in at the end of the test 



Final exam

٠٤‏/٠٦‏/٢٠١٢ It contains 27 questions and ... (3 points each) Mark the single best choice by circling the appropriate letter. 5. A design pattern used to ...



Patterns Example Exam Questions

Nov 23 2009 The Composite design pattern is used to compose classes into tree structures in order to represent containment relationships.



Design Patterns Exam Questions

TDDB84. Design Patterns. Exam. Tid: 14-18. October 15 2005. Place: Ter1 (Terra) Give an example where the Singleton design pattern would be useful.



CISC 323 (Week 10) Design Patterns

the difference between a design pattern and an architectural style? Mar. 15 & 17 2004. Jeremy Bradbury (CISC 323). Past Midterm/Exam Questions.



CISC 323 (Week 10) Design Patterns

Mar 22 2005 You do not need to write any code for this question. Mar. 22



Solutions to Final Exam: Elaboration and Design Patterns

This test has 4 questions and pages numbered 1 through 9. Exam Process. Question 1 can be done at any time and should be turned in at the end of the test 



Design Patterns Review

I have no idea what's in the exam. Design patterns are a key part of “lower level” software engineering and it's easy to write exam questions about them.



CS 494 Exam 2

Question 1 (30 points): For the design patterns that we have studied since the first exam give a BREIF description of each. The description should include 



Final exam

Final exam. Monday June 4



Patterns Example Exam Questions

Nov 27 2014 C Give an example of the use of the <Name> pattern



Final Exam Question 1a We have used the term “program to an

Inheritance thus would better represent the domain problem. Question 2. We discussed architectural styles architectural design patterns and basic design 

Design Patterns Exam Questions

TDDB84

Design Patterns

Exam

Tid: 14-18

October 15, 2005

Place: Ter1 (Terra)

solution sheets. Please also observe the following, otherwise it might lead to subtraction of points. Write only the answer to one task on one sheet. Use only the front side of the sheets (answers to subtasks can be on one page). solution sheets according to the task number.

3) Svaren får vara på svenska eller engelska. Answers may be in English or Swedish.

tolkning. Your answers should clearly show solution methods, reasons, and arguments. Short answers should be motivated. If you are in doubt, write a remark. and the articles are NOT allowed.

1 Singleton (3 points)

Give an example where the Singleton design pattern would be useful.

2 Design patterns general knowledge (10 points)

Having the following design patterns, please partition them into: creational design patterns structural design patterns and behavioral design patterns: (a) Abstract Factory (b) Facade (c) Proxy (d) Singleton (e) Observer (f) Prototype

3 Design pattern characteristics (10 points)

What are the common and different characteristics of the Bridge and the Strategy design patterns?

4 Shell command (2 point)

Which design pattern is used by your shell to realize a command like: ls -l * | cut -f1,2 | sort

Observation:

It is totally irrelevant what the three commands do, and you do not even need to know what they are doing.

5 Design Pattern recognition (10 points)

Consider the following UML diagram.

+Update() Model +Update() -state -view : ConcreteView

ConcreteModel

+Attach() +Detach() +Notify() -models : Model View +GetState() +SetState() -state

ConcreteView

return state state = view->GetState() for all m in models m->Update() models view

Tasks:

(a) First, identify the pattern in the diagram. (b) Second, identify the participants in the diagram and indicate their responsibilities.

6 Evaluation of integer trees (15 points)

Consider the following UML diagram. In the ArithmeticExpression the operator is of type char and can have one of the following values: '+' and '-'.

Tasks:

(a) What pattern is represented by the diagram? (b) Change the class diagram to implement an interpreter over arithmetic expressions. (c) Sketch the methods added to the diagram at section (b) (d) Changes the class diagram obtained in section (b) and add new classes (and methods to the old ones) to implement a visitor over the integer trees. (e) Sketch the new methods added to the class diagram (both for the existing classes and for the new ones) at section (d). For the visitor methods consider just printing out the tree contents.

7 Tetris (5 points)

A Tetris field is essentially a big collection of stones, some representing empty fields, and some representing parts of a Tetris block, either just falling or landed at the bottom of the play ground some time ago. Whenever a block lands, it dissembles into its individual stones, which are considered independent from then on. It makes sense, therefore, to represent each stone by an individual object in an object-oriented Tetris application. Doing so naively results in a large amount of objects being allocated, deleted, and moved all the time. Task: What design pattern can be applied to optimize this, taking advantage of the fact that the stones are really very similar? Motivate your answer.

8 Ray-tracing (15 points)

Ray-tracing is a technology for generating photo-realistic images from scene description data. Very advanced types of this technology have recently been used for creating quite a few, and very impressive, animated pictures (such as "Shrek", or "Nemo"). Imagine you have to realize a ray-tracer application. At the core of such an application is a data structure, which maintains and represents the scene graph or the "world". Objects can be very simple objects, which have a geometrically defined shape and a typically algorithmically defined material, but they can also be arbitrarily complex compositions of other objects. The scene graph is then repeatedly traversed to check for intersections with various optical rays.

Tasks:

(a) Design a class structure, which can represent a scene graph. Which design pattern is applicable? (b) It is often useful to be able to transform existing objects in a scene graph, for example by moving, scaling or rotating them. This should be possible for simple and complex objects alike. Enhance the class structure from the previous subtask to enable transformation of objects. Which design pattern do you use? (c) When transforming an object it is typical to construct the transformation from the basic transformation (scaling, rotation, and translation) by putting them in a sequence of transformation operations. Extend the class structure to represent such sequences of transformations. Discuss different solutions. (d) When tracing complex objects it is often worthwhile to first check whether the ray will ever intersect their bounding box (i.e., the smallest box completely enclosing the object). Enhance the class structure to add this functionality. What design pattern could you use? Are there other ways of doing it?

9 Drinking habits (5 points)

Consider the following inheritance hierarchy.

Person

Employee Student

Professor PhD student

Each Person provides a method drink, which encapsulates the drinking behavior of the person. Task: Add runtime tracing of drinking behavior. You should be able to switch tracing on or off for any object in the hierarchy at runtime. If tracing is on, the system logs when a person starts and when it stops drinking. Which design pattern could you use? What does your solution look like?

10 Flight booking (10 points)

Suppose you should design an application, which enables clients to book the cheapest flight to a destination of their choice from a number of providers.

Tasks:

(a) Assume, every provider is known in advance, and implements an interface IFlightProvider, which provides operations for querying for a connection, and for booking a flight. In this application you will need a way to enable clients to interface to these providers and book the cheapest flight on offer for the destination and date they ar e interested in. Flight pr oviders should require (and receive) no knowledge on other flight providers known to the system. Which design pattern could you use? (b) Many airlines offer on-line booking services as web services. How can you incorporate such an airline as a flight provider in the system above?

11 Generic event-driven simulator (15 points)

Consider a generic event-driven simulator, i.e. a simulator skeleton that may simulate a wide range of systems. The simulator contains a queue of events and a variable indicating the simulated time. Each event has a time stamp that indicates the time at which the event will occur. The queue contains events, which are sorted in the ascending order of the time at which the events occur. The generic event-driven simulator executes the following infinite loop provided by the simulate method of class GenericSimulator: abstract class GenericSimulator protected State newState, oldState; protected double simulatedTime; protected EventQueue eventQueue; protected Event currentEvent; public abstract State consequences(State oldState, Event event); public abstract void actions(State newState, State oldState); public void simulate() while (true) simulatedTime = eventQueue.top().time; currentEvent = eventQueue.pop().event; newState = consequences(oldState, currentEvent); actions(newState, oldState); oldState = newState; } while (simulatedTime <= eventQueue.top().time);

Tasks:

(a) The design of the generic event-driven simulator is based (partly) on a design pattern. Which design pattern? Motivate your answer. If unsure, motivate other alternatives that you consider. (b) The GenericSimulator is given above. Why are some methods abstract?

Consider that you have to write a simula

tor for a specific system, let us call it

WeatherSimulator

. Draw the class hierarchy of this specific simulator. (c) Could you use any of the Abstract Factory or Factory Method design patterns in order to generate system-specific events? Motivate your answer. (d) How would you implement different specific simulators using the Strategy design pattern? Consider changing the given code. Draw the class diagram of the improved system.quotesdbs_dbs2.pdfusesText_4
[PDF] design patterns explained pdf

[PDF] design patterns final exam

[PDF] design patterns for beginners

[PDF] design patterns for dummies pdf

[PDF] design patterns for mobile applications ppt

[PDF] design patterns in c++ github

[PDF] design patterns in c++ tutorial pdf

[PDF] design patterns in java pdf

[PDF] design patterns in java with real life examples

[PDF] design patterns in ooad pdf

[PDF] design patterns in swift 5

[PDF] design patterns in swift medium

[PDF] design patterns interview questions

[PDF] design patterns ios

[PDF] design patterns java