Yandex interview question

and some algorithm questions from leet code or Hacker rank