UML MCQ

UML Diagrams MCQs Questions With Answers – Part 13

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 state-transition diagram, what does an arrow with a condition (e.g.,
if x > 10) represent?

A A state change based on an event

B A condition under which the state is maintained

C A final state of the process

D An automatic transition event

A
The condition on an arrow in a state-transition diagram defines the requirement that must be met for the system to transition to a new state. Example:
 

A system goes through different states based on the value of variable x:

  • If x <= 10 → go to Normal state
  • If x > 10 → go to Alert state
 

2. What can we deduce about the role of the Application class?


A It inherits from Logger and Config

B It has persistent instances of Logger and Config

C It temporarily uses Logger and Config

D It is abstract

C
Two dependencies (..>) indicate that Application uses the other two classes, without necessarily owning them.
 

3. In a sequence diagram, what is a “fragment”?

A A segment of executed code

B A portion of a diagram showing specific behavior, such as alt or loop

C A relationship between objects

D A message sent between two objects

B
A fragment in a sequence diagram represents a portion of the diagram where specific behavior is defined, like an alternative (alt) or a loop. Example:
 
 
 

4. Which UML relationship is used to represent that a class implements an interface?

A A solid arrow

B An arrow with an empty triangle and solid line

C An arrow with an empty triangle and dashed line

D A dashed arrow without triangle

C
In UML, implementing an interface is shown with a dashed arrow and an empty triangle, pointing from the class to the interface. It symbolizes a realization. Example:
 
 

5. What do nodes represent in a UML deployment diagram?

A Users

B Servers or physical devices

C Virtual classes

D Software components

B
In a deployment diagram, a node represents a physical element: server, PC, phone, etc. It’s where software components are installed and executed. Example:
 
 

6. Which UML diagram is best suited to describe a complex business process with multiple decisions and loops?

A Use case diagram

B Class diagram

C Activity diagram

D Component diagram

C
The activity diagram is ideal for describing business processes (workflows) involving sequences of actions, decisions, loops, concurrency, etc. Example:
 
 
 

7. In a sequence diagram, what does an arrow with a stick head (bar) mean?

A An asynchronous message

B A system signal

C A lost message

D A destructor message

A
An arrow with a stick head represents an asynchronous message: the sender does not wait for a response before continuing execution. Example:
 
 

8. What is the main purpose of the state-transition (or state) diagram?

A To show the structure of classes

B To show user actions

C To show an object’s possible states and its changes

D To describe system actors

C
The state diagram is used to model the behavior of an object through its states and the transitions triggered by events.
 

9. What does the vertical bar after “send request” on the Application -> Server line represent?


A An asynchronous method

B A process activation (execution block)

C An object instantiation

D A conditional response

B
The vertical bar triggers an activation on the Server participant, indicating it performs an operation for a certain duration (activation bar).
 
 

10. In a component diagram, what is a “port”?

A An access method

B An attribute of a component

C A communication point for interfaces

D A type of physical node

C
A port is a point of interaction between a component and its environment or other components. It enables the connection of provided or required interfaces. Example:
 

There are two components:

  • ClientComponent which requires an interface
  • ServiceComponent which provides an interface
  • The connection is made through ports
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 *