UML MCQ

UML Diagrams MCQs Questions With Answers – Part 1

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 UML?

A A programming language

B A database

C A modeling language

D An operating system

C
UML (Unified Modeling Language) is a visual language used to model software systems, often object-oriented. It is not a programming language, but a tool to graphically represent the structure and behavior of a system.
 

2. Which UML diagram is used to represent classes and their relationships?

A Use case diagram

B Sequence diagram

C Activity diagram

D Class diagram

D
The class diagram shows classes, their attributes, their methods, and the relationships between them (inheritance, association, composition, etc.). Example:
 
 

3. Which UML diagram is used to represent interactions between actors and the system?

A Class diagram

B Use case diagram

C Activity diagram

D Sequence diagram

B
The use case diagram illustrates the system’s functionalities from the user’s (actor’s) point of view. It shows interactions between users and the system. Example:
 
 
 

4. In a use case diagram, who represents the system’s user?

A A class

B An actor

C An activity

D An interface

B
An actor represents an external entity (usually a user or another system) that interacts with the system via use cases. Example:
 
 

5. Which UML diagram is primarily used to model the static structure of a system, including its classes, attributes, operations, and relationships?

A Use case diagram

B Sequence diagram

C Class diagram

D State-transition diagram

C
The class diagram is the foundation of structural modeling in UML. It represents the different elements that make up the system and their static interconnections.
 

6. In a UML class diagram, what does an association with an asterisk (*) represent?


A A mandatory relationship

B A cardinality of 1

C A cardinality of 0..1

D Multiple cardinality

D
The asterisk (*) means “many”, so the associated class can have multiple instances (e.g., A customer can book one or more flights).
 
 

7. Which of the following is NOT a structural diagram in UML?

A Class diagram

B Component diagram

C State-transition diagram

D Object diagram

C
The state-transition diagram is a behavioral (dynamic) diagram, used to describe an object’s state changes. The others are structural diagrams. Example of state-transition diagram:
 
 

8. What is the correct representation for an inheritance association in a UML class diagram?

A A solid arrow with a diamond

B A dashed arrow

C An arrow with a white triangle

D A simple line without an arrow

C
Inheritance is represented by an arrow with a non-filled (white) triangle pointing to the parent class (superclass). Example:
 
 

9. What does a sequence diagram allow you to represent?

A Class hierarchy

B The sequence of operations over time

C The system’s database

D The structure of a file

B
The sequence diagram shows object interactions over time, emphasizing the order of messages exchanged. Example:
 

image source: wikimedia.org
 
 

10. Which UML element is used to represent a method in a class?

A A rectangle with a line

B An arrow

C A name followed by parentheses in a class

D A black diamond

C
In a class diagram, a method is shown in one of the class’s sections, typically as methodName(). Example:
🚀 Boost your productivity with the best AI toolsTry them

 
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 *