UML MCQ

UML Diagrams MCQs Questions With Answers – Part 12

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. What is the difference between a sequence diagram and a communication diagram?

A The sequence diagram shows interactions over time, while the communication diagram shows the objects and their relationships.

B The communication diagram shows the order of messages, while the sequence diagram shows only the objects.

C The sequence diagram does not show the messages sent between objects.

D Both diagrams are identical.

A
A sequence diagram shows the order of messages between objects, while a communication diagram emphasizes the relationships between objects, but does not follow the order of messages.
 

2. What is the nature of the relationship between Customer and Order?


A Inheritance

B Strong association

C Dependency (usage)

D Composition

C
The dashed line ..> indicates that Customer depends on Order, for example, via a parameter or a temporary method. This is not a persistent structural relationship.
 

3. What is the role of a “use case” in a use case diagram?

A It defines a service provided by the system to the actor.

B It represents a type of relationship between classes.

C It is used to model the messages between objects.

D It shows the structure of the database.

A
A use case represents a specific service or functionality that the system provides to an actor, responding to a need or request from the user.
 
 

4. What is the problem in this diagram?


A A missing arrow between the classes

B There is no constructor

C The method `viewItems()` has no visibility

D The type List is invalid in UML

C
In UML, each attribute and method must have visibility (+ public, – private, # protected). Here, the `+` is missing before `viewItems`.
 

5. What is “multiplicity” in a class diagram?

A The number of methods in a class

B The number of instances of a class that can be linked to another class

C The depth of inheritance of a class

D The type of relationship between two classes

B
Multiplicity defines how many instances of a class can be associated with an instance of another class. Example: 1..* means one or more instances.
 

6. In a sequence diagram, what does a lifeline with a vertical bar signify?


A The object is deleted

B The object is waiting for a response

C The object is active during message sending

D The object enters a waiting state

C
A vertical bar on a lifeline in a sequence diagram indicates that an object is active (sending or receiving messages). This shows that the object is being processed at that moment.
 
 

7. In a communication diagram, how are relationships between objects represented?

A By curved arrows between objects

B By dashed lines

C By rectangles with links inside

D By simple arrows connecting the objects

D
In a communication diagram, objects are connected by simple arrows indicating the exchanged messages. This shows the relationships and communication between objects. Example:
 
 

8. In a use case diagram, what type of relationship is used to link a use case to an actor?

A Inclusion

B Extension

C Association

D Generalization

C
In a use case diagram, an association links an actor to a use case. This relationship shows that the actor interacts with the use case by triggering an action. Example:
 
 

9. In UML, what is a “package”?

A An independent diagram

B A special method

C A logical grouping of classes

D A database

C
A package is used to organize UML elements (classes, interfaces…) into logical groups.
 
 

10. What type of UML relationship uses a simple arrow without a diamond?

A Composition

B Aggregation

C Association

D Deployment

C
In a use case diagram, an association links an actor to a use case. This relationship shows that the actor interacts with the use case by triggering an action.
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 *