Optiver interview question

2 oop based hackerrank questions