Bending Spoons interview question

Tasks of logic, probability and coding