CS FundamentalsHardTCS NQT · Infosys pattern

An activity diagram shows a fork bar splitting one flow into two concurrent activities (ValidateAddress and ChargeCard), which later rejoin at a join bar before activity ShipOrder begins. What must be true before ShipOrder can start?

  1. A. Only one of the two activities needs to finish, whichever is faster
  2. B. ShipOrder starts as soon as the fork happens, in parallel with the other two
  3. C. The join bar is optional and has no effect on timing
  4. D. Both ValidateAddress and ChargeCard must complete; a join bar waits for all incoming concurrent flows to finish before releasing the outgoing flow

Correct answer: D. Both ValidateAddress and ChargeCard must complete; a join bar waits for all incoming concurrent flows to finish before releasing the outgoing flow

A join (unlike a decision/merge) synchronises concurrent flows: control does not pass beyond it until every incoming branch from the matching fork has completed. This differs from a simple merge node, which only needs one incoming flow to arrive.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic