Virtusa Interview Question

write class inheritance code reverse array without another array