Bosch interview question

Oop Questions, 2 coding problems with test cases