Virtusa interview question

write class inheritance code reverse array without another array