Chase interview question

The coding question abut algorithm