Barclays interview question

coding questions