L4 DSA Rond question:
You are given a list of packages to compile, along with two APIs: getDependencies and compile (you can treat both as simple method calls).
The goal is to compile all the packages in a multithreaded environment. A package can only be compiled after all of its dependencies have been successfully compiled.
This problem is similar to https://leetcode.com/problems/course-schedule-ii/description/, but with the added complexity of multithreading.
Points to consider:
What is the best way to solve this?