Quiz
4100 Quiz 2
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (15)
1This type of polymorphism the same method is overridden with same signature in different classes.
- Astatic
- Bflexible
- CObject Oriented
- Ddynamic
2In this type of polymorphism methods are overridden that exist in the same class
- Arun-time
- Breliable
- Cstatic
- Ddynamic
3What is a strength of using Object Oriented Inheritance?
- AObjects with inheritance chains run faster than objects without them
- BRemoving redundant parameters in the base class constructor allows less code needed in the children
- CAdding behaviours in the children are isolated from the parent
- DAdding new behaviours in the base class makes these behaviours available to the children
4What is true about a class defined as follows:
public abstract MyClass{}- AIt can contain properties but it cannot have setter or getter methods de ned within it
- BIt cannot contain method definitions
- CIt cannot contain properties just methods
- Dif cannot be instantiated by a main program
5What would be the rationale for a developer to create the following code: This design will ...

- Aallow different implementations of getMeTheData() to work with the program
- Bpredefine the return dataType of getMeTheData() coding of the implementation can start earlier
- Cdefine just enough of the return data type so testers can prepare test cases sooner.
- Dhelp delay the definition of getMeTheData() until more information is know about its implenmentation
6Suppose you have the following class structure
(see below). What is the proper way to create a polymorphic use of the structure?
- AMyClass data2 = new DataRep1();
- BDataRep2 data2 = new DataRep1();
- CMyClass data2 = new MyClass();
- DDataRep2 data2 = new dataRep2();
7If you have the same code logic in 3 different places in your program you are likely violating
- ASOLID
- BDRY
- CYAGNI
- DKISS
8Which is of the following is not a rationale for using KISS?
- ACode is more likely to have bugs
- BThe design tradeoffs are hidden
- CIncreased debugging time
- DCode is more difficult to understand
9Which true about C# Vs Java?
- AC# recommends using List instead of ArrayList
- BArrayList is slower in C# than Java
- CC# does not support ArrayList
- DC# ArrayLists do not support a sort method
10Which is a rationale we discussed for using an interface?
- AOne class needs to utilize methods from another class
- BOne class needs to access a data structure only know in another class
- COne class needs to inherit methods from 2 different inheritance trees.
- DOne class is similar to another but needs to override certain methods
11This kind of code rot occurs when code might break in several different places from a single change
- AViscosity
- BFragility
- CImmobility
- DOpacity
- ERigidity
12In class, we discussed how code deteriorates (rots) over time. Which of the following is NOT a reason that code 'rots' provided in class?
- ADesigns are not flexible enough to handle the change over time
- BRequirements changes over time causing code to change
- CDevelopers make changes in a hurry.
- DChanges made by one development team are not properly communicated to another development team
13Suppose you are reading a colleague's code and s/he has added a method that is not used in anticipation of an upcoming customer requirement change.
What design principle does that violate?- AKISS
- BYAGNI
- CThe Law of Demeter
- DDRY
14Suppose you are reading a colleague's code and nd a method called: List<string> in = getInputFromUser();
But instead of getting input from the user, the code gets input from a database. What design principle does that violate?- APrinciple of least astonishment
- BMeasure twice cut once
- CKISS
- DDRY
15Several years ago, I was working with a colleague to deploy a new version of a web application. The new version required
1. Turning off the existing web application
2. Updating the database
3. Updating the software version
4. Testing the new code in production with the changes
5. Bringing both the DB and application back up.
We developed a small document with all the deployment steps and then held a meeting a other colleagues to review them step-by-step. Next we tested them on a redundant machine, and then refined the steps again before using them.
What design principle were we using during this deployment?- AMeasure twice cut once
- BYAGNI
- CDRY
- DKISS
Information
- Description
- Quiz on 4100 Quiz 2, created by Alexander Rojas on 26/02/2020.
- Author
- Alexander Rojas
- Language
- English
- Views
- 3
- Rating
- No ratings yet Rate this quiz