UML MCQ

UML Diagrams MCQs Questions With Answers – Part 27

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 component diagram, a connector is used to:

A Specify the physical location of an artifact

B Connect two compatible ports between components

C Manage asynchronous messages

D Define access rights to a package

B
Connectors are links that connect ports between components to indicate possible communication. They can link provided/required interfaces or internal parts of a component. Example:
 

This diagram shows that:

  • The Client component has a PortClient port
  • The Server component has a PortServer port
  • An UML connector links these two ports, modeling the communication between components
 

2. Which visibility in UML corresponds to limited access within the same package?

A + (public)

B # (protected)

C ~ (package)

D – (private)

C
The symbol ~ represents package visibility: the element is accessible only within the same package. This is useful for encapsulating without exposing everything.
 

3. Which UML diagram allows you to show the logical structure of a software system with its components (database, API, etc.)?

A Component diagram

B Class diagram

C Activity diagram

D Use case diagram

A
It is used to visualize the system’s logical architecture and its software modules. Example:
 
 

4. What is a reflexive association in UML?

A An association between two abstract classes

B A class associated with itself

C An association between two interfaces

D A dependency between two packages of the same name

B
A reflexive association links a class to itself. A classic example: an Employee class can have a link to another Employee as a manager. Roles are distinguished with names (subordinate, manager, etc.). Example:
 
 

5. Which multiplicity indicates at least one occurrence, with no upper limit?

A 0..1

B 1

C *

D 1..*

D
1..* means at least one occurrence, with no maximum (infinite). It is often used to model mandatory collections (e.g., an order must contain at least one item).
 

6. What does this diagram mean?


A Administrator and Client are subclasses of User

B User is an interface

C Administrator is an instance of User

D It is a composition

A
The arrow User <|-- SubClass represents a generalization, or classic inheritance.
 
 

7. What does the / before total mean?


A The attribute is hidden

B It is a static method

C It is a private attribute

D It is a derived attribute, calculated from others

D
The attribute is not stored; it is calculated (e.g., sum of invoice lines).
 

8. What is the correct interpretation of *?


A One student per group

B The multiplicity is optional

C Unbounded multiplicity (0 to n students)

D The association is abstract

C
The * symbol is equivalent to 0..*, meaning there is no upper limit.
 

9. What can we deduce from this?


A ReportPDF inherits from an abstract class and implements an interface

B ReportPDF cannot be instantiated

C Printable inherits from ReportPDF

D UML does not allow this

A
This is a classic UML case: a concrete class inherits from an abstract class and implements one or more interfaces.
 
 

10. What happens in this diagram?


A Cat hides the method of Animal

B There is an error because the signatures are identical

C Cat overrides the method speak()

D Cat overloads speak() with a different return type

C
In UML (and programming), if the signature is the same, it is an override (not an overload, which changes the parameters).
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 *