0
0
Software Engineeringknowledge~20 mins

Class diagrams in Software Engineering - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Class Diagram Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Class Diagram Components

Which of the following best describes the role of associations in a class diagram?

AThey represent the connections and interactions between classes.
BThey define the internal methods of a class.
CThey show the inheritance relationship between classes.
DThey specify the data types of class attributes.
Attempts:
2 left
💡 Hint

Think about how classes relate to each other in a system.

📋 Factual
intermediate
2:00remaining
Multiplicity in Class Diagrams

In a class diagram, what does a multiplicity of 1..* on an association mean?

AAt least one instance, possibly many, are required.
BZero or more instances are allowed.
CExactly one instance is required.
DNo instances are allowed.
Attempts:
2 left
💡 Hint

Look at the range indicated by the numbers.

🔍 Analysis
advanced
2:00remaining
Interpreting Inheritance in Class Diagrams

Given a class diagram where class Vehicle is connected to class Car with a solid line and a hollow triangle pointing to Vehicle, what does this indicate?

A<code>Car</code> and <code>Vehicle</code> are unrelated classes.
B<code>Vehicle</code> is a subclass that inherits from <code>Car</code>.
C<code>Car</code> is a subclass that inherits from <code>Vehicle</code>.
D<code>Car</code> uses <code>Vehicle</code> as an attribute.
Attempts:
2 left
💡 Hint

Recall the meaning of the hollow triangle arrow in UML.

Comparison
advanced
2:00remaining
Difference Between Aggregation and Composition

Which statement correctly distinguishes aggregation from composition in class diagrams?

AAggregation implies ownership and strong lifecycle dependency; composition does not.
BAggregation and composition are the same and can be used interchangeably.
CBoth aggregation and composition imply no ownership between classes.
DComposition implies ownership and strong lifecycle dependency; aggregation does not.
Attempts:
2 left
💡 Hint

Think about how the lifetime of parts relates to the whole.

Reasoning
expert
2:00remaining
Determining Class Responsibilities from a Diagram

In a class diagram, the class Order has attributes orderID and date, and methods calculateTotal() and addItem(). Which of the following best describes the responsibility of the Order class?

AIt only stores order details but does not manage items.
BIt stores order details and manages the list of items in the order.
CIt only calculates totals but does not store any data.
DIt manages customer information unrelated to orders.
Attempts:
2 left
💡 Hint

Look at both attributes and methods to understand the class role.