6D Technologies interview question

based on java mini project oops python intro