Deemsys interview question

oops concepts