Discovery Machine interview question

OOP concepts Java Brain puzzles