CS FundamentalsVery hardProduct-company design interview

Using Robert Martin's Stable Dependencies Principle, package A has instability I = 0.2 and package B has I = 0.8. Which dependency direction is preferred?

  1. A. A should depend on B
  2. B. Neither may depend on the other
  3. C. Direction does not matter
  4. D. B should depend on A

Correct answer: D. B should depend on A

Dependencies should point towards stability (lower I). B is unstable (I = 0.8) and easy to change, so it may depend on the stable A; a stable package depending on a volatile one would be dragged into frequent changes.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic