Machstatz interview question

inheritance