Siemens interview question

Question related to oops