Siemens interview question

Simple basic coding and OOPS concepts