UML MCQ

UML Diagrams MCQs Questions With Answers – Part 16

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 diagram is used to represent an inheritance hierarchy between classes?

A Activity Diagram

B Object Diagram

C Use Case Diagram

D Class Diagram

D
The Class Diagram allows modeling inheritance between classes using generalization arrows (white triangle pointing to the parent class). Example:
 
 

2. What is the function of the note in this diagram?


A Hide a class

B Add a comment or annotation

C Create an interactive label

D Generate an automatic description

B
UML notes allow documenting a diagram. They do not change the logic but enhance human understanding.
 

3. Which UML keyword indicates that a use case can sometimes add behavior to another?

A <<use>>

B <<generalize>>

C <<extend>>

D <<include>>

C
The <<extend>> stereotype is used to add optional behavior to a use case under certain conditions. The extension is not always executed, unlike <<include>>. Example:
 
 
 

4. Which UML element can represent a conditional decision in an activity diagram?

A An activity

B A transition

C A state

D A decision node (diamond)

D
Decisions are represented by diamonds with multiple possible outputs depending on the condition. Example:
 
 

5. What does this diagram represent?


A A use case diagram

B A sequence of user actions

C A relational model between business entities

D An automated business process

C
This class diagram with multiplicity models a business relationship:

  • A Customer can place several Orders
  • Each Order contains one or more Products
 

6. Which UML notation expresses a constraint on a class diagram?

A Curly braces {}

B Square brackets []

C Double arrows <<>>

D Parentheses ()

A
Constraints (such as {ordered}, {unique}, {readOnly}) are written between curly braces. They specify additional rules in the UML model. Example:
 

We have a Cart class containing items and a {unique} constraint on the attribute idArticle to ensure no idArticle is repeated.
 
 

7. What does the <<boundary>> stereotype represent in a class diagram?

A A class containing business rules

B A class that interacts with the outside of the system (user interface, external systems)

C A class representing a calculation

D A class used only for data storage

B
The <<boundary>> stereotype represents boundary classes that handle interaction with the outside of the system. This could be a user interface, a server, or another external system. Example:
 
 

8. This diagram represents _______________


A Software components communicating with each other

B An interaction between objects

C The structure of a database

D A hardware deployment with software components

D
This diagram shows the deployment of software components (Application, WebClient) on hardware nodes (server and client).
 

9. In a state diagram, what is a transition?

A An action performed during a state change

B An event that triggers a state change

C The condition under which a state can be reached

D An intermediate state between two transitions

B
A transition in a state diagram is an event that causes a state change in an object. It is represented by an arrow from one state to another. Example:
 

The transition to Paid occurs when the pay event happens. The cancel event triggers the transition to Refunded.
 
 

10. The Mage is a specialization of the Character class. Which UML relationship will you use?

A Association

B Dependency

C Realization

D Generalization

D
The Mage inherits characteristics from Character, so it is a generalization (inheritance) relationship. Example:
 

The Mage is a specialization of Character, meaning it inherits all the properties of Character while adding its own behaviors (castSpell()) or attributes (mana).
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 *