Siemens Interview Question

Simple basic coding and OOPS concepts