Categories

UML Interview Questions and Answers

1. What are UML Diagrams?

UML Diagrams stands for Unified Modeling Language. It is a standard which is mainly used for creating object-oriented, meaningful documentation models for any software system present in the real world. It provides us a way to develop rich models that describe the working of any software/hardware systems.

UML serves a great way of creating professional documentation which is a necessary part of any project development. UML is an essential part of creating an object-oriented design of systems. It provides you means for creating powerful models and designs for rational systems which can be understood without much difficulties.

2. What is a model?

A Model is an abstraction of something to understand it before building it. As modeling omits unimportant details, it is easier to manipulate than the original entity. A model means organizing something with a particular purpose.

A model is a simplification of reality.

1) Blueprint of system

2) Organization of the system

3) Dynamic of the system

3. What is UML Relationship?

Relationships in UML are used to represent a connection between structural, behavioral, or grouping things. It is also called a link that describes how two or more things can relate to each other during the execution of a system. Type of UML Relationship are Association, Dependency , Generalization , and Realization.

4. What is Class in UML Diagram?

A Class in UML diagram is a blueprint used to create an object or set of objects. The Class defines what an object can do. It is a template to create various objects and implement their behavior in the system. A Class in UML is represented by a rectangle that includes rows with class names, attributes, and operations.

5. What is Class Diagram?

A Class Diagram in Software engineering is a static structure that gives an overview of a software system by displaying classes, attributes, operations, and their relationships between each other. This Diagram includes the class name, attributes, and operation in separate designated compartments. Class Diagram helps construct the code for the software application development.

Class Diagram defines the types of objects in the system and the different types of relationships that exist among them. It gives a high-level view of an application. This modeling method can run with almost all Object-Oriented Methods. A class can refer to another class. A class can have its objects or may inherit from other classes.

6. What is Object Diagram in UML?

An Object Diagram describes the instance of a class. It visualizes the particular functionality of a system. The difference between the class and object diagram is that the class diagram mainly represents the bird’s eye view of a system which is also referred to as an abstract view.

Objects are the real-world entities whose behavior is defined by the classes. Objects are used to represent the static view of an object-oriented system. We cannot define an object without its class. Object and class diagrams are somewhat similar.

7. What is the Use Case Diagram?

Use Case Diagram captures the system’s functionality and requirements by using actors and use cases. Use Cases model the services, tasks, function that a system needs to perform. Use cases represent high-level functionalities and how a user will handle the system. Use-cases are the core concepts of Unified Modelling language modeling.

8. What is a State Machine Diagram?

State Diagram are used to capture the behavior of a software system. UML State machine diagrams can be used to model the behavior of a class, a subsystem, a package, or even an entire system. It is also called a Statechart or State Transition diagram.

9. What is a Statechart Diagram?

Statechart diagrams provide us an efficient way to model the interactions or communication that occur within the external entities and a system. These diagrams are used to model the event-based system. A state of an object is controlled with the help of an event. Statechart diagrams are used to describe various states of an entity within the application system.

10. What is an Activity Diagram in UML?

ACTIVITY DIAGRAM is basically a flowchart to represent the flow from one activity to another activity. The activity can be described as an operation of the system. The basic purpose of activity diagrams is to capture the dynamic behavior of the system.. It is also called object-oriented flowchart.

11. Why use Activity Diagrams?

Activity diagram in UML allows you to create an event as an activity which contains a collection of nodes joined by edges. An activity can be attached to any modeling element to model its behavior. Activity diagrams are used to model,

1) Use cases

2) Classes

3) Interfaces

4) Components

5) Collaborations

12. What is Interaction Diagram?

Interaction Diagram are used in UML to establish communication between objects. It does not manipulate the data associated with the particular communication path. Interaction diagrams mostly focus on message passing and how these messages make up one functionality of a system. Interaction diagrams are designed to display how the objects will realize the particular requirements of a system. The critical component in an interaction diagram is lifeline and messages.

13. What is Component Diagram in UML?

UML Component Diagrams are used for modeling large systems into smaller subsystems which can be easily managed. UML Component diagrams are used to represent different components of a system. When modeling large object-oriented systems, it is necessary to break down the system into manageable subsystems.

14. What is Component in OOAD?

A Component is a replaceable and executable piece of a system whose implementation details are hidden. A component provides the set of interfaces that a component realizes or implements. Components also require interfaces to carry out a function.

It is a modular part of a system that encapsulates its contents. They are the logical elements of a system that plays an essential role during the execution of a system.

A component is similar to a black box whose external behavior is defined by a provided interface and required interfaces.

15. What is Deployment Diagram?

Deployment Diagram is a type of diagram that specifies the physical hardware on which the software system will execute. It also determines how the software is deployed on the underlying hardware. It maps software pieces of a system to the device that are going to execute it.

The deployment diagram maps the software architecture created in design to the physical system architecture that executes it. In distributed systems, it models the distribution of the software across the physical nodes.

16. What is an artifact?

An artifact represents the specification of a concrete real-world entity related to software development. You can use the artifact to describe a framework which is used during the software development process or an executable file. Artifacts are deployed on the nodes. The most common artifacts are as follows,

1. Source files

2. Executable files

3. Database tables

4. Scripts

5. DLL files

6. User manuals or documentation

7. Output files

17. What is Aggregation?

Aggregation is a special case of association when an object ‘has-a’ another object, which you can have an aggregation between them. The direction between them helps you to specify which object contains the other object. Aggregation is also known as a “Has-a” relationship. It is a subtype of an association relationship in UML.

18. What is Composition?

The composition is a special case of Aggregation that helps you to specify a whole-part relationship between the composition class and a subordinate (part) class.

19. Association Vs. Aggregation Vs. Composition

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast

Association

Aggregation

Composition

Association relationship is denoted using an arrow.

Aggregation relationship is denoted using a straight line with an empty arrowhead at one end.

Composition relationship is denoted using a straight line with a filled arrowhead at any one of the ends.

Association can exist between two or more classes in UML.

Aggregation is a part of an association relationship.

The composition is a part of an association relationship.

There can be one-one, one-many, many-one, and many-many association present between the association classes.

Aggregation is considered as a weak type of association.

The composition is considered as a strong type of association.

In an association relationship, one or more objects can be associated with each other.

In an aggregation relationship, objects that are associated with each other can remain in the scope of a system without each other.

In a composition relationship, objects that are associated with each other cannot remain in the scope without each other.

Objects are linked with each other.

Linked objects are not dependent upon the other object.

Objects are highly dependent upon each other.

In UML Association, deleting one element may or may not affect another associated element.

In UML Aggregation, deleting one element does not affect another associated element.

In UML Composition, deleting one element affects another associated element.

20. Things in UML

A thing can be described as any real-world entity or an object. Things are divided into various categories in UML as follows,

1) Structural things

2) Behavioral things

3) Grouping things

4) Annotational things