Bending Spoons interview question

some mathematics and databases questions