Next Pathway interview question

Some math and coding problems