Toptal interview question

solving problems with data structures