UML MCQ

UML Diagrams MCQs Questions With Answers – Part 19

Test your knowledge and boost your confidence with these multiple-choice quizzes focused on UML diagrams, foundational software engineering concepts, and real-world best practices. Designed for students, developers, and exam candidates, these MCQs offer a quick and effective way to assess your understanding and sharpen your skills.
 
 

1. To show the flow of a registration process with choices, validation, and confirmation, which diagram would you use?

A Communication Diagram

B Activity Diagram

C Sequence Diagram

D State Diagram

B
Ideal for illustrating the steps, conditions, and branches of a process. Example:
 
 

2. You are developing a banking system. How would you represent a bank account that contains several transactions?

A Dependency

B Aggregation

C Composition

D Association

C
If the account is deleted, the transactions should be too → strong composition. Example:
 
 

3. What does this relationship represent?


A An Order belongs to a Client, and a Client can place multiple Orders

B A Client can have multiple Orders, but a single Order belongs to one Client

C An Order can only be linked to one Client

D The relationship is unidirectional from Order to Client

A
This bidirectional association with multiplicity (0..* and 1) shows that a Client can have multiple Orders, and each Order belongs to a single Client.
 
 

4. What is the meaning of the arrows –> between Invoice, Client, and Product?


A Invoice owns both Client and Product

B Invoice uses Client and Product

C Invoice depends on Client but not Product

D Invoice inherits from Client and Product

B
The arrows –> show a unidirectional dependency. This means that Invoice uses Client and Product, but these are not necessarily contained within the Invoice.
 

5. If a “Bird” is a type of “Animal”, which UML relationship illustrates this direct kinship?

A Association (they intersect occasionally)

B Dependency (one needs the other for the ecosystem)

C Generalization (one is a specialized version of the other)

D Realization (the bird implements the concept of animal)

C
Generalization (or inheritance) shows an “is-a-type-of” relationship between a superclass (Animal) and a subclass (Bird). Example:
 
 

6. In a UML component diagram, what does a “component” represent?

A A subsystem or an autonomous functional part of a system.

B A diagram representing the user interface of an application.

C An object in the memory of a system.

D An actor external to the system interacting with the components.

A
A component in UML is a modular and autonomous unit of a system, typically responsible for a specific function or a subsystem. Component diagrams show how these units are connected and interact with each other.
 
 

7. What is the role of a package diagram in UML?

A Describe the class hierarchy of a system.

B Illustrate dependencies between objects.

C Organize the elements of the model into groups (packages) and describe the dependencies between them.

D Represent interactions between actors and the system.

C
The package diagram is used to organize a UML model into logical groups called packages. It shows how these packages interact or depend on each other. This helps visualize the overall structure of the system and understand the relationships between different parts of the model. Example:
 
 

8. In UML, what is the difference between generalization and specialization?

A Generalization is the process of deriving a new class from an existing class.

B Specialization is the process of defining subclasses from an existing class.

C Generalization is a special case of specialization.

D None of the answers is correct.

B
Generalization is the process where a more general class is broken down into more specific classes (specialization). Specialization is the process of defining new subclasses from an existing class. Generalization allows creating a class hierarchy, where a parent class (generalization) has child classes (specializations). Example:
 
 

9. What does an “interface” represent in a UML component diagram?

A An autonomous component that implements a specific function.

B A connection point between two components, defining a set of services that the component exposes.

C A type of component responsible for managing interactions with users.

D A class that contains data and associated behaviors.

B
An interface in a UML component diagram represents a set of services or operations that a component exposes to other components. Components use interfaces to interact with each other without needing to know the specific implementation of the component.
 
 

10. To orchestrate an “Online Order” (choose, pay, deliver), which UML diagram portrays this choreography of steps?

A Class Diagram (the actors and objects involved)

B Component Diagram (the modules of the website)

C Activity Diagram (the flow of actions)

D Deployment Diagram (where the website runs)

C
The activity diagram is ideal for visualizing the sequential and parallel flow of actions in a business process. Example:
 
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *