UML MCQ

UML Diagrams MCQs Questions With Answers – Part 18

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 a “tagged value” in the context of UML?

A A special type of stereotype.

B An additional property that can be attached to a UML element to store specific information.

C A constraint applied to a relationship between UML elements.

D A graphical notation to represent an interface.

B
Tagged values allow you to add metadata to UML elements in the form of name-value pairs, providing additional information not directly expressed by standard UML concepts. Example:
 
 

2. If a “Book” cannot exist without its “Cover” (even if torn), which UML relationship best illustrates this inseparable link?

A Aggregation (like friends hanging out)

B Dependency (like coffee needing milk)

C Composition (like a heart in a body)

D Association (like two actors in a movie)

C
Composition captures a strong “whole-part” relationship where the part is intrinsically tied to the lifecycle of the whole. Example:
 
 

3. Imagine a “Robot” performing a “Walk”. Which UML diagram is ideal for capturing this sequence of actions over time?

A A class diagram (to list the robot’s parts)

B A state-transition diagram (for robot postures)

C A sequence diagram (for the order of movements)

D A component diagram (for the robot’s functional blocks)

C
The sequence diagram excels at showing the chronological order of interactions (in this case, the walking actions) between objects (the Robot). Example:
 
 
 

4. If a “Switch” activates a “Light”, but the light can also be turned on in other ways, which UML relationship describes this temporary use?

A Composition (they are fused together)

B Aggregation (they’re often together)

C Dependency (one needs the other momentarily)

D Association (they’re just connected)

C
Dependency illustrates a usage relationship where one element (Light) depends on another (Switch) for a specific action, without a strong structural link. Example:
 
 

5. To show the different “moods” of a “Cat” (calm, playful, angry) and how it transitions between them, which UML diagram is the most relevant?

A An object diagram (a snapshot of the cat)

B A use case diagram (what the cat does with its human)

C A state-transition diagram (the cat’s emotional cycle)

D A communication diagram (meows between cats)

C
This diagram is perfect for modeling an object’s states and the events that trigger state changes. Example:
 
 

6. If a “Car” is composed of “Wheels”, an “Engine”, and a “Chassis”, and these parts are essential for the car’s existence, what type of UML relationship is involved?

A Association (they’re somehow related)

B Aggregation (they can technically exist separately)

C Composition (they form an inseparable whole)

D Dependency (the car needs fuel)

C
Even though the wheels or engine can exist on their own, a functioning “Car” requires these integrated components, illustrating a composition. Example:
 
 
 

7. What is the relationship between Car and Engine in this diagram?


A Car depends on Engine but has no composition relationship

B Car owns Engine as an inner class

C Car and Engine are independent classes

D Car is a superclass of Engine

A
The arrow –> shows that Car uses Engine but doesn’t own it strongly (it’s not composition). The engine is an essential component of the car, but an Engine instance can exist independently.
 

8. To model the order of operations in an order processing system, which diagram would be most suitable?

A Sequence diagram

B State diagram

C Communication diagram

D Class diagram

A
The sequence diagram represents the temporal sequence of events and messages between objects.
 

9. You’re designing a delivery app. Which diagram would help you visualize how a delivery man interacts with the app?

A Class diagram

B Use case diagram

C Component diagram

D Deployment diagram

B
Perfect for modeling the delivery man’s actions like “accept delivery”, “scan package”, etc. Example:
 
 
 

10. In a social network, you want to model a user who can follow several other users. Which relationship?

A Dependency

B Composition

C Recursive association

D Aggregation

C
A user linked to other users represents a self-referencing relationship: recursive association. 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 *