UML MCQ

UML Diagrams MCQs Questions With Answers – Part 30

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. How is an anonymous object denoted in a UML object diagram?

A anon :Class

B :Class

C <<anonymous>>

D *Class

B
If the name of an object is unknown (or not needed), we write only its type, for example: :Client. It is then considered anonymous.
 

2. Which UML mechanism allows customizing UML for a specific business domain?

A Use cases

B Combined fragments

C UML profiles (stereotypes, tags, constraints)

D Dependencies

C
UML profiles allow extending UML for specific purposes (embedded systems, finance, security…). They define custom stereotypes, tagged values, and OCL constraints.
 

3. Which type of interaction diagram shows object exchanges organized vertically over time?

A State diagram

B Component diagram

C Sequence diagram

D Composite structure diagram

C
A sequence diagram represents messages exchanged between objects in a scenario, following a vertical timeline (top to bottom). Each object is shown with a lifeline.
 
 

4. What is happening here?


A A calls C directly

B C calls A

C A calls B, who then calls C

D C calls B, then B calls A

C
This is a nested call, typical in sequence diagrams: each participant triggers another, forming a chain of execution.
 

5. What role does validate() play here?


A It is a state

B It is an event that triggers a transition

C It is a class

D It is an interface

B
In a state diagram, arrows are transitions, and text like validate() represents the triggering event.
 

6. What does this relationship mean?


A A person can have up to 3 addresses

B A person has exactly one address

C An address can have up to 3 people

D A person cannot have any address

A
1..3 indicates a minimum and maximum multiplicity. Here, a person has at least 1 and at most 3 addresses.
 
 

7. What do <<entity>> and <<controller>> represent?

A Abstract classes

B Methods

C Visibility constraints

D UML stereotypes, used to indicate a role or nature

D
Stereotypes like <<boundary>>, <<entity>>, and <<controller>> are typical of MVC (Model-View-Controller) architecture or business modeling. Example:
 
 

8. In a UML activity diagram, what is the difference between an activity and an action?

A An activity is faster

B An action is a subset of an activity

C An activity always depends on an actor

D An action cannot have inputs/outputs

B
In UML, an activity is composed of several actions. Actions are the basic units of behavior, while an activity is the orchestrated set of those actions.
 

9. A UML stereotype can be applied to:

A Only one class

B Any UML element matching its extension

C Only to objects in an object diagram

D Only to packages

B
Stereotypes are used to extend UML. They can be applied to any element that matches their definition (class, interface, association, etc.). Example: <<controller>> on a class.
 
 

10. You have an interface Evaluable, implemented by the classes Exam, Quiz, Assignment. What is the relationship?

A Generalization

B Composition

C Realization

D Aggregation

C
A class implements an interface through a realization relationship (dashed arrow + empty triangle). Example:
 
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 *