Oracle interview question

1 Leetcode problem(Medium) followed by design problems(eg design rest api, implement factory design pattern)