Laserfiche Interview Question

leetcode style problem and object oriented design question