Barclays interview question

Writing an mathematical algorithm (in any coding language) and assessing its complexity