Monday, August 7, 2017

UML Interview Questions Step by Step

UML:

Q1: What is UML?
Ans:
  1. UML is Unified Modeling Language.
  2. It is a graphical language for visualizing, specifying, constructing and documenting the artifacts of the system.
  3. It allows you to create a blue print of all the aspects of the system, before actually physically implementing the system.


Q2: What is modeling?
Ans:
Modeling is a proven and well-accepted engineering technique which helps build a model. Model is a simplification of reality; it is a blueprint of the actual system that needs to be built.

Q3: What are the advantages of creating a model?
Ans:
  1. Model helps to visualize the system.
  2. It helps to specify the structural and behavior of the system.
  3. It helps to make templates for constructing the system.
  4. It also helps to document the system.

Q4: What are the different views that are considered when building an object-oriented software system?
Ans:
Normally there are 5 views.
  1. Use Case view - This view exposes the requirements of a system.
  2. Design View - Capturing the vocabulary.
  3. Process View - modeling the distribution of the systems processes and threads.
  4. Implementation view - addressing the physical implementation of the system.
  5. Deployment view - focus on the modeling the components required for deploying the system.

Q5: What are diagrams?
Ans:
Diagrams are graphical representation of a set of elements most often shown made of things and associations.

Q6: What are the major three types of modeling used?
Ans:
Major three types of modeling are structural, behavioral, and architectural.

Q7: Mention the different kinds of modeling diagrams used?
Ans:
There are 9 types of Modeling diagrams.
  1. Use case diagram,
  2. Class Diagram,
  3. Object Diagram,
  4. Sequence Diagram,
  5. statechart Diagram,
  6. Collaboration Diagram,
  7. Activity Diagram,
  8. Component diagram,
  9. Deployment Diagram.
Q8:What is Architecture?
Ans:
Architecture is not only taking care of the structural and behavioral aspect of a software system but also taking into account the software usage, functionality, performance, reuse, economic and technology constraints.

Q9: What is SDLC?
Ans:

SDLC is Software Development Life Cycle. It includes various processes that are Use case driven, Architecture centric, Iterative and Incremental.

This Life cycle is divided into phases. Phase is a time span between two milestones.

The milestones are Inception, Elaboration, Construction, and Transition. Process Workflows that evolve through these phase are Business Modeling, Requirement gathering, Analysis and Design, Implementation, Testing, Deployment. Supporting Workflows are Configuration and change management, Project management.

Q10: What are Relationships?
Ans:
There are different kinds of relationships:
  1. Dependencies,
  2. Generalization,
  3. and Association.

Dependencies:

Dependencies are relationships between two entities that a change in specification of one thing may affect another thing. Most commonly it is used to show that one class uses another class as an argument in the signature of the operation.

Generalization:

Generalization is relationships specified in the class subclass scenario, it is shown when one entity inherits from other.

Association:
Associations are structural relationships that are: a room has walls, Person works for a company.

Aggregation(Association):

Aggregation is a type of association where there is a has a relationship, That is a room has walls, if there are two classes room and walls then the relationship is called an association and further defined as an aggregation.

Aggregation is the typical whole/part relationship. This is exactly the same as an association with the exception that instances cannot have cyclic aggregation relationships (i.e. a part cannot contain its whole).

Composition:
Composition is exactly like Aggregation except that the lifetime of the 'part' is controlled by the 'whole'. This control may be direct or transitive. That is, the 'whole' may take direct responsibility for creating or destroying the 'part', or it may accept an already created part, and later pass it on to some other whole that assumes responsibility for it.

Q11: How are the diagrams divided?
Ans:

Classification of diagram:
9 diagrams are divided into 2 types.

  • static diagrams
  • and dynamic diagrams.

Static Diagrams (Also called Structural Diagram):
  1. Class diagram,
  2. Object diagram,
  3. Component Diagram,
  4. Deployment diagram.

Dynamic Diagrams (Also called Behavioral Diagrams):
  1. Use Case Diagram,
  2. Sequence Diagram,
  3. Collaboration Diagram,
  4. Activity diagram,
  5. Statechart diagram.

Q12: What are Messages?
Ans:

A message is the specification of a communication, when a message is passed that results in action that is in turn an executable statement.

Q13: What is an Use Case?
Ans:

  • A use case specifies the behavior of a system or a part of a system,
  • It is used to capture the behavior that need to be developed.
  • It involves the interaction of actors and the system.

Resource Link:

Q14: Can you explain ‘Extend’ and ‘Include’ in use cases?
Ans:
‘Extend’ and ‘Include’ define relationships between use cases. Below figure ‘Extend and Include’ shows how these two fundamentals are implemented in a project. The below use case represents a system which is used to maintain customer. When a customer is added successfully it should send an email to the admin saying that a new customer is added. Only admin have rights to modify the customer. First lets define extend and include and then see how the same fits in this use case scenario.

Include: Include relationship represents an invocation of one use case by the other. If you think from the coding perspective its like one function been called by the other function.

Extend: This relationship signifies that the extending use case will work exactly like the base use case only that some new steps will inserted in the extended use case.


Scenerio#1:

I often use this to remember the two:

My use case: I am going to the city.

includes -> drive the car

extends -> fill the petrol

"Fill the petrol" may not be required at all times, but may optionally be required based on the amount of petrol left in the car. "Drive the car" is a prerequisite hence I am including.

Scenerio#2:
Extend is used when a use case adds steps to another first class use case.

For example, imagine "Withdraw Cash" is a use case of an ATM machine. "Access Fee" would extend Withdraw Cash and describe the conditional "extension point" that is instantiated when the ATM user doesn't bank at the ATM's owning institution. Notice that the basic "Withdraw Cash" use case stands on its own, without the extension.

Include is used to extract use case fragments that are duplicated in multiple use cases. The included use case cannot stand alone and the original use case is not complete without the included one. This should be used sparingly and only in cases where the duplication is significant and exists by design (rather than by coincidence).

For example, the flow of events that occurs at the beginning of every ATM use case (when the user puts in their ATM card, enters their PIN, and is shown the main menu) would be a good candidate for an include.


No comments:

Post a Comment