CS FundamentalsHardProduct-company placement

Your app depends on libraries P and Q. P needs utils >=2.0 <3.0 and Q needs utils >=1.2 <2.0. In an ecosystem that allows only one version of utils per application, what is the situation?

  1. A. Install utils 2.0, which satisfies both
  2. B. Install utils 1.9, which satisfies both
  3. C. A diamond dependency conflict: no single version satisfies both ranges, so you must upgrade Q, downgrade P, or isolate or shade one copy
  4. D. The package manager picks the newest version and it will always work

Correct answer: C. A diamond dependency conflict: no single version satisfies both ranges, so you must upgrade Q, downgrade P, or isolate or shade one copy

The ranges [2.0, 3.0) and [1.2, 2.0) do not overlap. Resolving it needs a compatible release of one library or a mechanism that allows two copies, which some ecosystems (such as npm's nested installs) support.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic