Salesforce onsite question
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2023-10-21Added By Anonymous
Source: Link
1In order to launch an application, we load smaller modules.These modules usually have dependencies on other modules.
2
3Print the order in which the application should load the modules given the dependency list between the modules.
4Let's say there are 4 modules to be loaded A, B, C & D
5
6A -> B, C, E
7B -> C, D
8C → D
9
10Assume you have these two functions available
11List<String> getModulesList() - Returns the list of modules to be loaded //[A, B, C, D]
12List<String> getDependencyList(String moduleName) - Returns the list of modules on which this module is depedent on
13Hi All, do you think we need to use graphs to solve this or map+priority queue would also work?