Bloomberg interview question

Some coding question related to search.