UML MCQ

UML Diagrams MCQs Questions With Answers – Part 34

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 does the transition T –> T mean?


A Change of class

B End of state

C A syntax error

D An auto-transition, the system remains in the same state

D
Very useful for managing recurring events or temporary errors without leaving the state.
 

2. In a class diagram, which UML relationship models that a computer contains a graphics card that does not exist alone?

A Association

B Aggregation

C Dependency

D Composition

D
The graphics card is part of the computer and does not live on its own → composition.
 

3. You want to model an alternative use case (e.g., “payment declined”). Which UML keyword in a sequence diagram?

A loop

B ref

C alt

D opt

C
alt (alternative) is used to define multiple possible paths based on conditions.
 
 

4. What is the relationship between Pdf and Document?


A Document inherits from Pdf

B Pdf is a specialization of Document

C Pdf is independent

D Pdf contains Document

B
In UML, the class with an upward arrow is the parent class, so here, Pdf inherits from Document.
 

5. What is the difference here?


A All methods are private

B create() is abstract

C login() is static

D nbUsers() is a class method (static)

D
In UML, a static method (meaning an operation belonging to the class itself, not an instance) is represented by underlining its name in the class diagram.
 

6. What does the node continue purchase represent after an if (stock sufficient)?


A A loop

B A class

C A merge point

D An activity end

C
After a fork (if), UML merges all branches into a single flow.
 
 

7. What do “Client” and “System” refer to here?


A Classes

B Threads

C Interfaces

D Swimlanes representing responsibilities/actors

D
Swimlanes are used to assign tasks to different roles in a process.
 

8. What does “anonymous class” refer to here?


A A nameless class for UML diagrams

B A temporary class

C A nameless class declared directly within a method

D An exception

C
Frequently used in Java or Kotlin, an anonymous class allows for a quick definition of a local implementation.
 

9. What role does the “Display Result” block play here?


A Join (meeting of parallel branches)

B Start of process

C User interface

D Exception

A
After parallel execution, we can synchronize all branches before continuing.
 
 

10. In an activity diagram, what does a horizontal black bar represent?

A A condition

B An initial state

C A logical decision

D Flow synchronization

D
It is used to start or merge multiple parallel actions → fork or join.
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 *