UML MCQ

UML Diagrams MCQs Questions With Answers – Part 22

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 a UML class diagram, what does a simple arrow on an association between two classes indicate?

A A unidirectional dependency.

B Possible navigation in both directions.

C Unidirectional navigability, from the source class to the target class.

D An abstract relationship with no possible interaction.

C
An arrow on an association indicates that the source class is aware of the target class, but not vice versa. Without an arrow, the association is bidirectional. Example:
 
 

2. What does this diagram represent?


A It shows the classes and their dependencies

B It illustrates different user interfaces

C It models the life cycle of a document

D It represents a database process

C
It’s a state diagram, showing the successive states of an object (Draft → Published → Archived) with triggering events (publish, archive).
 

3. You’re creating a streaming app. Which diagram would help model the scenario “the user starts a video”?

A Sequence diagram

B State diagram

C Use case diagram

D Component diagram

C
A Use Case Diagram is best used when:

  • You’re identifying high-level user interactions with the system.
  • You want to model “what” a user can do, not “how” it happens step-by-step.

So in the case of: “The user starts a video”
That’s a use case — a goal the user wants to achieve with the system.

 
 

4. In a quiz app, a player answers several questions. What is the relationship between the two?

A Dependency

B Aggregation

C Composition

D Association

D
The player is linked to the questions, but they can exist without the player → simple association.
 

5. What is the default visibility of a UML element contained in a package?

A + (public)

B – (private)

C # (protected)

D ~ (package)

D
The ~ visibility means package visibility, i.e., the element is only accessible to elements within the same package. It is neither fully public nor private, useful for modular encapsulation. Example:
 
 

6. In a class diagram, what does an underlined attribute (e.g.: id: int) mean?

A It is a private attribute

B It is a static attribute

C It is an inherited attribute

D It is a constant

B
In UML, an underlined attribute indicates it is static (shared by all instances).
 
 

7. What is the purpose of a UML profile?

A Customize UML with stereotypes, constraints, and tags specific to a domain.

B Change the UML syntax into a new language.

C Add custom classes to a UML library.

D Transform a UML diagram into executable code.

A
A UML profile is a standard mechanism for adapting UML to specific needs (like UML for embedded systems, systems engineering, etc.). It includes stereotypes (<<>>), tagged values, OCL constraints, etc.
 

8. You’re modeling a transport app. A trip is linked to a driver and a car. Which diagram best shows everything?

A Sequence diagram

B Class diagram

C Activity diagram

D State diagram

B
The class diagram models the links between structured entities, like in this case. Example:
 
 

9. In a state diagram, what triggers a transition from one state to another?

A A class change

B A message or event

C A boolean variable

D An external package

B
A transition between states is triggered by an event (e.g., user click, signal received, timeout end, etc.). Transitions can have guards (conditions) and actions.
 
 

10. In a UML communication diagram, what does a link between two objects represent?

A A static relationship between two classes

B A physical link between two components

C An instance of an association between two objects

D A state transition

C
In a communication diagram, a link shows that two objects can exchange messages. It represents an instance of an association. Messages are numbered to indicate their order. Example:
 

Objects are represented as in an object diagram. Arrows show messages exchanged between them. The numbering (1, 1.1, 1.2) indicates the order of interactions in the scenario.
Here, a client orders a product:

  • The Client sends a request to an OrderService
  • The OrderService checks with a Stock
  • Then it confirms the order
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 *