Siemens interview question

Basic oops questions