DXC Technology interview question

Greedy algorithm, method overriding, oops etc