Decagon interview question

leetcode medium level design question