UML MCQ

UML Diagrams MCQs Questions With Answers – Part 14

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 class diagram, what does 0..1 mean as a multiplicity?

A No object is allowed

B One object is required

C The object is optional (zero or one)

D There can be multiple objects, but no more than one

C
0..1 means the relationship is optional: either none or only one instance is possible. Example:

An Employee may have an access badge… or none. The relationship is therefore optional, and limited to at most one instance.
 

2. In a UML class diagram, what do you call a method preceded by a +?

A Private method

B Protected method

C Public method

D Abstract method

C
In UML notation, a + means the method is public, so accessible from outside the class.
 

3. What is the role of a “provided interface” in a component diagram?

A Show an external dependency

B Indicate an interface the component uses

C Indicate an interface the component implements and offers to others

D Mark an abstract class

C
In a component diagram in UML, a provided interface represents an interface that a component offers to other components. It indicates what services or functionality the component provides to the rest of the system. This is the interface that the component implements and exposes for use by other components.
 
 

4. What does the keyword “Abstract” mean here?


A The class cannot be instantiated

B The class is optional

C The class only has private methods

D It is automatically extended by all classes

A
An abstract class is an incomplete model used for inheritance. It can contain methods without bodies or concrete methods but cannot be instantiated directly.
 

5. Which UML diagram shows the life cycle of an object in response to events?

A Activity diagram

B Class diagram

C State-transition diagram

D Component diagram

C
A State-transition diagram (or State diagram) in UML shows the life cycle of an object in response to events. It represents how an object transitions from one state to another based on specific events or conditions, making it ideal for modeling dynamic behavior and state changes.
 

6. Which of the following elements is mandatory in a class diagram?

A Private methods

B At least one interface

C A class name

D An inheritance relationship

C
The class name is mandatory. Methods, relationships, or interfaces are optional depending on the context.
 
 

7. What do the colons : before Order and Payment mean?


A They are classes

B They are interfaces

C They are methods

D They are instantiated objects of classes

D
In UML, :ClassName refers to an instance of a class. It’s like having order1:Order.
 

8. What is the benefit of a use case diagram for a non-technical client?

A To see the database structure

B To understand the source code

C To visualize user/system interactions in a simple way

D To define system performance

C
The use case diagram is ideal for discussion with a client or end user because it is simple, visual, and non-technical. It shows what the system does for the user, not how it does it.
 

9. What is the nature of this relationship?


A A composition

B An aggregation

C A bidirectional association with multiplicity

D Multiple inheritance

C
The diagram shows that:

  • A Client can place several (0..*) Orders
  • Each Order is linked to a single Client. The double arrow means that both classes are aware of each other.
 
 

10. What is the correct representation of a bidirectional association relationship?

A A line without arrow between two classes

B Two opposite arrows

C A white diamond

D A dotted line

A
A bidirectional association allows both classes to know about each other: it is a simple line with no arrows. 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 *