Swimm interview question

Try to create the product's main algorithm