Toptal interview question

A coding challenge about algorithms