Audible interview question

Both the questions were based on HashMap and HashSet Leetcode Medium level