Datadog interview question

Algorithms: DFS, string pattern matching