UML MCQ

UML Diagrams MCQs Questions With Answers – Part 7

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. Which UML notation is used to represent a specific object (and not a class)?

A A rectangle with the name underlined

B An oval

C A circle

D A dotted line

A
In UML, an object is a class instance. It is represented like a class but with the name underlined, for example :BankAccount.
 

2. What does the following UML diagram do?


A It shows the class hierarchy

B It illustrates the various actions a client can perform

C It manages state transitions

D It details the messages exchanged between objects

B
This is a use case diagram, used to represent a system’s functionalities from the user’s perspective.
 

3. What does the following UML diagram do?


A The content of a class

B The logical flow of a process

C The exchange of messages between objects

D Transitions from one state to another

B
This is an activity diagram that represents the workflow of a business process: here, a login attempt.
 
 

4. What does the following UML diagram do?


A The logical flow of a process

B Visualize use cases

C Show the structure of a class

D Represent the states of an object or process

D
This is a state diagram, which models the different states an object goes through (e.g., an order or a download).
 

5. What does the relationship between Animal and Dog represent?


A An association

B A composition

C A generalization (inheritance)

D A dependency

C
The <|-- symbol indicates that Dog inherits from Animal. Dog is thus a specialization of the Animal class.
 

6. What is a UML profile?

A A type of UML diagram used for database modeling.

B A mechanism for customizing UML by defining stereotypes, tagged values, and domain-specific constraints.

C A static view of the structure of a software system.

D A textual description of use cases.

B
UML profiles allow you to tailor the UML language to specific domains (e.g., real-time modeling, embedded systems) by adding extensions to the standard UML metamodel.
 
 

7. In a communication diagram (formerly collaboration diagram), how are interactions between objects represented?

A By horizontal arrows representing messages, ordered by time.

B By arrows labeled with sequence numbers indicating the message order.

C By rectangles representing objects and solid lines representing associations.

D By states and transitions triggered by events.

B
Communication diagrams focus on the structural relationships between objects involved in an interaction, and the order of messages is indicated by sequential numbering. Example:
 

Objects are represented as in an object diagram. The arrows show messages exchanged between them. The numbering (1, 1.1, 1.2) shows the order of interactions in the scenario. 
Here, a customer places an order:

  • The Client sends a request to an OrderService
  • The OrderService checks with the Stock
  • Then, it confirms the order
 

8. Which type of UML diagram is particularly useful for modeling the behavior of an object through its various states in response to events?

A Use case diagram

B Sequence diagram

C State-transition diagram

D Communication diagram

C
The state-transition diagram describes the various states an object can take throughout its life cycle and the transitions between these states triggered by events. Example of an order’s life cycle:
 

An order can be: New, Processing, Shipped, Delivered, or Cancelled.
 

9. Which of the following is not a UML diagram?

A Class diagram

B Sequence diagram

C Network diagram

D Use case diagram

C
UML does not include a network diagram. The others (class, sequence, use case) are standard UML diagrams.
 
 

10. What is the difference between a class and an object in UML?

A A class is an instance of an object

B An object is a definition of a class

C A class defines the structure, an object is an instance

D No relation between the two

C
A class describes attributes and behaviors. An object is a concrete instance of that class.
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 *