Splunk interview question

BFS graph question and a greedy algorithm question.