Pergunta de entrevista da empresa CTS

Inheritance based oops question in any language.