UML MCQ

UML Diagrams MCQs Questions With Answers – Part 25

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 the meaning of the <<use>> stereotype in a UML dependency?

A A class inherits from another

B A class temporarily uses another to accomplish a task

C A class is dynamically replaced by another

D A class is extended by another

B
A <<use>> dependency indicates that the source element depends on the existence or behavior of the target element. This expresses a temporary use, often through a method call or a one-off interaction. Example:
 
 

2. What is the purpose of a UML profile diagram?

A To create user profiles for a software

B To model different hardware platforms

C To define an extension of the UML meta-model with stereotypes, constraints, and tags

D To organize use cases into packages

C
UML profiles allow UML to be extended to a specific domain: avionics, real-time systems, web, security, etc. Stereotypes, tagged values, and domain-specific constraints (OCL) are defined in these profiles.
 

3. You are developing an e-commerce app. Which diagram represents products, shopping cart, and customer in a static model view?

A Class diagram

B Sequence diagram

C Activity diagram

D State diagram

A
A class diagram models the static structure of the system and the relationships between entities (products, customer, cart). Example:
 

A customer can have a cart (optional). A cart can contain multiple products. Each product is defined by its attributes (price, description, etc.).
 
 

4. In a UML component diagram, a required interface is represented by:

A An empty circle

B A box containing the word <<interface>>

C A half-moon (socket) pointing outward

D A dashed arrow pointing to an interface

C
In UML, a required interface is represented by an open socket shape (◠): this means the component is expecting an external implementation of this interface to function. A provided interface is represented by a circle. Example:
 
 

5. You are creating a bike rental app. A subscription grants access to multiple rentals. What relationship is this?

A Aggregation

B Association

C Composition

D Dependency

C
Rentals are dependent on the subscription → if the subscription is removed, the rentals are too. Example:
 
 

6. In an educational app, a lesson is made up of several quizzes. These quizzes only make sense in the context of the lesson. What relationship is this?

A Aggregation

B Association

C Dependency

D Composition

D
The quizzes have no independent existence; they are an integral part of the lesson → composition.
 
 

7. In an activity diagram, what does a join node wait for to continue the flow?

A That only one flow arrives

B That a boolean condition is true

C That all incoming flows are completed

D That a system event triggers it

C
A join node is used to synchronize multiple parallel flows. It waits for all previous activities to complete before continuing to the next step. Example:
 
 

8. What does the arrow –> from Server to Client represent?


A A method call

B A response, called return message

C An exception thrown

D A class inheritance

B
In a sequence diagram, an arrow –> symbolizes the return of information or results, often after processing.
 

9. You want to model a relationship between Trip and Destination, knowing that a trip must always have at least one destination. What multiplicity would you choose?

A 0..*

B 1..*

C 0..1

D 1..1

B
Each Trip must have at least one Destination, so it’s 1..*. Example:
 
 
 

10. How do you represent a self-call (method of an object called by itself) in a sequence diagram?

A A loop of arrows returning to the lifeline

B An arrow pointing to another object of the same type

C An arrow going out and coming back on the same lifeline

D A dashed arrow with an X at the end

C
When an object calls itself (e.g., through an internal method), an arrow is drawn starting from the lifeline and returning to it, usually with an embedded activation rectangle. Example:
 

This can represent recursion, an internal chain of methods, or autonomous behavior. Commonly used in systems where a component processes its own data or state.
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 *