Home › OCUP 2 Intermediate › Practice questions › Interactions
OCUP 2 Intermediate · OMG · Interactions · Bank updated 2026-11-03

OCUP 2 Intermediate practice questions: Interactions

5 free questions from 31 on this area · answer and explanation for each · no sign-up

These 5 questions come from the Interactions section of our OCUP 2 Intermediate bank (31 questions on this area, which carries 14% of the real exam). Every question is original, with the correct answer explained and linked to the source it is drawn from.

Try 6 free OCUP 2 Intermediate questions → All OCUP 2 Intermediate sample questions

Free: 6 questions in study mode, no card. All 31 Interactions questions and the full OCUP 2 Intermediate bank: $15 one-time.

1/5 · Interactions
In sd ReserveItem, :Shop sends the asynchronous messages prepare() and reserve() to :Warehouse, in that order, and :Warehouse sends nothing back. The constraint {stock > 0} is shown in curly braces on lifeline :Warehouse, between the receptions of prepare() and reserve(). In one recorded run, whose messages match sd ReserveItem, stock is 0 just after prepare() is received and 5 just before reserve() is received. What does the constraint imply for this run?
AInvalid: it is evaluated right after the prior event on :Warehouse
BValid: it serves as a comment and is not evaluated during the run
CInvalid: it is evaluated at each event on the :Warehouse lifeline
DValid: it is evaluated right before the next event on :Warehouse
Answer: D. Subclause 17.2.3.5 (PDF p. 610) states that the Constraint of a state invariant is evaluated at run time, immediately prior to the execution of the next OccurrenceSpecification, such that all actions that are not explicitly modeled have been executed; if the Constraint is true, the trace is a valid trace. The example of Figure 17.17 (PDF p. 632) says the same: the state invariant in curly brackets will be evaluated prior to the next event occurrence after it on the lifeline. Here that event is the reception of reserve(), when stock is 5. The notation, a constraint in curly brackets on the lifeline, is given in 17.2.4.5 (PDF p. 611), and 17.12.25.1 (PDF p. 672) describes a StateInvariant as a runtime constraint on the participants of the Interaction. Source: OMG UML 2.5.1 specification
2/5 · Interactions
In sd Monitor, :Sensor sends the message alarm(). The arrow ends in a small black circle instead of reaching a lifeline or a gate. How does the standard give the semantics of this message?
AThe trace <receiveEvent>, with the sender outside the description
BThe message belongs to the set of invalid traces
CThe trace <sendEvent, receiveEvent>, with the receiver left unnamed
DThe trace <sendEvent>, with the receiver outside the description
Answer: D. A lost message is shown with a small black circle at the arrow end. Its sending event is known but there is no receiving event occurrence, because the destination is outside the scope of the description, so its semantics is the trace <sendEvent>. A found message is the mirror case. Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 17.4.3.1 Messages, p. 616-617 Source: OMG UML 2.5.1 specification
3/5 · Interactions · hard
On lifeline :Clerk a coregion area contains the reception of invoice() drawn above the reception of receipt(). Below the coregion the same lifeline sends archive(). No general ordering is attached. Which traces are valid for :Clerk?
Ainvoice() is received before receipt(), then archive() is sent
BThe two receptions occur in either order, then archive() is sent
Carchive() may be sent before one or both of the receptions
DThe two receptions occur simultaneously, then archive() is sent
Answer: B. A coregion is notational shorthand for a parallel combined fragment: each directly contained fragment is a separate operand, so reception order is insignificant (17.6.4.10). Events on the lifeline outside the coregion stay linearly ordered (17.3.3.1). Interleaving semantics, not simultaneity, is assumed (17.1.1). Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 17.6.4.10 Parallel interactionOperator, p. 628 Source: OMG UML 2.5.1 specification
4/5 · Interactions · hard
In sd Entry, an alt combined fragment has two operands. Operand 1 ends in a Continuation named Locked, and operand 2 ends in a Continuation named Open. Below the alt the diagram offers three InteractionFragments: F1 starts with the Continuation Locked, F2 starts with the Continuation Open, and F3 starts with no continuation. Which fragments can be appended after operand 1?
AF1 alone
BF1 and F3
CF2 and F3
DF1, F2 and F3
Answer: B. If an operand of an alt ends in a Continuation X, only InteractionFragments starting with the Continuation X, or with no continuation at all, can be appended (17.6.3.5). So F1 and F3 are allowed after operand 1, while F2 is not. Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 17.6.3.5 Continuations, p. 624-625 Source: OMG UML 2.5.1 specification
5/5 · Interactions · hard
In a communication diagram, a message is labelled '3*||[i := 1..n]: notify()'. What does the double vertical line after the star mean?
AThe n notify() messages are sent one after another in order
BThe n iterated notify() messages may be executed concurrently
CThe notify() message is a branch executed once when i equals n
DThe notify() message belongs to a thread named after the variable i
Answer: B. The iteration notation assumes sequential execution of the messages. Following the star by a double vertical line (*||) expresses that they may be executed concurrently (17.9.1.3). The iteration clause is pseudocode and not prescribed by UML. Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 17.9.1.3 Sequence expression, p. 642-643 Source: OMG UML 2.5.1 specification
Try 6 more free OCUP 2 Intermediate questions → See the whole OCUP 2 Intermediate bank

Other OCUP 2 Intermediate areas

The same kind of free sample for every other section of the OCUP 2 Intermediate bank:

Activities & Actions30 qBasic Structure30 qStateMachines & Use Cases49 qComponents29 qCommon Behavior30 qStructured Classifiers27 qClassification30 q

Practise OCUP 2 Intermediate with instant feedback

6 free questions in study mode · no card · full OCUP 2 Intermediate bank with area filters and the error log: $15 one-time · no dumps, no ads.

Start OCUP 2 Intermediate free →
Read next
OCUP 2 Foundation: Format, Cost and a Study Plan for the OMG UML Exam OCUP 2 Foundation: $350, 90 questions, 120 minutes, 60 correct to pass, Pearson VUE or online. A six-week UML study plan, checked 29 Sep 2026.
ExamDeck is an independent study tool, not affiliated with, endorsed by, or sponsored by OMG. OCUP 2 Intermediate and related marks are trademarks of their respective owners, used for identification only. Exam facts checked against official OMG materials (as of October 2026); always confirm current details with the vendor before booking.