HARMAN interview question

logic wise