MCQ Bank
To show the present condition of the object _____________ can be used, because it sustains address to concrete state object.
- A) State
- B) Concrete State
- C) Context
- D) Function
Which one of the following provides implementation for methods described in state?
- A) Concrete State
- B) Function
- C) Context
- D) State
For the purpose of interaction, _____________ can be used to show an interface to the client.
- A) Context
- B) Concrete State
- C) Function
- D) State
Which one of the following statement will be true for state pattern?
- A) It allows an object to change its behaviour when it’s internal state changes.
- B) It allows an object to change its behaviour when it’s external state changes.
- C) It doesn't allow an object to change its behaviour when it’s external state changes.
- D) It doesn't allow an object to change its behaviour when it’s internal state changes.
______________ handle request from the ______________.
- A) Context, state
- B) Concrete State, context
- C) State, context
- D) Context, concrete state
__________ shows a certain structure in the code that represent violation of fundamental design principles and may negatively impact design quality.
- A) Move method
- B) Code smell
- C) Refactoring
- D) Extract Method
Extract method type of code refactoring helps to ___________ complexity, while ___________ the overall readability of the code.
- A) Decrease, Increasing
- B) Increase, Decreasing
- C) Increase, Increasing
- D) Decrease, Decreasing
Refactoring refers to the process of restructuring existing code without changing its external behavior, it can be applied to ___________.
- A) Java language
- B) Any programming language
- C) C/C++ Language
- D) Python language
_________ can be an indicator of the factors that contribute to technical debt.
- A) Extract Method
- B) Move method
- C) Refactoring
- D) Bad Code smell
___________ Refactoring helps to separate and group a certain code fragment whereas the old code is substituted with just a call to the method.
- A) Extract Method
- B) Move Method
- C) Factory Method
- D) Large Method
Pick the correct option for step “2” in the following java code fragment. 1. public double A=0.0, B=0.0; 2. ______________ 3. System.out.println("Value returned by A is given by, A = " +A);
- A) A= 5/3 * B.double;
- B) A= 5/3 * B = double;
- C) A= (double) 5/3 * B;
- D) A= 5/3B * double;
One of the key advantages of Extract Method type of refactoring is that it provides ______________.
- A) Less code duplication
- B) Code dependency is enhanced
- C) Merges independent parts of code
- D) Less readable code
A model in the Model View Controller (MVC) pattern is allowed to have _________.
- A) Zero views
- B) No more than two views
- C) A single view
- D) Multiple views
In Model View Controller (MVC) pattern, the responsibility of “model” component is concerned with the __________.
- A) Data-link layer
- B) Business-logic layer
- C) Transport Layer
- D) User interface layer
The Client is allowed to interact directly with _________ layer(s) in a Model View Controller (MVC) architectural pattern.
- A) Model and Controller
- B) Model
- C) View and Model
- D) View and Controller
In Model View Controller (MVC) pattern, the data in the database can be updated/modified using the __________.
- A) Controller class
- B) Model class
- C) Data-link class
- D) View class
The Client does not have the right to access which of the following layers in a Model View Controller (MVC) pattern?
- A) Controller
- B) Presentation
- C) View
- D) Model
The component that receives the events in the Model View Controller (MVC) Pattern is called _________.
- A) Observer
- B) Receiver
- C) Model
- D) Controller
Model View Controller (MVC) ensures _________ among models, views or controllers.
- A) Low cohesion
- B) Low coupling
- C) Hard modifiability
- D) High coupling
Ignoring the functionality defined in the base class is violation of ________________.
- A) ISP
- B) LSP
- C) DIP
- D) OCP