Tag: architecture

Questions Related to architecture

What will be the Output of the following JavaScript Statements? x=5+5; document.write(x); y="5"+"5"; document.write(y);

  1. x=10, y=10

  2. x=55,y=55

  3. x=10,y=55

  4. None of the above.


Correct Option: C

What will happen when you use document.write in Web page?

  1. Opens a new browser window.

  2. Holds the Title of the page.

  3. Lets you write text to the current web page.

  4. Moves the browser to a page on the browser’s history.


Correct Option: C
  1. decouple an abstraction from its implementation so that the two can vary independently

  2. One class takes in another class, both of which extend the same abstract class, and adds functionality.

  3. Assembles group of objects with same signature

  4. One class controls the creation of and access to objects in another class.


Correct Option: B
  1. The reusable and variable parts of a class are broken into two classes to save resources

  2. One class controls the creation of and access to objects in another class.

  3. One class takes in another class, both of which extend the same abstract class, and adds functionality.

  4. One class has a method that performs a complex process calling several other classes.


Correct Option: D
  1. Adapter, Bridge and Decorator.

  2. Singleton, Builder and Factory Method.

  3. Facade, Flyweight and Proxy.

  4. Iterator, Observer and Template.


Correct Option: B

Example of Decorator pattern in Java API?

  1. java.util.List

  2. java.lang.String

  3. java.io.BufferedInputStream.

  4. None of the above.


Correct Option: C

The -------------- Method pattern should be used to implement the invariant parts of an algorithm once and leaves it up to subclasses to implement the behavior that can vary.

  1. Strategy Pattern.

  2. Template Pattern.

  3. Observer Pattern.

  4. None of the above.


Correct Option: B

The Java API uses this pattern in the event model of its AWT/Swing Classes

  1. Strategy Pattern.

  2. Template Pattern.

  3. Observer pattern.

  4. None of the above.


Correct Option: C
  1. Composite Pattern

  2. Strategy Pattern

  3. Observer Pattern

  4. Factory Pattern


Correct Option: A