CS FundamentalsHardProduct-company design interview

In an air-traffic system, 20 aircraft objects would each need references to all the others to coordinate landings. Routing every message through a control-tower object instead is which pattern, and what does it cut the number of object-to-object links to?

  1. A. Observer; 190 links
  2. B. Facade; 1 link
  3. C. Mediator; 20 links (each aircraft talks only to the tower) instead of 190
  4. D. Chain of Responsibility; 19 links

Correct answer: C. Mediator; 20 links (each aircraft talks only to the tower) instead of 190

A full mesh of 20 objects needs 20 x 19 / 2 = 190 links; with a Mediator each object knows only the mediator, so 20 links. The price is that the mediator can grow into a complex 'god object'.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic