UML MCQ

UML Diagrams MCQs Questions With Answers – Part 2

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. In UML, what does the acronym “UML” stand for?

A Universal Modeling Language

B Unified Management Language

C Unified Modeling Language

D Ultimate Modeling Logic

C
UML stands for Unified Modeling Language — a standardized modeling language used to design and document object-oriented systems.
 

2. Which UML diagram is used to represent a system’s behavior in the form of activity flows?

A Class diagram

B Activity diagram

C State-transition diagram

D Use case diagram

B
The activity diagram shows sequences of actions or processes as flows, like a flowchart. It is often used to model business logic. Example:
 

image source: wikimedia.org
 

3. What symbol is used to represent a use case?

A A rectangle

B A circle

C A diamond

D An oval

D
A use case is represented by an oval with the name of the action inside (e.g., “Login”, “Place Order”). Example:
 
 
 

4. In a class diagram, what do you call a relationship where a class is “part of” another?

A Inheritance

B Association

C Composition

D Dependency

C
Composition is a strong “part-of” relationship. If the “container” object is destroyed, the contained objects are also destroyed. It is represented by a black diamond. Example:
 
 

5. Which relationship expresses a dependency between two UML elements?

A A solid arrow

B A dashed arrow

C A line without arrow

D A diamond

B
A dependency is indicated by a dashed arrow, showing that one element depends on another (e.g., a class depends on an interface or external service). Example:
 
 

6. The UML component diagram is used to represent ___________

A The physical architecture of the system

B Navigation between website pages

C Database entities

D The flow of an algorithm

A
The component diagram shows how different software parts (or components) are organized, such as modules, libraries, etc. Example:
 

image source: wikimedia.org
 
 

7. What type of UML relationship represents a temporary “use” of an object by a method?

A Association

B Dependency

C Aggregation

D Composition

B
A dependency is often used to indicate that a class temporarily uses another. Example:
 
 

8. What is the purpose of a sequence diagram?

A Show classes and their relationships

B Show the timeline of interactions between objects

C Describe user roles

D Define functional requirements

B
The sequence diagram shows how objects interact over time, displaying exchanged messages in chronological order. Example:
 

image source: wikimedia.org
 

9. The state (or state-transition) diagram is used to model:

A Relationships between classes

B The execution order of methods

C Data storage

D The different possible states of an object

D
The state diagram shows how an object transitions from one state to another based on certain events or actions (e.g., “Draft” → “Published”). Example:
 

image source: wikimedia.org
 
 

10. In a class diagram, an aggregation is represented by _________

A A white triangle

B A dashed arrow

C A white diamond

D A black diamond

C
Aggregation is a weak form of composition: a class contains another, but the contained object can exist independently of the container. It is represented by a white diamond. Example:
 

A Person can live in a House or an Apartment, but both can exist independently, which is an example of aggregation.
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 *