CS FundamentalsVery hardProduct-company design interview

How many of these statements are correct? 1. Dependency Inversion is a design principle: high- and low-level modules should both depend on abstractions. 2. Dependency Injection is a technique for supplying a component's dependencies from outside, e.g. through its constructor. 3. Inversion of Control is the broader idea that a framework, not your code, calls your code and manages flow. 4. Using a DI container automatically satisfies the Dependency Inversion Principle.

  1. A. 4
  2. B. 1
  3. C. 2
  4. D. 3

Correct answer: D. 3

1-3 are correct. A container can inject concrete classes just as easily, so high-level code can still depend on low-level details; DIP is about the direction of dependencies, which a tool cannot guarantee.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic