Algorithm · Amazon · Medium
Requirements Input: a graph of service dependencies; you are expected to settle on a representation with the interviewer, and hashmap > is a typical choice. The graph is promised to contain no cycles, but verify that assumption aloud before you begin implementation. Given an initial collection of stopped services, produce all services that rely on any stopped service, whether the reliance is immediate or through a chain. Examples Using edges written as (consumer →…
Checking your access…