Decagon Interview Question

leetcode medium level design question