SpinTheMic
Pro

Interview practice question

Two modules depend on each other

Backend Engineering · OOP and Design Patterns · Intermediate

The orders module imports the customers module, and customers imports orders, causing build issues and tangled code. How do you break the cycle?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Identify why each depends on the other.
  • Extract shared concept to new module.
  • Dependency inversion: interface in one, implementation in other.
  • Events instead of direct calls.
  • Enforce layering with tooling.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics