Kyūkei Master Hub
SCS2108 | Phase Study Card
👁️ -- opens | 0%

Phase 14: Exam Drill 2 (UML Diagrams & Modeling)

40 UML Modeling & Object Relationship Exam Questions. Click "View Model Answer" to see exact diagram notations and examiner mark scoring.

Part 1: Foundational Questions (Questions 1 - 20)
Q01Easy
What does UML stand for and what is its main purpose?
Model Answer [3 Marks]:
Unified Modeling Language. A standardized visual modeling language used to specify, visualize, construct, and document software system artifacts.
Q02Easy
Differentiate between Structural (Static) and Behavioral (Dynamic) UML diagrams.
Model Answer [4 Marks]:
Structural diagrams depict the static layout of system components at rest (e.g. Class Diagram). Behavioral diagrams show execution flow, interaction, and state changes over time (e.g. Sequence Diagram).
Q03Easy
List 3 static UML diagrams and 3 dynamic UML diagrams.
Model Answer [6 Marks]:
Static: Class Diagram, Package Diagram, Deployment Diagram.
Dynamic: Use Case Diagram, Sequence Diagram, Activity Diagram.
Q04Easy
Draw the 3 compartments of a Class in a UML Class Diagram.
Model Answer [3 Marks]:
Top compartment: Class Name.
Middle compartment: Attributes (Fields).
Bottom compartment: Operations (Methods).
Q05Easy
State the 4 visibility indicators used in UML Class Diagrams.
Model Answer [4 Marks]:
+ Public
- Private
# Protected
~ Package/Default
Q06Easy
What is the UML arrow for Inheritance (Generalization)?
Model Answer [3 Marks]:
A Solid line with a Hollow Triangle arrowhead pointing from the subclass to the superclass (───────▷).
Q07Easy
What is the UML arrow for Interface Realization?
Model Answer [3 Marks]:
A Dashed line with a Hollow Triangle arrowhead pointing from the implementing class to the interface (-- -- --▷).
Q08Easy
What symbol represents Aggregation in a UML Class Diagram?
Model Answer [3 Marks]:
A Hollow Diamond placed at the container/owner class end of the association line (◇──────).
Q09Easy
What symbol represents Composition in a UML Class Diagram?
Model Answer [3 Marks]:
A Solid/Filled Diamond placed at the parent owner class end of the association line (◆──────).
Q10Easy
What is Multiplicity in a UML Class Diagram? Give an example.
Model Answer [3 Marks]:
Specifies the number of instances of one class that can be linked to a single instance of another class. Example: 1..* (one to many).
Q11Easy
What represents an Actor in a Use Case Diagram?
Model Answer [2 Marks]:
A stick figure drawn outside the system boundary rectangle representing a user role or external system.
Q12Easy
What represents a Use Case in a Use Case Diagram?
Model Answer [2 Marks]:
An oval containing a verb phrase describing a system feature, placed inside the system boundary rectangle.
Q13Easy
What is a Lifeline in a Sequence Diagram?
Model Answer [3 Marks]:
A vertical dashed line extending downward from an object box representing the object's existence over time.
Q14Easy
What does an Activation Bar represent in a Sequence Diagram?
Model Answer [3 Marks]:
A thin vertical rectangle on a lifeline indicating that the object is actively executing an operation.
Q15Easy
What is an Activity Diagram used for?
Model Answer [3 Marks]:
Modeling operational workflows, business processes, and parallel execution paths (similar to an advanced flowchart).
Q16Easy
What is a State Machine Diagram used for?
Model Answer [3 Marks]:
Modeling the lifecycle state transitions of a single object in response to events.
Q17Easy
What is a Package Diagram?
Model Answer [3 Marks]:
A structural diagram showing how classes and model elements are grouped into folders/packages and their dependencies.
Q18Easy
What is a Component Diagram?
Model Answer [3 Marks]:
A structural diagram depicting software components (JARs, DLLs, modules) and their provided/required interfaces.
Q19Easy
What is a Deployment Diagram?
Model Answer [3 Marks]:
A structural diagram showing physical hardware nodes (servers, devices) and the software artifacts deployed onto them.
Q20Easy
What does OCL stand for and what is it used for?
Model Answer [3 Marks]:
Object Constraint Language. A declarative language used to express formal rules and invariants on UML models.
Part 2: Medium / Applied Questions (Questions 21 - 30)
Q21Medium
Differentiate between <<include>> and <<extend>> in Use Case Diagrams. Draw arrow direction for both.
Model Answer [6 Marks]:
<<include>>: Mandatory execution. Arrow points FROM base use case TO included use case.
<<extend>>: Optional/conditional execution. Arrow points FROM extension use case TO base use case.
Q22Medium
In an Activity Diagram, what is the difference between a Decision Node and a Fork Node?
Model Answer [5 Marks]:
Decision Node (Diamond): Chooses ONE outgoing branch based on guard conditions.
Fork Node (Solid Bar): Splits single incoming flow into MULTIPLE concurrent parallel flows.
Q23Medium
Write an OCL expression declaring that an Account balance can never be negative.
Model Answer [4 Marks]:
context Account inv: self.balance >= 0
Q24Medium
Write OCL precondition and postcondition for withdraw(amount: Real) method.
Model Answer [5 Marks]:
context Account::withdraw(amount: Real)
pre: amount > 0 and self.balance >= amount
post: self.balance = self.balance@pre - amount
Q25Medium
How is an Abstract Class denoted in a UML Class Diagram?
Model Answer [3 Marks]:
The class name is written in Italics (or labeled with stereotype <<abstract>>).
Q26Medium
How is a Static method denoted in a UML Class Diagram?
Model Answer [3 Marks]:
The method signature is underlined.
Q27Medium
Differentiate between Synchronous message and Asynchronous message arrows in Sequence Diagrams.
Model Answer [4 Marks]:
Synchronous: Solid line with filled solid arrowhead (──────►). Caller blocks waiting for response.
Asynchronous: Solid line with open arrowhead (──────>). Caller continues without waiting.
Q28Medium
What is a System Boundary in a Use Case Diagram and why is it essential?
Model Answer [4 Marks]:
A rectangle enclosing all use cases. It clearly demarcates what is inside the software systemScope versus external actors outside the system.
Q29Medium
Model a 1-to-many relationship between Department and Employee in UML text notation.
Model Answer [4 Marks]:
[Department] 1 ────────* [Employee] (or 1..*). Placed at respective line ends.
Q30Medium
What is a State Transition Guard Condition in a State Machine Diagram?
Model Answer [4 Marks]:
A boolean expression written in square brackets `[balance >= amount]` that must be true for the state transition to occur.
Part 3: Hard / Examiner Trick Questions (Questions 31 - 40)
Q31Examiner Trick
TRICK: A student draws a Use Case diagram with an arrow pointing from an Actor to another Actor. Is this legal in UML?
Model Answer [5 Marks]:
YES! Only if it represents Actor Generalization (e.g. Manager inherits from Employee using a hollow triangle arrow). Direct association lines between actors are illegal.
Q32Examiner Trick
TRICK: Is a Use Case allowed to communicate directly with another Use Case without `<>` or `<>`?
Model Answer [4 Marks]:
NO! Direct simple association lines between use cases are strictly illegal in UML. They must use `<>`, `<>`, or Generalization.
Q33Examiner Trick
TRICK: Where should the Aggregation diamond be placed: at the child end or the parent owner end?
Model Answer [4 Marks]:
At the Parent Owner end! (e.g. [Teacher] ──────◇ [Department] diamond touches Department).
Q34Examiner Trick
TRICK: Can a class have a Composition relationship with itself? Give a real-world example.
Model Answer [5 Marks]:
NO! A class cannot have Composition with itself because an object cannot own its own lifetime. Recursive structure (e.g. Folder containing sub-Folder) is Aggregation.
Q35Examiner Trick
TRICK: In a Sequence Diagram, can an object send a message to itself? What is it called?
Model Answer [4 Marks]:
YES! It is called a Self-Message / Recursive Call, drawn as a nested loop arrow pointing back to its own activation bar.
Q36Examiner Trick
TRICK: What is the difference between a Class Diagram and an Object Diagram?
Model Answer [5 Marks]:
A Class Diagram shows static structure and types at compile time. An Object Diagram shows a snapshot of specific instantiated objects and attribute values at a specific instant in runtime. Object names are underlined (e.g. myCar:Car).
Q37Examiner Trick
TRICK: In OCL, what does self.balance@pre represent?
Model Answer [4 Marks]:
It represents the value of balance BEFORE the execution of the operation (used in postconditions to compare state changes).
Q38Examiner Trick
TRICK: A student draws an Activity Diagram with a Join Node having 2 incoming flows and 2 outgoing flows. Is this valid?
Model Answer [4 Marks]:
NO! Invalid UML. A Join Node synchronizes multiple parallel incoming flows into a SINGLE outgoing flow.
Q39Examiner Trick
TRICK: In an interface realization line in UML, is the line solid or dashed? What about the arrowhead?
Model Answer [4 Marks]:
The line is **Dashed** (`-- -- --`) and the arrowhead is a **Hollow Triangle** (`▷`). Using a filled arrowhead or solid line is a common examiner deduction point.
Q40Examiner Trick
TRICK: Can a Deployment Diagram contain software classes directly?
Model Answer [4 Marks]:
No. Deployment Diagrams contain physical **Nodes** and **Artifacts** (compiled executables, WAR/JAR files, databases), not source code classes.