Altice interview question

write code of some simples algorithms